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