about | help | code help+videos | done | prefs |
sortedInsert
Given an integer, insert it into an already sorted array so that the resulting array is still sorted. Arrays will be and should be sorted in ascending order. If the original array is empty, return an array containing the one new value. sortedInsert(5, [2, 2, 3, 6]) → [2, 2, 3, 5, 6] sortedInsert(5, [2, 2, 3, 5, 6]) → [2, 2, 3, 5, 5, 6] sortedInsert(7, []) → [7] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy