Skip to content

Latest commit

 

History

History
57 lines (29 loc) · 387 Bytes

File metadata and controls

57 lines (29 loc) · 387 Bytes

Practice Problem #1

Add it

Write a program to add a number to every digits of a given number if it exceeds by 10 then consider only it's last digit.

Test case 1

input

345

3

Output

678

Explanation

3 +3 =6

4 + 3 = 7

5 + 3 = 8

Test case 2

Input

787

4

Output

121

Explanation

7+4=11 1 (last digit 1)

8+4=12 2

7+4=11 1

Test case 3

Input

471

4

Output

815