Leetcode #904. Fruit Into Baskets Java Solution and Explanation | Google Interview Question
This is a well-known Google interview question. This seemingly simple problem has many different test cases, edge cases and “gotchas.” I find it to be a great exercise in arrays, pointers and general logic. There are no fancy data structures, dynamic programming, or algebraic formulas involved—just pure logic.