DE Shaw | Off Campus(MTS1) | Hackerrank CodePair

Q) You are given a very large stream of digits(0-9) and you have 2 functions:
Read -> It returns a digit in sequence from the stream (doesn't take any argument)
Write -> It takes a number/digit as argument and outputs the number
Output the stream of digits after adding 1 using only these two functions.

Ex ; Input: 1, 5, 2, 4, 8, 9 Output: 1, 5, 2, 4, 9, 0

Comments (3)