From 25865cc9bbbaa83a5523b7223b6b0a323b4dc014 Mon Sep 17 00:00:00 2001 From: Prathamesh Gawas <41731424+Prathamesh010@users.noreply.github.com> Date: Tue, 30 Nov 2021 02:13:40 +0530 Subject: [PATCH] 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 --- .../data-structures/insert-an-element-into-a-max-heap.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/10-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.md b/curriculum/challenges/english/10-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.md index d21a47bc2a..f264d004b7 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.md +++ b/curriculum/challenges/english/10-coding-interview-prep/data-structures/insert-an-element-into-a-max-heap.md @@ -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); })() ); ```