If state if already calculated then return its answer
if ( dp [ start ] [ bucket ] != - 1 ) : NEW_LINE INDENT return dp [ start ] [ bucket ] NEW_LINE DEDENT zeroes = 0 NEW_LINE ones = 0 NEW_LINE ans = 10 ** 9 NEW_LINE