leetcode candy, made some stuipid mistakes