Input 4 4 10 1 6 6 6 10 -7 -8 6 4 0 4 -2 0 -6 -10 8 8 -10 -6 5 -5 -3 7 -10 Expected Output 0 0 0 1 1 3 2 0
Note: You can also use F5 to update the logs. This would also retain cursor position while scrolling.