随笔分类 -  Leetcode

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
leetcode 660. Remove 9
摘要:Start from integer 1, remove any integer that contains 9 such as 9, 19, 29... So now, you will have a new integer sequence: 1, 2, 3, 4, 5, 6, 7, 8, 10 阅读全文
posted @ 2017-08-14 09:54 Beserious 阅读(247) 评论(0) 推荐(0) 编辑
leetcode 395. Longest Substring with At Least K Repeating Characters
摘要:Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than  阅读全文
posted @ 2017-08-11 16:26 Beserious 阅读(133) 评论(0) 推荐(0) 编辑
leetcode 442. Find All Duplicates in an Array
摘要:Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2017-08-10 22:11 Beserious 阅读(167) 评论(0) 推荐(0) 编辑
leetcode 405. Convert a Number to Hexadecimal
摘要:Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: Example 1: Example 2: 阅读全文
posted @ 2017-08-08 15:26 Beserious 阅读(153) 评论(0) 推荐(0) 编辑
leetcode 242. Valid Anagram
摘要:Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2017-08-08 11:51 Beserious 阅读(152) 评论(0) 推荐(0) 编辑
leetcode 506. Relative Ranks
摘要: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-08-08 10:32 Beserious 阅读(114) 评论(0) 推荐(0) 编辑
leetcode 316. Remove Duplicate Letters
摘要:Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your 阅读全文
posted @ 2017-08-07 19:31 Beserious 阅读(200) 评论(0) 推荐(0) 编辑
leetcode 654. Maximum Binary Tree
摘要:Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given array a 阅读全文
posted @ 2017-08-07 10:33 Beserious 阅读(238) 评论(0) 推荐(0) 编辑
leetcode 653. Two Sum IV - Input is a BST
摘要:Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-08-07 10:30 Beserious 阅读(375) 评论(0) 推荐(0) 编辑
leetcode 656. Coin Path
摘要:Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. The integer B denotes that from any place (suppose th 阅读全文
posted @ 2017-08-06 22:14 Beserious 阅读(883) 评论(0) 推荐(0) 编辑
leetcode 258. Add Digits
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2017-08-06 21:02 Beserious 阅读(133) 评论(0) 推荐(0) 编辑
leetcode 231. Power of Two
摘要:Given an integer, write a function to determine if it is a power of two. 阅读全文
posted @ 2017-08-05 22:33 Beserious 阅读(142) 评论(0) 推荐(0) 编辑
leetcode 400 Add to List 400. Nth Digit
摘要:Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi 阅读全文
posted @ 2017-08-04 22:51 Beserious 阅读(164) 评论(0) 推荐(0) 编辑
leetcode 209. Minimum Size Subarray Sum
摘要: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-08-03 18:35 Beserious 阅读(144) 评论(0) 推荐(0) 编辑
103. Binary Tree Zigzag Level Order Traversal
摘要:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2017-07-31 15:04 Beserious 阅读(126) 评论(0) 推荐(0) 编辑
leetcode 226. Invert Binary Tree
摘要:Invert a binary tree. to . 阅读全文
posted @ 2017-07-30 20:26 Beserious 阅读(126) 评论(0) 推荐(0) 编辑
leetcode 520. Detect Capital
摘要: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-07-30 19:59 Beserious 阅读(139) 评论(0) 推荐(0) 编辑
leetcode 414. Third Maximum Number
摘要:Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文
posted @ 2017-07-29 19:00 Beserious 阅读(138) 评论(0) 推荐(0) 编辑
leetcode 532. K-diff Pairs in an Array
摘要:Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2017-07-29 15:30 Beserious 阅读(173) 评论(0) 推荐(0) 编辑
leetcode 581. Shortest Unsorted Continuous Subarray
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2017-07-29 12:41 Beserious 阅读(136) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页