hardCombinatoricsMathNumber TheoryString 0 views
Check If Digits Are Equal in String After Operations II
You are given a string s consisting of digits.
You are given a string s consisting of digits. Perform the following operation repeatedly until the string has exactly two digits:
Return true if the final two digits in s are the same; otherwise, return false.
Example 1
Input: s = "3902"
Output: true
Example 2
Input: s = "34789"
Output: false
Constraints
- 3 <= s.length <= 10^5
- s consists of only digits.
Hints
Companies
No companies reported yet.
Discussion
Sign in to join the discussion.
Loading discussion...
Test results
No test cases yet.