Find Encrypted Number

Problem Overview

  • Given a sequence of digits, repeatedly sum adjacent digits and keep the rightmost digit of each sum until only two digits remain.
  • Input: array numbers (2 <= n <= 5000, digits 0-9); Output: a 2-character string with the encrypted number.
  • Context: encryption scheme inspired by a Pascal Triangle process for data security.
  • From Amazon interviews; a coding interview problem and common interview question on arrays/strings.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: