Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Женя Бабий
Is that a correct expected behavior?

Женя Бабий

Jun 3, 2024

Input: [1000, 1000, 100, 100, 50, 50, 10, 10, 5, 5]. Expected result: [10, 10, 100, 100, 1000, 1000, 5, 5, 50, 50]. How is this a numeric descending order?

1

0

Comments
Comments
Ahmed Yarub Hani Al Nuaimi
Ahmed Yarub Hani Al Nuaimia year ago

Same for [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]. Looks like there is a mistake in the test cases.

V
Vladislav Nikolaeva year ago

Same with: [-5, -5, -4, -4, -3, -3, -2, -2, -1, -1]

Shubham Vora
Shubham Voraa year ago

Thanks for the suggestions! Test cases are fixed now.

On this page