Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr) {
- let result = arr.filter((a, b) => a >= Math.max(...arr.slice(0, b)));
- console.log(result.join(' '));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement