Retired
Next Largest Value (by rearranging the last digit and the last by one if neccessary) (retired)
Description:
Design an algorithm that given an integer n
returns an array [a,b]
:
a
is obtained by reversing the digits in then
b
is obtained by reversing the last two digits ina
, ora
if that reversal doesn't make a larger number thana
Example :
largestValue(95659512354) => [45321595659,45321595695]
largestValue(19659512354) => [45321595691,45321595691]
Fundamentals
Algorithms
Arrays
Similar Kata:
Stats:
Created | Jul 12, 2017 |
Warriors Trained | 167 |
Total Skips | 32 |
Total Code Submissions | 200 |
Total Times Completed | 49 |
JavaScript Completions | 49 |
Total Stars | 4 |
% of votes with a positive feedback rating | 75% of 28 |
Total "Very Satisfied" Votes | 17 |
Total "Somewhat Satisfied" Votes | 8 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 27 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |