| about | help | code help+videos | done | prefs |
Write an expression that, given a non-negative integer n, computes a new integer in which the units and tens digits have swapped places. For example, if n = 123, the result should be 132; if n = 3, the tens digit is zero and the result should be 30. Return the result of a single expression that calculates a number with the units and tens digits of n swapped. swapLeastSignificantDigits(0) → 0 swapLeastSignificantDigits(4) → 40 swapLeastSignificantDigits(70) → 7 ...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: 10 Post-solution available
Copyright Nick Parlante 2017 - privacy