-
[프로그래머스/javascript] 큰 수 만들기 (꼭 다시 풀기 못풀었다)카테고리 없음 2023. 3. 20. 11:50
function solution(number, k) { let stack = []; for(let i=0;i<number.length;i++){ while(stack.length>0&&stack[stack.length-1]<number[i]&&k>0){ stack.pop() k--; } stack.push(number[i]) } stack.splice(stack.length-k,k) return stack.join('') }