|
|
|
|
|
by Mystrl
743 days ago
|
|
Oh hey that's the question I got for my recent amazon onsite (slightly different constraints). I couldn't find the exact question online and I thought it was a "fair" medium question. IMO this is a pretty good question there's a really easy suboptimal solution so people don't get completely stuck, the optimizations are pretty straightforward and there's a lot of room to demonstrate you can write clean code. *Fair meaning there's no crazy tricks to it or any obscure algorithms just applying DSA fundamentals. |
|
I wouldn't expect more than brute force. But being able to reason about this, having some working familiarity with graphs etc, is not an unfair bar.