Search
⌘K

Leetcode 3463. Check If Digits Are Equal in String After Operations II

Given a digit string s, repeatedly replace it by the sequence of pairwise sums modulo 10 of adjacent digits until only two digits remain, and determine whether those final two digits are equal; because |s| can be up to 1e5, the solution requires computing the final digits efficiently using the combinatorial (Pascal's triangle / binomial coefficient) weights modulo 10 rather than simulating all reductions.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.