← LendingKart questions

Sort a nearly sorted (or K sorted) array

Filed under LendingKart

The question

Given an array where each element is at most k places away from its sorted position, sort the array efficiently.

No write-up yet. Related questions below have one.

Related LendingKart questions

Collected from public candidate posts and coding forums. Updated Nov 2026.