Input 1 4 8 15 12 14 1 13 Expected Output 9
Note: You can also use F5 to update the logs. This would also retain cursor position while scrolling.