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 the n

  • b is obtained by reversing the last two digits in a, or a if that reversal doesn't make a larger number than a

Example :

largestValue(95659512354) => [45321595659,45321595695]
largestValue(19659512354) => [45321595691,45321595691]
Fundamentals
Algorithms
Arrays

Stats:

CreatedJul 12, 2017
Warriors Trained167
Total Skips32
Total Code Submissions200
Total Times Completed49
JavaScript Completions49
Total Stars4
% of votes with a positive feedback rating75% of 28
Total "Very Satisfied" Votes17
Total "Somewhat Satisfied" Votes8
Total "Not Satisfied" Votes3
Total Rank Assessments27
Average Assessed Rank
7 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Dragomirc Avatar
  • cliffstamp Avatar
Ad