#1805
Number of Different Integers in a String
pupil · 495 · lc easy +27 · verified · 40.1% accepted · 663 likes · top 19%
Description
Given a string word of digits and lowercase letters, replace every non-digit with a space, then count distinct integers formed by the resulting numeric segments (leading zeros are ignored). Return the count.
Code
1
2
3