![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 80
pigofzhou
知行合一,行胜于言!Hello New World!
展开
-
leetcode day01
时间限制:1秒 空间限制:32768K 热度指数:13273本题知识点: 树 leetcode 算法知识视频讲解题目描述Given 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 f...原创 2018-03-19 22:27:35 · 120 阅读 · 0 评论 -
LeetCode Two Sum、3Sum、3Sum Closest、4Sum
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 exactly one solution, and you may not use the same el...原创 2018-03-23 16:30:52 · 129 阅读 · 0 评论 -
LeetCode Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the l...原创 2018-03-24 10:40:27 · 126 阅读 · 0 评论 -
LeetCode Reverse Integer、Palindrome Number
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321 Example 2:Input: -123 Output: -321 Example 3:Input: 120 Output: 21 Note:Assume we are dealing with an envi...原创 2018-03-24 11:17:53 · 159 阅读 · 0 评论 -
LeetCode Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, y < 231.Exa...原创 2018-03-25 13:00:26 · 148 阅读 · 0 评论 -
LeetCode Implement strStr()
Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll" Output: 2 Example 2:Input:...原创 2018-03-25 13:27:31 · 271 阅读 · 0 评论 -
LeetCode Ugly Number、Ugly Number II、Happy Number、Add Digits
Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it i...原创 2018-03-25 15:30:31 · 317 阅读 · 0 评论 -
LeetCode Valid Perfect Square
Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt.Example 1:Input: 16 Returns: True Ex...原创 2018-03-25 16:08:16 · 281 阅读 · 0 评论