Skip to content

Instantly share code, notes, and snippets.

@tasdikrahman
Created June 4, 2017 15:32
Show Gist options
  • Save tasdikrahman/f2d11c33b6ed7a7ffae878b042e036bf to your computer and use it in GitHub Desktop.
Save tasdikrahman/f2d11c33b6ed7a7ffae878b042e036bf to your computer and use it in GitHub Desktop.
"""
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