分类：LeetCode题目解答

LeetCode 9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. 判断一个正整数是不是回文数。 回文数的定义是，将这个数反转之后，得到的…

LeetCode 28. Implement strStr()

Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not pa…

LeetCode 25. Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a posit…

LeetCode 13. Roman to Integer

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Su…

LeetCode Single Number

Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algor…

LeetCode 77. Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example,If n…

LintCode Binary Tree Maximum Node二叉树的最大节点

Find the maximum node in a binary tree, return the node. 样例 给出如下一棵二叉树： 1 / -5 2 / \ / 0 3 -4 -5 返回值为 3 的节点。 分析…

LeetCode 11. Container With Most Water

Given n non-negative integers *a1 *, *a2 *, …, an , where each represents a point at coordinate (i, ai )…

LeetCode 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You …

LeetCode 280. Wiggle Sort II

Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]&…

LeetCode 121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permi…

一篇文章搞懂面试中leetcode位操作算法题

Single Number落单的数 落单的数 IISingle Number II Single Number III落单的数 III Number of 1 Bits Counting Bits Reverse Bit…