Does accumulator == stack?? If not, how should anything ever be added to the stack? The lack of explanation (for everything) is a big problem.
accumulator == stack
Your last sample test also seems to be broken. The s is never pushed to output.
s
most insignificant digits
It's "least significant bits".
RGB888 = 4c6a02 R = 4c (hex) = 01001100 (bin) G = 6a (hex) = 01101010 (bin) B = 02 (hex) = 00000010 (bin) BGR555 = 000000110101001 (bin) = 425 (dec) = 01a9 (hex) Expected: "001a" But was: "a901"
Either the reference solution is wrong, or some information is missing from the description.
Edit: I've looked at your solution, and it is indeed incorrect.
Remove the three most insignificant digits from each byte to get a 5-digit binary number (ex. 10001).
What if it's already less than 5 digits? What if it's 6 digits long?
Loading collection data...
Does
accumulator == stack
?? If not, how should anything ever be added to the stack? The lack of explanation (for everything) is a big problem.Your last sample test also seems to be broken. The
s
is never pushed to output.It's "least significant bits".
Either the reference solution is wrong, or some information is missing from the description.
Edit: I've looked at your solution, and it is indeed incorrect.
What if it's already less than 5 digits? What if it's 6 digits long?