https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ Best Time to Buy and Sell Stock II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com DP 알고리즘(Dynamic Programming)을 활용한 문제라고 한다. https://galid1.tistory.com/507 알고리즘 - Dynamic Programming(동적프로그래밍)이란? Dynamic Programmin..
리트코드 동아리가 오늘 생겼다고 해서, 뒤늦게 해보고 있다. 나는 TypeScript로 도전... https://leetcode.com/problems/remove-duplicates-from-sorted-array/ 먼저 짰던 코드는 요거 function removeDuplicates(nums: number[]): number { let i: number; let j: number; i = 0; j = 1; for (j; j < nums.length; j++) if (nums[i] != nums[j]) nums[++i] = nums[j]; return i + 1; }; 이걸 위해서... 기본 프로토타입은 주어졌으니, TS와 JS 매뉴얼을 읽어가며 이해하는데 좀 시간이 걸렸다. - 선언한 변수 뒤에 : ..