5 kyu
[Code Golf] Yet Another Base Conversion
65 of 70anter69
Description:
Task
Convert the given number (provided as a string) from one number base to the other. The given number will always be non-negative, and valid in the given base. Return the result also as a string.
- input number is < 1025
- bases range from 2 to 62
- the digits used are:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
Examples
[number] [from] [to] [result]
----------------------------------------
"0" any any --> "0"
"255" 10 16 --> "ff"
"101010" 2 10 --> "42"
"c0de" 16 2 --> "1100000011011110"
"CodeWars" 62 26 --> "onah0naham"
Your code can be maximum 170 bytes long.
My other katas
If you enjoyed this kata then please try my other katas! :-)
Translations are welcome!
Algorithms
Similar Kata:
Stats:
Created | Mar 22, 2019 |
Published | Mar 22, 2019 |
Warriors Trained | 253 |
Total Skips | 24 |
Total Code Submissions | 501 |
Total Times Completed | 70 |
Python Completions | 65 |
Ruby Completions | 11 |
Total Stars | 9 |
% of votes with a positive feedback rating | 86% of 40 |
Total "Very Satisfied" Votes | 33 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 35 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |