Intuit | Technical 1 (Zoom) | Checksum
Anonymous User
2497

I was asked this coding question for SE2 role with an Intuit.

  • Given a string "5 7 8 9 \n 8 7 6 \n 4 5 6", differentiate rows from \n and find the largest and smallest number and return a sum of the largest and smallest numbers for each row. Return sum of all the numbers from each row.

Input: "5 7 8 9 \n 8 7 6 \n 4 5 6"
{14, 14, 10} - Return sum of all the numbers in an array
Output: 38

How would you approach solution for this problem. Any suggestions would be appreciated.

Comments (6)