about | help | code help+videos | done | prefs |
Write a method that accepts a positive integer less than 10000 called 'num' and a single positive digit called 'digit'. Return a number with the digits in 'num' in reverse order with 'digit' inserted between each digit in 'num'. Look at the test data for examples. NO STRING methods or any other form of string usage is allowed. NO ARRAYS or ARRAY LISTS are allowed either! You have to solve this one using div and mod. jan11_2016_HLinterlaceDigits(5, 1) → 51 jan11_2016_HLinterlaceDigits(23, 9) → 3929 jan11_2016_HLinterlaceDigits(124, 0) → 402010 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy