Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array.
Example 1
1 | Input: A = [4,7,9,10], K = 1 |
Example 2:
1 | Input: A = [4,7,9,10], K = 3 |
Example 3:
1 | Input: A = [1,2,4], K = 3 |
Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array.
Example 1
1 | Input: A = [4,7,9,10], K = 1 |
Example 2:
1 | Input: A = [4,7,9,10], K = 3 |
Example 3:
1 | Input: A = [1,2,4], K = 3 |
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), find the minimum number of conference rooms required.
Example 1
1 | Input: [[0, 30],[5, 10],[15, 20]] |
Example 2
1 | Input: [[7,10],[2,4]] |
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), determine if a person could attend all meetings.
Example 1:
1 | Input: [[0,30],[5,10],[15,20]] |
Example 2:
1 | Input: [[7,10],[2,4]] |
Given two strings s and t , write a function to determine if t is an anagram of s.
Example 1:
1 | Input: s = "anagram", t = "nagaram" |
Example 2:
1 | Input: s = "rat", t = "car" |
Note:
You may assume the string contains only lowercase alphabets.
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
You must write an algorithm that runs in O(n) time and without using the division operation.
Example 1:
1 | Input: nums = [1,2,3,4] |
Example 2:
1 | Input: nums = [-1,1,0,-3,3] |