Fork me on GitHub
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 37 下一页
摘要: 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 @ 2017-07-16 12:14 hellowOOOrld 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: 思路: 将0改为-1,将原题目改成求最大连续区间,区间 阅读全文
posted @ 2017-07-15 22:43 hellowOOOrld 阅读(128) 评论(0) 推荐(0) 编辑
摘要: https://discuss.leetcode.com/topic/91430/c-clean-solution-answers-to-follow-upGiven a list of directory info including directory path, and all the fil 阅读全文
posted @ 2017-07-13 09:35 hellowOOOrld 阅读(414) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
posted @ 2017-07-12 21:56 hellowOOOrld 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2017-07-11 23:01 hellowOOOrld 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may ass 阅读全文
posted @ 2017-07-11 22:43 hellowOOOrld 阅读(168) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
posted @ 2017-07-10 21:38 hellowOOOrld 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: All letters in hexadec 阅读全文
posted @ 2017-07-10 20:53 hellowOOOrld 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable xand it 阅读全文
posted @ 2017-07-09 12:01 hellowOOOrld 阅读(668) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: 思路: 层次遍历。 阅读全文
posted @ 2017-07-09 11:56 hellowOOOrld 阅读(622) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 37 下一页