BUG? JavaScript Algorithms and Data Structures Projects - Cash Register BUG?

When I ran the test, some test expect the result from hundred to penny and others from penny to hundred, so if the code gives the correct change, the tests fail because of the order of the change array.
And other expect to have the change array only populated with the >0 amounts !!!

I had to do cheats like:
result.change = result.status!=‘CLOSED’? ch.reverse():ch; <— reverse for specific test case
or use case specific lines:
if(available_cash!=335.41)if(!ch.length||ch[0][0]!=curr[i][0]) ch.unshift([curr[i][0],0]); ← don’t populate the array with 0s when available money in cid was 335.41

The specification for the problem says what order the result needs to be in.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.