随笔分类 -  LeetCode

上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 61 下一页
摘要:Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] 阅读全文
posted @ 2015-05-06 13:01 Grandyang 阅读(95676) 评论(24) 推荐(7) 编辑
摘要:Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The a 阅读全文
posted @ 2015-05-06 01:05 Grandyang 阅读(68360) 评论(27) 推荐(3) 编辑
摘要:Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 之前做到 Reve 阅读全文
posted @ 2015-05-05 12:45 Grandyang 阅读(26683) 评论(9) 推荐(1) 编辑
摘要:Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity shou 阅读全文
posted @ 2015-04-29 14:37 Grandyang 阅读(80436) 评论(40) 推荐(6) 编辑
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2015-04-29 13:49 Grandyang 阅读(20999) 评论(14) 推荐(4) 编辑
摘要:Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Explanation: "aba" is also a valid answer 阅读全文
posted @ 2015-04-29 00:09 Grandyang 阅读(80090) 评论(31) 推荐(4) 编辑
摘要:Count the number of prime numbers less than a non-negative number, n. Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less t 阅读全文
posted @ 2015-04-28 13:40 Grandyang 阅读(27803) 评论(3) 推荐(1) 编辑
摘要:Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character.​​ 阅读全文
posted @ 2015-04-27 23:05 Grandyang 阅读(60245) 评论(16) 推荐(3) 编辑
摘要:You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, hei 阅读全文
posted @ 2015-04-25 00:28 Grandyang 阅读(29970) 评论(6) 推荐(1) 编辑
摘要:Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 阅读全文
posted @ 2015-04-24 00:29 Grandyang 阅读(9398) 评论(5) 推荐(0) 编辑
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any 阅读全文
posted @ 2015-04-24 00:06 Grandyang 阅读(26759) 评论(12) 推荐(1) 编辑
摘要:Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2015-04-22 13:40 Grandyang 阅读(31294) 评论(7) 推荐(2) 编辑
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(() 阅读全文
posted @ 2015-04-21 13:47 Grandyang 阅读(38424) 评论(10) 推荐(0) 编辑
摘要:Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i 阅读全文
posted @ 2015-04-20 15:20 Grandyang 阅读(19576) 评论(11) 推荐(1) 编辑
摘要:Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or 阅读全文
posted @ 2015-04-20 13:24 Grandyang 阅读(25430) 评论(10) 推荐(0) 编辑
摘要:Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer division should tru 阅读全文
posted @ 2015-04-16 14:04 Grandyang 阅读(31638) 评论(25) 推荐(1) 编辑
摘要:Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 阅读全文
posted @ 2015-04-16 11:53 Grandyang 阅读(21911) 评论(8) 推荐(0) 编辑
摘要:A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3], the following 阅读全文
posted @ 2015-04-15 12:53 Grandyang 阅读(45014) 评论(13) 推荐(2) 编辑
摘要:Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Example 1: Inpu 阅读全文
posted @ 2015-04-14 14:02 Grandyang 阅读(28784) 评论(10) 推荐(1) 编辑
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 阅读全文
posted @ 2015-04-14 12:53 Grandyang 阅读(26815) 评论(0) 推荐(1) 编辑

上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 61 下一页
Fork me on GitHub