LeetCode Kth Smallest Element in a Sorted Matrix 378. Kth Smallest Element in a Sorted Matrix [https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/description/] Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is the kth smallest element in the

LeetCode First Bad Version 278. First Bad Version [https://leetcode.com/problems/first-bad-version/] You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a

LeetCode Split Array Largest Sum 410. Split Array Largest Sum [https://leetcode.com/problems/split-array-largest-sum/] Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays. Note: If n is the length

LeetCode H-Index II 275. H-Index II [https://leetcode.com/problems/h-index-ii/] Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? public class Solution { public int hIndex(int[] citations) { if (citations == null || citations.length == 0) { return 0; } int low = 0, high = citations.length -

Array Search Insert Position 35. Search Insert Position [https://leetcode.com/problems/search-insert-position/] Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Here are

LeetCode Median of Two Sorted Arrays 4. Median of Two Sorted Arrays [https://leetcode.com/problems/median-of-two-sorted-arrays/] There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: nums1 = [1, 3] nums2

LintCode First Position of Target LintCode-14.First Position of Target > For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. > If the target number does not exist in the array, return -1. > Example > If the array is [1, 2, 3, 3,

LintCode Find Minimum in Rotated Sorted Array II LintCode-160.Find Minimum in Rotated Sorted Array II [http://www.lintcode.com/en/problem/find-minimum-in-rotated-sorted-array-ii/] > Suppose a sorted array is rotated at some pivot unknown to you beforehand. > (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). > Find the minimum element.