Best Time to Buy and Sell Stock II
LeetCode 122. Best Time to Buy and Sell Stock II 원문 You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or s...
LeetCode 122. Best Time to Buy and Sell Stock II 원문 You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or s...
LeetCode 121. Best Time to Buy and Sell Stock 원문 You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single ...
LeetCode 189. Rotate Array 원문 Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. 풀이 python: deque의 rotate를 사용한다. python: list slicing 코드 Python...
LeetCode 169. Majority Element 원문 Given an array nums of size n, return the majority element. The majority element is the element that appears more than [n / 2] times. You may assume that the maj...
LeetCode 80. Remove Duplicates from Sorted Array II 원문 Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twi...
LeetCode 26. Remove Duplicates from Sorted Array 원문 Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The ...
LeetCode 27. Remove Element 원문 Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of e...
LeetCode 88. Merge Sorted Array 원문 You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums...