Search
⌘K

Leetcode 2221. Find Triangular Sum of an Array

Given an array of digits, repeatedly replace it by the array of adjacent pairwise sums modulo 10 until only one number remains and return that value. The core challenge is recognizing the result equals sum(nums[i] * C(n-1,i)) mod 10 (with n up to 1000), so compute that efficiently under modulo arithmetic.


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.