随笔分类 -  LeetCode

上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 61 下一页
摘要:Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2017-03-07 08:54 Grandyang 阅读(4826) 评论(0) 推荐(0)
摘要:Given an integer array nums and an integer k, return true if nums has a continuous subarray of size at least two whose elements sum up to a multiple o 阅读全文
posted @ 2017-03-05 08:25 Grandyang 阅读(17759) 评论(7) 推荐(2)
摘要:Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: "bbbab 阅读全文
posted @ 2017-03-02 23:30 Grandyang 阅读(20149) 评论(7) 推荐(1)
摘要:Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-02-28 23:43 Grandyang 阅读(6561) 评论(1) 推荐(1)
摘要:Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2017-02-27 23:34 Grandyang 阅读(5514) 评论(0) 推荐(0)
摘要:Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The 阅读全文
posted @ 2017-02-25 21:12 Grandyang 阅读(11330) 评论(0) 推荐(0)
摘要:Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2017-02-23 23:45 Grandyang 阅读(12900) 评论(8) 推荐(2)
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-02-20 21:55 Grandyang 阅读(6790) 评论(2) 推荐(0)
摘要:Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 这道题给了我们一个数,让我们转为七进制的 阅读全文
posted @ 2017-02-20 00:09 Grandyang 阅读(7002) 评论(2) 推荐(0)
摘要:You need to find the largest value in each row of a binary tree. Example: 这道题让我们找二叉树每行的最大的结点值,那么实际上最直接的方法就是用层序遍历,然后在每一层中找到最大值,加入结果res中即可,参见代码如下: 解法一: 阅读全文
posted @ 2017-02-19 23:29 Grandyang 阅读(4979) 评论(0) 推荐(0)
摘要:Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. Example: Note: 阅读全文
posted @ 2017-02-18 23:13 Grandyang 阅读(13640) 评论(1) 推荐(0)
摘要:Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2017-02-16 12:28 Grandyang 阅读(7082) 评论(4) 推荐(0)
摘要:You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2. Find all the next greater numbers for nums 阅读全文
posted @ 2017-02-15 03:15 Grandyang 阅读(17420) 评论(5) 推荐(1)
摘要:In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascend 阅读全文
posted @ 2017-02-14 22:01 Grandyang 阅读(4867) 评论(0) 推荐(0)
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2017-02-13 23:21 Grandyang 阅读(20227) 评论(8) 推荐(1)
摘要:For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now i 阅读全文
posted @ 2017-02-11 23:57 Grandyang 阅读(3630) 评论(6) 推荐(0)
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2017-02-10 22:11 Grandyang 阅读(9110) 评论(5) 推荐(2)
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2017-02-09 11:57 Grandyang 阅读(27108) 评论(10) 推荐(2)
摘要:Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example 1: Input: [1,0,1,1,0] Output: 4 E 阅读全文
posted @ 2017-02-07 22:15 Grandyang 阅读(11278) 评论(2) 推荐(2)
摘要:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2017-02-06 11:25 Grandyang 阅读(12748) 评论(4) 推荐(0)

上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 61 下一页
Fork me on GitHub