Step 1: Initial sorted array
K (max difference):
4
Left pointer:
0
Right pointer:
0
Current window size:
1
Max valid segment:
1
Min removals needed:
6
Previous
Next