Doing everything from description but just have no idea what I am doing wrong.
For 'apple juice':
Expected: '323456789ABCDEF012345677D9A76634',
instead got: '023456789ABCDEF01234567ADE358DE4'
Sorry, I'm still at a loss. I decided to try again, but I'm stuck as I was before. I'm passing the first test, but I'm doing something wrong with some order, I think...
2nd sample test: "apple juice", then with padding or not, if I sort descending, first character would be 'u' (char code 117), index is 0, 117 % 16 is 5, which is same in hex, but expected starts with '3'...
Nice format. First time I have seen someone format a one liner.
I did not know you can use "apply" on a function instead of the spread operator (...arr), TIL.
Gotta understand what "apply" does but it looks helpful
The third instruction should be made clearer by stating that the sorting should be done based on ascii value in the form of a string.
Lexicographically sort the list by its' value descending
(see twypsy's post below; I had the same problem :))
Doing everything from description but just have no idea what I am doing wrong.
For 'apple juice':
Expected: '323456789ABCDEF012345677D9A76634',
instead got: '023456789ABCDEF01234567ADE358DE4'
[Best Practices 0] [Clever 0] [Racist 1]
Sorry, I'm still at a loss. I decided to try again, but I'm stuck as I was before. I'm passing the first test, but I'm doing something wrong with some order, I think...
2nd sample test: "apple juice", then with padding or not, if I sort descending, first character would be 'u' (char code 117), index is 0, 117 % 16 is 5, which is same in hex, but expected starts with '3'...
At which point is my approach wrong?
He's basically asking you to convert to a string and then sort.
Could you clarify what kind of sorting do you expect? (js) Should I sort the ordinal values desc or characters themselves?
Thank you, fixed.
The function name should be in camelCase in JavaScript.
Hey, thanks for the suggestion. I don't log on a lot anymore nowadays but took the opportunity to fix it up immediately.
This comment is hidden because it contains spoiler information about the solution
A minor typo in the description:
- Change each value into a hex[A]decimal value 0-F
Thanks sautumn, i've learnt something new here!
Loading more items...