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

0% completed

Vote For New Content

Solution with only one loop

Enrique Fernández

Jan 2, 2025

2

17

0

Feb 23, 2025

Better solution

Mohammed Dh Abbas

Jul 20, 2024

0

23

0

Jul 20, 2024

Example Test Case [1, 1, 1, 1, 1] violates constraint

vetaranto

Apr 7, 2024

2

21

0

Mar 26, 2025

Why does this solution not contain the line if nums[i] != i + 1: # Check if the current element is in its correct position

Joe

Mar 5, 2024

1

16

0

Aug 12, 2024

It's possible to track the duplicates while performing the cyclic sort. I think ...

Nash Luffman

Mar 4, 2023

9

43

2

Nov 9, 2024

When I try [3, 1, 3, 4, 2] as the input, the nums list looks like [1, 2, 3, 4, ...

Gary

Mar 31, 2022

0

16

1

Mar 31, 2022

For the first example, the input array after a cycle sort is performed on it is ...

Richard Yuan

Mar 23, 2022

4

22

1

Jan 20, 2024