function solution(numbers) {
var answer = new Array(numbers.length).fill(-1);
var stack = [];
for(var i =0;i<numbers.length;i++){
while(stack&&numbers[stack.at(-1)]<numbers[i]){
answer[stack.pop()] = numbers[i];
}
stack.push(i);
}
return answer;
}
// function solution(numbers) {
// var answer = [];
// for (let i=0;i<numbers.length;i++){
// let nextNumber=-1;
// for (let j=i+1;j<numbers.length;j++){
// if (numbers[j]>numbers[i]){
// nextNumber=numbers[j]
// break;
// }
// }
// answer.push(nextNumber)
// }
// return answer;
// }