Last active
June 15, 2020 10:03
-
-
Save erhanyasar/63759ad767d1fa5550fb7eb6d6d10a81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const solution = (numbers) => { | |
let maxNumber = 0; | |
for (let i=0; i<numbers.length; i++){ | |
if (numbers.length < 1) | |
return maxNumber; | |
if (numbers[i] > maxNumber) | |
maxNumber = numbers[i]; | |
} | |
return maxNumber; | |
}; | |
console.log(solution([1,2,3,4,5,6])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment