"""
    Difficulty: ****
    Code:       ***
Given an array arr of length n where each element is at most k places away from its sorted position,
Plan and code an efficient algorithm to sort arr.
Analyze the runtime and space complexity of your solution.

Example: n=10, k=2.
The element belonging to index 6 in the sorted array, may be at indices 4, 5, 6, 7 or 8 on the given array.

Ref: http://www.geeksforgeeks.org/nearly-sorted-algorithm/
Useful API: https://docs.python.org/3.5/library/heapq.html

"""
