MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / getSmaller

Function getSmaller

binary-trees/same-bsts.js:17–24  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

15}
16
17function getSmaller(array) {
18 const smaller = [];
19
20 for (let i = 1; i < array.length; i++) {
21 if (array[i] < array[0]) smaller.push(array[i]);
22 }
23 return smaller;
24}
25
26function getBiggerOrEqual(array) {
27 const biggerOrEqual = [];

Callers 1

sameBstsFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected