text consists of lowercase English letters and digits. Every unbroken run of digits forms one number; letters only separate the numbers.
Two numbers count as the same if they have the same value: leading zeros do not matter, so 7, 07 and 007 are all one number.
Return how many distinct numbers appear in the text.text="room12floor7room012" → 2
The numbers are 12, 7 and 012. Leading zeros are ignored, so 012 is the same as 12: two distinct numbers.
text="x0y00z5" → 2
0 and 00 are both zero, plus 5: two in total.
text="nodigits" → 0
text consists of lowercase English letters and digitstext="room12floor7room012"
2
Run checks the first 3 tests in your browser. Submit checks all 127 tests on the server, hidden ones included.