Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let print = [input[0]];
- for (let i = 1; i <= input.length; i++){
- if(print[print.length - 1] <= input[i]) {
- print.push(input[i]);
- }
- }
- console.log(print.join(" "));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement