gas station is easy but candy is tricky (wrong for one test case)