6 kyu
Mid-Endian numbers
51 of 195GiacomoSorbi
Description:
While most devs know about big/little-endianness, only a selected few know the secret of real hard core coolness with mid-endians.
Your task is to take a number and return it in its mid-endian format, putting the most significant couple of bytes in the middle and all the others around it, alternating left and right.
For example, consider the number 9999999
, whose hexadecimal representation would be 98967F
in big endian (the classic you get converting); it becomes 7F9698
in little-endian and 96987F
in mid-endian.
Write a function to do that given a positive integer (in base 10) and remembering that you need to pad with 0
s when you get a single hex digit!
Algorithms
Similar Kata:
Stats:
Created | Jul 5, 2018 |
Published | Jul 6, 2018 |
Warriors Trained | 658 |
Total Skips | 45 |
Total Code Submissions | 875 |
Total Times Completed | 195 |
JavaScript Completions | 51 |
Python Completions | 93 |
Ruby Completions | 20 |
Crystal Completions | 4 |
C++ Completions | 37 |
C# Completions | 22 |
Total Stars | 14 |
% of votes with a positive feedback rating | 91% of 67 |
Total "Very Satisfied" Votes | 58 |
Total "Somewhat Satisfied" Votes | 6 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 7 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |