Tap here to switch tabs
Problem
Submissions

Problem: Check If Digits Are Equal in String After Operations I

med
30 min
Try to solve the Check If Digits Are Equal in String After Operations I problem.

Statement

You are given a string s consisting of numerical digits.

You perform the following operation repeatedly until the length of s becomes 22:

For each index i from 00 to s.length −2- 2, calculate the sum of the digit at index i and the digit at index i + 1 modulo 1010. Then, create a new string formed by these calculated digits in order, and replace s with this new string.

Return true if the two digits remaining in s are equal, or false otherwise.

Constraints:

  • 3≤3 \leq s.length ≤100\leq 100

  • s consists of only digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check If Digits Are Equal in String After Operations I

med
30 min
Try to solve the Check If Digits Are Equal in String After Operations I problem.

Statement

You are given a string s consisting of numerical digits.

You perform the following operation repeatedly until the length of s becomes 22:

For each index i from 00 to s.length −2- 2, calculate the sum of the digit at index i and the digit at index i + 1 modulo 1010. Then, create a new string formed by these calculated digits in order, and replace s with this new string.

Return true if the two digits remaining in s are equal, or false otherwise.

Constraints:

  • 3≤3 \leq s.length ≤100\leq 100

  • s consists of only digits.