Advertisement
dabidabidesh

Untitled

Jun 1st, 2020
1,241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function maxNumber1(arr) {
  2.   'use strict'
  3.  
  4.   let output = ''
  5.   for (let i = 0; i < arr.length; i++) {
  6.     let flag = true
  7.     for (let j = i + 1; j < arr.length; j++)
  8.       if (arr[i] <= arr[j])
  9.         flag = false
  10.     if (flag)
  11.       output += arr[i] + ' '
  12.   }
  13.   console.log(output)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement