Skip to content
Discussion options

You must be logged in to vote

We need to repeatedly perform operations on a string of digits until only two digits remain. Each operation involves calculating a new digit from each pair of consecutive digits by taking their sum modulo 10, and then replacing the string with these new digits in order. The goal is to determine if the final two digits are the same.

Approach

  1. Simulation: The problem can be solved by simulating the operations as described. We repeatedly process the string until its length is reduced to exactly two digits.
  2. Operation Details: For each operation, we iterate through the current string, compute the new digits for each consecutive pair, and form a new string from these computed digits.
  3. Terminatio…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@basharul-siddike
Comment options

@mah-shamim
Comment options

mah-shamim Oct 23, 2025
Maintainer Author

Answer selected by basharul-siddike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested easy Difficulty
2 participants