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
pull/44318/head
Prathamesh Gawas 2021-11-30 02:13:40 +05:30 committed by GitHub
parent 0ed6b0607b
commit 25865cc9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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);
})()
);
```