Back
Close

Changing Digits

Statement

 Goal

Count the number of times the digits in a number changes. For example: 333 changes 0 times and 123 changes 2 times.
Input
An integer N
Output
The number of times the digits in N changes
Constraints
0<N
Example
Input
123
Output
2

Game modes
Fastest, Shortest, Reverse

Test cases
Example Test
Input
123
Output
2

Example Validator Validator
Input
1234
Output
3

Test 1 Test
Input
2314
Output
3

Validator 1 Validator
Input
73185
Output
4

Test 2 Test
Input
1111
Output
0

Validator 2 Validator
Input
0000
Output
0

Test 3 Test
Input
33278110
Output
5

Validator 3 Validator
Input
233457
Output
4

Test 4 Test
Input
112233445566778899
Output
8

Validator 4 Validator
Input
102233445566887799
Output
9

Test 5 Test
Input
1111156546792222666666666878756217777777515555555597887811111155552669988888888877778785555521
Output
39

Validator 5 Validator
Input
55555555555556666666666687888888117862222222256668785878787855122222005000
Output
28

Test 6 Test
Input
0100100001100101011011000110110001101111001000000101011101101111011100100110110001100100
Output
46

Validator 6 Validator
Input
011010000110000101100011011010110110010101110010011011010110000101101110
Output
42

Solution language

Solution

Stub generator input