上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 72 下一页
摘要: Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra 阅读全文
posted @ 2018-05-07 17:18 乐乐章 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2018-05-07 16:37 乐乐章 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOB 阅读全文
posted @ 2018-05-07 13:34 乐乐章 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't 阅读全文
posted @ 2018-05-06 09:45 乐乐章 阅读(171) 评论(0) 推荐(0) 编辑
摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
posted @ 2018-05-05 23:40 乐乐章 阅读(287) 评论(0) 推荐(0) 编辑
摘要: https://labuladong.gitbook.io/algo/mu-lu-ye/er-fen-cha-zhao-xiang-jie 1 int binary_search(int[] nums, int target) { 2 int left = 0, right = nums.lengt 阅读全文
posted @ 2018-05-05 22:30 乐乐章 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2018-05-05 21:50 乐乐章 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). Y 阅读全文
posted @ 2018-05-05 21:36 乐乐章 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order 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]). Y 阅读全文
posted @ 2018-05-05 21:28 乐乐章 阅读(1660) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2018-05-04 09:17 乐乐章 阅读(282) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 72 下一页