Skip to main content
deleted 93 characters in body
Source Link
Chas Brown
  • 9.8k
  • 1
  • 13
  • 39

Python 2, 84 8175 bytes

lambda c,a:reduce(lambda t(h,bm),(d,e):all(bd&e)and(0,0)or((t[0]+b[0]h+d)%24,(t[1]+b[1]m+e)%60),a,c)

Try it online!

EDIT: Saved 3 bytes by replacing b[0]&b[1] with all(b); thx 2 Eric The Outgolfer.Try it online!

Function that takes time as a tuple (hour,minute); outputs same way.

Python 2, 84 81 bytes

lambda c,a:reduce(lambda t,b:all(b)and(0,0)or((t[0]+b[0])%24,(t[1]+b[1])%60),a,c)

Try it online!

EDIT: Saved 3 bytes by replacing b[0]&b[1] with all(b); thx 2 Eric The Outgolfer.

Function that takes time as a tuple (hour,minute); outputs same way.

Python 2, 84 75 bytes

lambda c,a:reduce(lambda(h,m),(d,e):(d&e)and(0,0)or((h+d)%24,(m+e)%60),a,c)

Try it online!

Function that takes time as a tuple (hour,minute); outputs same way.

added 91 characters in body
Source Link
Chas Brown
  • 9.8k
  • 1
  • 13
  • 39

Python 2, 8484 81 bytes

lambda c,a:reduce(lambda t,b:b[0]&b[1]andall(b)and(0,0)or((t[0]+b[0])%24,(t[1]+b[1])%60),a,c)

Try it online!Try it online!

EDIT: Saved 3 bytes by replacing b[0]&b[1] with all(b); thx 2 Eric The Outgolfer.

Function that takes time as a tuple (hour,minute); outputs same way.

Python 2, 84 bytes

lambda c,a:reduce(lambda t,b:b[0]&b[1]and(0,0)or((t[0]+b[0])%24,(t[1]+b[1])%60),a,c)

Try it online!

Function that takes time as a tuple (hour,minute); outputs same way.

Python 2, 84 81 bytes

lambda c,a:reduce(lambda t,b:all(b)and(0,0)or((t[0]+b[0])%24,(t[1]+b[1])%60),a,c)

Try it online!

EDIT: Saved 3 bytes by replacing b[0]&b[1] with all(b); thx 2 Eric The Outgolfer.

Function that takes time as a tuple (hour,minute); outputs same way.

Source Link
Chas Brown
  • 9.8k
  • 1
  • 13
  • 39

Python 2, 84 bytes

lambda c,a:reduce(lambda t,b:b[0]&b[1]and(0,0)or((t[0]+b[0])%24,(t[1]+b[1])%60),a,c)

Try it online!

Function that takes time as a tuple (hour,minute); outputs same way.