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.md
This commit is contained in:
@ -110,8 +110,12 @@ assert(
|
|||||||
test.insert(700);
|
test.insert(700);
|
||||||
test.insert(32);
|
test.insert(32);
|
||||||
test.insert(51);
|
test.insert(51);
|
||||||
let result = test.print();
|
test.insert(800);
|
||||||
return result.length == 5 ? result[0] == 700 : result[1] == 700;
|
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);
|
||||||
})()
|
})()
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user