
OJ
文章平均质量分 55
Morrisss_
做更好地自己。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode OJ-129.Sum Root to Leaf Numbers
LeetCode OJ-129.Sum Root to Leaf Numbers题目描述 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whi原创 2017-09-10 12:31:27 · 673 阅读 · 0 评论 -
LeetCode OJ-2.Add Two Numbers
LeetCode OJ-2.Add Two Numbers题目描述 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digi原创 2017-03-09 14:51:46 · 687 阅读 · 0 评论 -
LeetCode OJ-78.Subsets
LeetCode OJ-78.Subsets题目描述 Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example, If nums = [1,2,3],原创 2017-01-17 15:33:22 · 547 阅读 · 0 评论 -
LeetCode OJ-77.Combinations
LeetCode OJ-77.Combinations题目描述 Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4]原创 2017-01-16 18:48:29 · 520 阅读 · 0 评论 -
LeetCode OJ-74.Search a 2D Matrix
LeetCode OJ-74.Search a 2D Matrix题目描述 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from原创 2017-01-16 09:24:38 · 636 阅读 · 0 评论 -
LeetCode OJ-55.Jump Game
LeetCode OJ-55.Jump Game题目描述 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length原创 2017-01-09 11:54:07 · 472 阅读 · 0 评论 -
LeetCode OJ-49.Group Anagrams
LeetCode OJ-49.Group Anagrams题目描述 Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: [ ["ate", "eat","tea"],原创 2017-01-07 10:45:26 · 602 阅读 · 0 评论 -
LeetCode OJ-46.Permutations(全排列问题)
LeetCode OJ-46.Permutations(全排列问题)题目描述 Given a collection of distinct numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3原创 2017-01-06 17:00:48 · 673 阅读 · 0 评论 -
LeetCode OJ-16.3Sum Closest(最接近三数和)
LeetCode OJ-16.3Sum Closest(最接近三数和)题目描述 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may原创 2016-12-29 15:12:13 · 589 阅读 · 0 评论 -
LeetCode OJ-15.3Sum(三数和问题)
LeetCode OJ-15.3Sum(三数和问题)问题描述 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: T原创 2016-12-28 18:16:19 · 911 阅读 · 0 评论 -
LeetCode OJ-11.Container With Most Water
LeetCode OJ-11.Container With Most Water题目描述 Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints o原创 2016-12-27 16:13:22 · 503 阅读 · 0 评论 -
LeetCode OJ-6.ZigZag Conversion
LeetCode OJ-6.ZigZag Conversion题目描述 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better le原创 2017-03-09 17:01:34 · 558 阅读 · 0 评论 -
LeetCode OJ-19.Remove Nth Node From End of List
LeetCode OJ-19.Remove Nth Node From End of List题目描述 Given a linked list, remove the *n*th node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, an原创 2017-03-20 16:48:11 · 553 阅读 · 0 评论 -
LeetCode OJ-34.Search for a Range
LeetCode OJ-34.Search for a Range题目描述 Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm’s runtime complexity mus原创 2017-07-16 22:04:50 · 534 阅读 · 0 评论 -
LeetCode OJ-419.Battleships in a Board
LeetCode OJ-419.Battleships in a Board题目描述 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 assume th原创 2017-04-27 12:22:42 · 576 阅读 · 0 评论 -
LeetCode OJ-537.Complex Number Multiplication
LeetCode OJ-537.Complex Number Multiplication题目描述 Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the原创 2017-04-26 17:59:26 · 750 阅读 · 0 评论 -
LeetCode OJ-4.Median of Two Sorted Arrays
LeetCode OJ-4.Median of Two Sorted Arrays题目描述 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity原创 2017-04-25 20:26:39 · 527 阅读 · 0 评论 -
LeetCode OJ-560.Subarray Sum Equals K
LeetCode OJ-560.Subarray Sum Equals K题目描述 Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums原创 2017-05-06 15:56:47 · 951 阅读 · 0 评论 -
LeetCode OJ-392.Is Subsequence
LeetCode OJ-392.Is Subsequence题目描述 Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially原创 2017-05-12 16:11:28 · 608 阅读 · 0 评论 -
LeetCode OJ-513.Find Bottom Left Tree Value
LeetCode OJ-513.Find Bottom Left Tree Value题目描述 Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3Output:1 Example 2:原创 2017-05-02 17:33:25 · 709 阅读 · 0 评论 -
LeetCode OJ-338.Counting Bits
LeetCode OJ-338.Counting Bits题目描述 Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as a原创 2017-04-28 14:17:25 · 527 阅读 · 0 评论 -
LeetCode OJ-14.Longest Common Prefix
LeetCode OJ-14.Longest Common Prefix题目描述 Write a function to find the longest common prefix string amongst an array of strings. Subscribe to see which companies asked this question. Show Ta原创 2017-03-14 17:35:51 · 737 阅读 · 0 评论 -
LeetCode OJ-20.Valid Parentheses
LeetCode OJ-20.Valid Parentheses题目描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct原创 2017-03-21 10:19:22 · 478 阅读 · 0 评论 -
LeetCode OJ-3.Longest Substring Without Repeating Characters(最长无重复子串)
LeetCode OJ-3.Longest Substring Without Repeating Characters(最长无重复子串)题目描述 3. Longest Substring Without Repeating Characters Add to List QuestionEditorial Solution My Submissions原创 2016-12-26 16:34:09 · 519 阅读 · 0 评论 -
LeetCode OJ-22.Generate Parentheses(回溯法)
LeetCode OJ-22.Generate Parentheses(回溯法)题目描述 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is:原创 2017-01-03 19:41:54 · 937 阅读 · 0 评论 -
hdu-1379 DNA Sorting
DNA SortingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3088 Accepted Submission(s): 1529Problem DescriptionOne measure of原创 2016-07-19 19:38:56 · 540 阅读 · 0 评论 -
LeetCode OJ-283. Move Zeroes
283. Move ZeroesGiven an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3,原创 2016-07-29 09:59:44 · 353 阅读 · 0 评论 -
LeetCode OJ-226. Invert Binary Tree(反转二叉搜索树)
226. Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1实际上就是将节点的左右子树交换位置,代码如下:/** * Definiti原创 2016-07-29 09:28:49 · 638 阅读 · 0 评论 -
LeetCode OJ-104. Maximum Depth of Binary Tree(求二叉树最大深度)
104. Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node原创 2016-07-28 10:48:30 · 635 阅读 · 0 评论 -
LeetCode OJ-258. Add Digits
258. Add DigitsGiven 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: 3 + 8 = 11, 1 + 1原创 2016-07-28 10:10:05 · 379 阅读 · 0 评论 -
LeetCode OJ-292. Nim Game
LeetCode OJ-292. Nim GameYou are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who rem原创 2016-07-28 09:49:38 · 403 阅读 · 0 评论 -
hdu-1062 Text Reverse
Text ReverseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25953 Accepted Submission(s): 10068Problem DescriptionIgnatius li原创 2016-07-12 20:41:41 · 563 阅读 · 0 评论 -
hdu-1005 Number Sequence
Number SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 144163 Accepted Submission(s): 35045Problem Description:A number seq原创 2016-03-18 13:51:48 · 636 阅读 · 0 评论 -
hdu-1088 Write a simple HTML Browser
Write a simple HTML BrowserTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10513 Accepted Submission(s): 3030Problem Description原创 2016-07-14 09:53:06 · 549 阅读 · 0 评论 -
hdu-1113 Word Amalgamation
Word AmalgamationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3425 Accepted Submission(s): 1686Problem DescriptionIn milli原创 2016-07-14 20:26:29 · 500 阅读 · 0 评论 -
LeetCode OJ-169. Majority Element
169. Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-em原创 2016-08-04 09:47:37 · 447 阅读 · 0 评论 -
LeetCode OJ-100. Same Tree
100. Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same原创 2016-08-01 09:32:54 · 417 阅读 · 0 评论 -
LeetCode OJ-18.4Sum(四数和)
LeetCode OJ-18.4Sum(四数和)题目描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of t原创 2017-01-03 16:17:15 · 629 阅读 · 0 评论 -
hdu-1029 Ignatius and the Princess IV
hdu-1029 Ignatius and the Princess IV题目描述 Ignatius and the Princess IV Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 28646 Accepted S原创 2016-12-16 16:51:28 · 1251 阅读 · 0 评论 -
LeetCode OJ-190. Reverse Bits
190. Reverse BitsReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented原创 2016-08-31 18:02:12 · 496 阅读 · 0 评论