본문 바로가기
반응형

Leetcode11

Leetcode <Binary Search> 668. Kth Smallest Number in Multiplication Table 44.8% Hard Nearly every one have used the Multiplication Table. But could you find out the k-th smallest number quickly from the multiplication table? Given the height m and the length n of a m * n Multiplication Table, and a positive integer k, you need to return the k-th smallest number in this table. k번째 작은 수를 구해야한다. m 높이 , n 넓이 Example 1: Input: m = 3, n = 3, k = 5 Output: Explanation: The Multiplicati.. 2020. 4. 11.
Leetcode <Sort> 1235. Maximum Profit in Job Scheduling 44.1% Hard We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i]. You're given the startTime , endTime and profit arrays, you need to output the maximum profit you can take such that there are no 2 jobs in the subset with overlapping time range. If you choose a job that ends at time X you will be able to start another job that starts at tim.. 2020. 4. 11.
Leetcode <Binary Search> 287. Find the Duplicate Number 53.1% Medium Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one. 배열에는 중복된 수가 무조건 존재하고 이 수를 찾기 Example 1: Input: [1,3,4,2,2] Output: 2 Example 2: Input: [3,1,3,4,2] Output: 3 Note: You must not modify the array (assume the array is read only).. 2020. 4. 10.
Leetcode <Sort> 1366. Rank Teams by Votes 50.6% Medium In a special ranking system, each voter gives a rank from highest to lowest to all teams participated in the competition. The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first position, we consider the second position to resolve the conflict, if they tie again, we continue this process until the ties are resolved. If two or more teams.. 2020. 4. 10.
반응형