Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function minNumber(input) {
- index = 0;
- let command = input[index];
- index++;
- let minNum = Number.MAX_SAFE_INTEGER;
- while (command !== "Stop") {
- let currentNum = Number(command);
- if (currentNum < minNum) {
- minNum = currentNum;
- }
- command = input[index];
- index++;
- }
- console.log(minNum);
- }
Advertisement
Add Comment
Please, Sign In to add comment