Created
June 4, 2017 15:32
-
-
Save tasdikrahman/f2d11c33b6ed7a7ffae878b042e036bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a new number C from A and B (both non -ve’s) | |
- 1st digit of C = 1st digit of A | |
- 2nd digit of C = 1st digit of B | |
- 3rd digit of C = 2nd digit of A | |
- 4th digit of C = 2nd digit of B | |
- so on | |
Rules | |
- A & B are non -ve’s | |
- function should return -1 if result is more than 100,000,000 | |
Sample I/O | |
- func(12, 56) -> 1526 | |
- func(56, 12) -> 5162 | |
- func(12345, 678) -> 16273845 | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment