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.

Fruit baskets. Source

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
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.