Beta
Reach 1 as Quick as Possible
14cemsina
Description:
Give an algorithm that takes an integer k (k > 0) as parameter, and returns the minimum number of steps needed to convert k to 1. In each step, one can apply one of the operations given below:
• Divide by three. This operation can be applied only if the number is divisible by three.
• Divide by two. This operation can be applied only if the number is divisible by two.
• Subtract one
Code size must be less than 116 characters.
Code must be one line.
TESTS:
- Easy: 1 to 100
- Normal: 500 to 2000
- Hard: 2000 to 10000
- Insane: 10^6 to 10^7
- Unhuman: 10^50 to 10^51
Algorithms
Performance
Fundamentals
Similar Kata:
Stats:
Created | Aug 24, 2021 |
Published | Aug 24, 2021 |
Warriors Trained | 92 |
Total Skips | 1 |
Total Code Submissions | 169 |
Total Times Completed | 14 |
Python Completions | 14 |
Total Stars | 4 |
% of votes with a positive feedback rating | 67% of 6 |
Total "Very Satisfied" Votes | 3 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 4 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 6 kyu |