-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathwarmUp12.js
More file actions
24 lines (17 loc) · 849 Bytes
/
Copy pathwarmUp12.js
File metadata and controls
24 lines (17 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* your task is to write a function that returns the smallest and largest integers in an unsorted string.
Input
Your function will receive two arguments:
A string comprised of integers in an unknown range; these numbers will be out of order
An integer value representing the size of the range
Output
Your function should return the starting (minimum) and ending (maximum) numbers of the range in the form of an array/list comprised of two integers.
Test Example
let inputString = '1568141291110137';
mysteryRange(inputString,10) // [6,15]
-The 10 numbers in this string are:
-15 6 8 14 12 9 11 10 13 7
-Therefore the range of numbers is from 6 to 15
Technical Details
-The maximum size of a range will be 100 integers
-The starting number of a range will be: 0 < n < 100
*/