You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -303,4 +303,47 @@ confirmEnding("If you want to save our world, you must hurry. We dont know how m
303
303
confirmEnding("Abstraction", "action") should return true.
304
304
305
305
Your code should not use the built-in method .endsWith() to solve the challenge.
306
+
```
307
+
308
+
309
+
## Get Index
310
+
311
+
Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted. The returned value should be a number.
312
+
313
+
For example, getIndexToIns([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).
314
+
315
+
Likewise, getIndexToIns([20,3,5], 19) should return 2 because once the array has been sorted it will look like [3,5,20] and 19 is less than 20 (index 2) and greater than 5 (index 1).
316
+
317
+
```javascript
318
+
getIndexToIns([10, 20, 30, 40, 50], 35) should return 3.
319
+
320
+
getIndexToIns([10, 20, 30, 40, 50], 35) should return a number.
321
+
322
+
getIndexToIns([10, 20, 30, 40, 50], 30) should return 2.
323
+
324
+
getIndexToIns([10, 20, 30, 40, 50], 30) should return a number.
325
+
326
+
getIndexToIns([40, 60], 50) should return 1.
327
+
328
+
getIndexToIns([40, 60], 50) should return a number.
329
+
330
+
getIndexToIns([3, 10, 5], 3) should return 0.
331
+
332
+
getIndexToIns([3, 10, 5], 3) should return a number.
333
+
334
+
getIndexToIns([5, 3, 20, 3], 5) should return 2.
335
+
336
+
getIndexToIns([5, 3, 20, 3], 5) should return a number.
337
+
338
+
getIndexToIns([2, 20, 10], 19) should return 2.
339
+
340
+
getIndexToIns([2, 20, 10], 19) should return a number.
341
+
342
+
getIndexToIns([2, 5, 10], 15) should return 3.
343
+
344
+
getIndexToIns([2, 5, 10], 15) should return a number.
0 commit comments