I got an array [3,4,8,9] I want to increment the last index by 1 and if that index is 9 I want to increment the preceding index in a way that full number becomes [3,4,9,0].
You can provide a solution in java or javascript. I tried coding this problem and I have failed. Any help will be greatly appreciated.