https://school.programmers.co.kr/learn/courses/30/lessons/181927
function solution(num_list) {
const length = num_list.length;
const lastNum = num_list[length-1];
const notLast = num_list[length-2];
const addValue = lastNum > notLast ? lastNum - notLast : lastNum * 2;
return [...num_list, addValue]
}