Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function maxNumber1(arr) {
- 'use strict'
- let output = ''
- for (let i = 0; i < arr.length; i++) {
- let flag = true
- for (let j = i + 1; j < arr.length; j++)
- if (arr[i] <= arr[j])
- flag = false
- if (flag)
- output += arr[i] + ' '
- }
- console.log(output)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement