We want to merge the digits of two integers having the same number of digits to obtain a new integer whose digits are obtained by alternating the digits of the two integers. Example: if the given integers are 1234 and 8765, the result will be 18273645.
Complete the function merge(n1, n2) which, for n1, n2 given, returns the merged number.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers19
Suggested Problems
-
27615 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2538 Solvers
-
Number of 1s in a binary string
10997 Solvers
-
1487 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
254 Solvers
More from this Author53
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!