Tap here to switch tabs
Problem
Submissions

Problem: Number of Different Integers in a String

med
30 min
Try to solve the Number of Different Integers in a String problem.

Statement

You are given a string word consisting of digits and lowercase English letters.

Replace every non digit character with a space, then separate the remaining contiguous digit sequences into integers. Two integers are considered equal if they evaluate to the same decimal value after ignoring leading zeros.

Return the number of unique integers in word.

Constraints:

  • 1≤1 \le word.length ≤1000\le 1000

  • word consists of digits and lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Different Integers in a String

med
30 min
Try to solve the Number of Different Integers in a String problem.

Statement

You are given a string word consisting of digits and lowercase English letters.

Replace every non digit character with a space, then separate the remaining contiguous digit sequences into integers. Two integers are considered equal if they evaluate to the same decimal value after ignoring leading zeros.

Return the number of unique integers in word.

Constraints:

  • 1≤1 \le word.length ≤1000\le 1000

  • word consists of digits and lowercase English letters.