Skip to content

Instantly share code, notes, and snippets.

Péter Diviánszky divipp

  • Budapest
Block or report user

Report or block divipp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7563697
water is = w1 + w2 + t1 - length is * m1 where
(t1,m1,w1) = foldl f (0,0,0) is
(t2,m2,w2) = foldl f (0,0,0) $ reverse is
f (t,m,w) i = (t+i, max m i, w + max 0 (m-i))
View gist:7453089
water is = w1 + w2 + t1 - length is * m1 where
(t1,m1,w1) = foldr f (0,0,0) is
(t2,m2,w2) = foldr f (0,0,0) $ reverse is
f i (t,m,w) = (t+i, max m i, w + max 0 (m-i))
You can’t perform that action at this time.