随笔分类 -  LeetCode

摘要:原题描述Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see bel 阅读全文
posted @ 2018-01-11 10:14 小丑进场 阅读(121) 评论(0) 推荐(0) 编辑
摘要:原题描述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 co 阅读全文
posted @ 2018-01-11 09:34 小丑进场 阅读(150) 评论(0) 推荐(0) 编辑
摘要:题目描述 Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery s 阅读全文
posted @ 2018-01-06 10:59 小丑进场 阅读(155) 评论(0) 推荐(0) 编辑
摘要:题目描述You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin 阅读全文
posted @ 2018-01-06 10:42 小丑进场 阅读(332) 评论(0) 推荐(0) 编辑
摘要:题目描述Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeat 阅读全文
posted @ 2017-12-13 11:09 小丑进场 阅读(438) 评论(0) 推荐(0) 编辑
摘要:原题 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 a 阅读全文
posted @ 2017-05-25 11:22 小丑进场 阅读(256) 评论(0) 推荐(0) 编辑
摘要:原题 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree 阅读全文
posted @ 2017-05-25 10:20 小丑进场 阅读(174) 评论(0) 推荐(0) 编辑
摘要:原题 求二叉树的最大路径和 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to 阅读全文
posted @ 2017-05-23 09:28 小丑进场 阅读(150) 评论(0) 推荐(0) 编辑
摘要:原题 Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: Hints: If you notice carefully in 阅读全文
posted @ 2017-05-17 16:03 小丑进场 阅读(170) 评论(0) 推荐(0) 编辑
摘要:原题 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the neares 阅读全文
posted @ 2017-05-16 17:14 小丑进场 阅读(206) 评论(0) 推荐(0) 编辑
摘要:原题 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains o 阅读全文
posted @ 2017-05-09 09:12 小丑进场 阅读(278) 评论(0) 推荐(0) 编辑
摘要:原题 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size 阅读全文
posted @ 2017-05-04 16:17 小丑进场 阅读(133) 评论(0) 推荐(0) 编辑
摘要:原题 Description: Count the number of prime numbers less than a non-negative number, n. 求小于n(非负数)的所有质数(素数)。 思路 埃拉托色尼筛选法——用于求一定范围内的质数(效率高,推荐) 详戳这里百度or维基 阅读全文
posted @ 2017-05-02 14:11 小丑进场 阅读(226) 评论(0) 推荐(0) 编辑
摘要:原题 Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Her 阅读全文
posted @ 2017-05-02 09:05 小丑进场 阅读(256) 评论(0) 推荐(1) 编辑
摘要:原题 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have 阅读全文
posted @ 2017-04-27 14:24 小丑进场 阅读(169) 评论(0) 推荐(0) 编辑
摘要:原题 Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to 阅读全文
posted @ 2017-04-26 18:51 小丑进场 阅读(261) 评论(0) 推荐(0) 编辑
摘要:原题 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n =  阅读全文
posted @ 2017-04-11 17:21 小丑进场 阅读(146) 评论(0) 推荐(0) 编辑
摘要:原题 You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you 阅读全文
posted @ 2017-04-11 16:55 小丑进场 阅读(184) 评论(0) 推荐(0) 编辑
摘要:原题 Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the h 阅读全文
posted @ 2017-04-07 17:08 小丑进场 阅读(181) 评论(0) 推荐(0) 编辑
摘要:原题 A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. T 阅读全文
posted @ 2017-04-07 15:17 小丑进场 阅读(252) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示