Input 16 5 2 1 2 2 3 1 5 4 3 3 3 1 1 2 4 5 5 5 4 4 4 3 4 2 2 1 3 4 5 4 2 Expected Output 5 1 0 2 0 3 0 5 5 3 3 2 0 1 1 4 5 6 5 3 3 5 3 5 2 1 0 3 3 5 3 2 Stress testing completedUpdate Logs
Note: You can also use F5 to update the logs. This would also retain cursor position while scrolling.