Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Hi there.I believe you may have a mistake in the description of the first soluti...

Idan

Apr 9, 2022

Hi there.

I believe you may have a mistake in the description of the first solution. For the squares array to be sorted in a non-descending order, you'd have to add the smaller square each time, not the bigger one.,

3

0

Comments
Comments
Design Gurus
Design Gurus4 years ago

Do you have any input where the given solution produces wrong results?

J
Jharol Rivera3 years ago

I agree with you because we are moving from the smallest number to the biggest one (backward for the pointer 1 and forward for the pointer 2)

On this page

Problem Statement

Try it yourself