Company: Ernst and young_18oct
Difficulty: medium
Panel Changes Problem Description A mechanical counter displays a number using one rotating panel per digit. The counter starts with every panel showing 0 , and is then stepped forward one unit at a time until it displays N . Each step advances the rightmost panel by one. Whenever a panel rolls over from 9 back to 0 , the panel immediately to its left also advances by one, and that may roll over in turn, and so on. A panel change is one panel turning once. A single step of the counter can therefore cause more than one panel change. Given N , report the total number of panel changes that occur while the counter advances from 0 to N . The counter has as many panels as it needs; panels that never turn do not contribute to the count, so the answer does not depend on how wide the display is. Complete the PanelChanges function in the editor. Input Format A single line containing one integer N , the final number shown on the panel. Output Format A single integer, the total number of panel cha