**Tell us what’s happening:**

Describe your issue in detail here.

```
**Your code so far**
```

```
const amounts = {
PENNY: 0.01,
NICKEL: 0.05,
DIME: 0.1,
QUARTER: 0.25,
ONE: 1,
FIVE: 5,
TEN: 10,
TWENTY: 20,
"ONE HUNDRED": 100
};
const typesSorted = [ //By the most value to the least value
"ONE HUNDRED",
"TWENTY",
"TEN",
"FIVE",
"ONE",
"QUARTER",
"DIME",
"NICKEL",
"PENNY"
];
let lst = [];
let lstTypes = [];
let states = {};
let ans = {};
function addToAns(pos){
let type = lstTypes[pos];
if(!(type in ans)){
ans[type] = 0;
}
ans[type] += lst[pos];
}
function stateGo(pos, rem){
if(Math.abs(rem) < 1e-5){
return true;
}
if(rem < 0){
return false;
}
if(pos >= lst.length || lst[pos] > rem){
return false;
}
let strState = `${pos} ${rem}`;
if(strState in states){
return false;
}
states[strState] = true;
if(stateGo(pos+1, rem-lst[pos])){
addToAns(pos);
return true;
}
if(stateGo(pos+1, rem)){
return true;
}
return false;
}
function checkCashRegister(price, cash, cid) {
let smCID = 0;
let lstTmp = [];
cid.forEach((key) => {
let type = key[0];
let amount = key[1];
smCID += amount;
let cnt = Math.round(amount / amounts[type]);
let amountOne = amounts[type];
while(cnt > 0){
let some = Math.ceil(cnt / 2);
lstTmp.push([Math.round(100 * some * amountOne) / 100, type]);
cnt -= some;
}
});
let diff = cash - price;
if(smCID < diff){ //insufficient
return {status: "INSUFFICIENT_FUNDS", change: []};
} else if(Math.abs(smCID - diff) < 1e-5){ //Equal
return {status: "CLOSED", change:cid};
} else { //Check if it is possible
lstTmp = lstTmp.sort((a, b)=>{return a[0] > b[0];}); //Increasing order
lstTmp.forEach((key) => {lst.push(key[0]); lstTypes.push(key[1]);});
if(stateGo(0, diff)){
let result = [];
typesSorted.forEach((type) => {
if(type in ans){
result.push([type, Math.round(100 * ans[type]) / 100]);
}
});
//Maybe I should have sorted it in another way?
//result = result.sort((a, b) => {return a[1] < b[1]});
return {status: "OPEN", change: result};
} else {
return {status: "INSUFFICIENT_FUNDS", change: []};
}
}
}
```

```
**Your browser information:**
```

User Agent is: `Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0`

**Challenge:** Cash Register

**Link to the challenge:**

If I am getting the problem right, there shouldn’t be anything wrong with my code. I checked its output for one of the failed tests and the output was sane (it was possible, and its sum was as requested). Can there be any other reasons why it fails? For example my output should be sorted in another way, or judge only accepts solutions giving the exact same output that it has?