ChenZengze's Blog


  • 首页

  • 归档

【Leetcode】153. Find Minimum in Rotated Sorted Array

发表于 2017-09-06 | | 阅读次数
DescriptionSuppose 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 ...
阅读全文 »

【Leetcode】162. Find Peak Element

发表于 2017-09-06 | | 阅读次数
DescritionA peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and retur ...
阅读全文 »

【Leetcode】189. Rotate Array

发表于 2017-09-04 | | 阅读次数
DescirptionRotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1, ...
阅读全文 »

KMP算法

发表于 2017-08-14 | | 阅读次数
BackgroundKMP算法是常会考察的算法,这次全部搞通。首先,这是一个典型的字符串匹配问题,起源是看九章算法基础班视频的时候,第一个就讲的strStr,首先来个直接给面试官的回答。1234567891011121314151617public int strStr(String source, ...
阅读全文 »

【Leetcode】 219. Contains Duplicate II

发表于 2017-08-05 | | 阅读次数
DescriptionGiven an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[ ...
阅读全文 »

【Leetcode】228. Summary Ranges

发表于 2017-08-04 | | 阅读次数
DescriptionGiven a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return [“0->2”,”4-& ...
阅读全文 »

【Leetcode】229. Majority Element II

发表于 2017-08-02 | | 阅读次数
DescriptionGiven an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1 ...
阅读全文 »

【Leetcode】 169. Majority Element

发表于 2017-08-01 | | 阅读次数
DescriptionGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assu ...
阅读全文 »

【Leetcode】238. Product of Array Except Self

发表于 2017-08-01 | | 阅读次数
DescriptionGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements o ...
阅读全文 »

【Leetcode】268. Missing Number

发表于 2017-07-31 | | 阅读次数
DescriptionGiven an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array. For example,Given nums ...
阅读全文 »
123…5
陈曾泽

陈曾泽

静水流深

41 日志
3 标签
GitHub Twitter Instagram
© 2017 陈曾泽
由 Hexo 强力驱动
主题 - NexT.Pisces