Leetcode #904. Fruit Into Baskets Java Solution and Explanation | Google Interview Question

janac
7 min readApr 6, 2021

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.

Fruit baskets. Source

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.