Skip to content

Instantly share code, notes, and snippets.

Zibx Zibx

Block or report user

Report or block Zibx

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
@Zibx
Zibx / waterfill
Last active Dec 27, 2015
Quest from twitter interview
View waterfill
var calculate = function( arr ){ // one cycle solution
var minMax,
sum = 0,
fullSum = 0,
el,
maxMax,
i, _i = arr.length - 1;
minMax = arr[0]; // first item is the current left max
maxMax = arr[_i]; // last item is the current right max
You can’t perform that action at this time.