fix(curriculum): add better test case for insert-an-element-into-a-max-heap challenge (#44285)
* fix(cirriculum): add better testcase for insert-an-element-into-a-max-heap challenge * fix(cirriculum): fix testcase for insert-an-element-into-a-max-heap challenge * Update insert-an-element-into-a-max-heap.md * Update insert-an-element-into-a-max-heap.mdpull/44318/head
parent
0ed6b0607b
commit
25865cc9bb
|
@ -110,8 +110,12 @@ assert(
|
|||
test.insert(700);
|
||||
test.insert(32);
|
||||
test.insert(51);
|
||||
let result = test.print();
|
||||
return result.length == 5 ? result[0] == 700 : result[1] == 700;
|
||||
test.insert(800);
|
||||
const result = test.print();
|
||||
const solution = JSON.stringify([null,800,51,700,32,50,100]);
|
||||
const solutionWithoutNull = JSON.stringify([800,51,700,32,50,100]);
|
||||
|
||||
return (result.length == 6) ? (JSON.stringify(result) == solutionWithoutNull) : (JSON.stringify(result) == solution);
|
||||
})()
|
||||
);
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue