485. Max Consecutive Ones # 题目 # Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutive 1s. The maximum numbe
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. Your KthLargest class will have a constructor which accepts an integer k and an integer array nums, which contains initia...
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. Your KthLargest class will have a constructor which accepts an integer k and an integer array nums, which contains initia...
min_element / max_element 29 3. copy / copy_n /copy_backward 29 4. fill / fill_n 29 5. remove / remove_if 30 6. unique 31 7. rotate 32 8. random_shuffle 32 9. partition / stable_partition 33 10. sort / stable_sort 33 11. partial_sort 34 12. nth_element 34 13. lower_...