题目: Given a binary tree, return the inorder traversal of its nodes’ values. For example: Given…
分类:LeetCode
【Leetcode】2. Add Two Numbers 两个链表的对应元素加和的新链表
1. 题目 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse o…
LeetCode | Clone Graph(克隆图)
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.…
LeetCode | Length of Last Word(最后一个单词的长度)
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return …
LeetCode | Integer to Roman(整数转换成罗马数字)
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 关于…
leetcode 93. Restore IP Addresses
ip的每一个由.分割的部分称为字段,例如“12.13.23.34”的四个字段分别为12,13,23和34 思路1 dfs每一个字符,对每一个字符,做相应的操作 针对每一个字符,有两种可能:一是作为ip某个字段的最后一位数…
LeetCode算法题-Longest Palindrome(Java实现-五种解法)
这是悦乐书的第220次更新,第232篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第87题(顺位题号是409)。给定一个由小写或大写字母组成的字符串,找到可以用这些字母构建的最长的回文长度。…
279. 完全平方数
直接转化为换零钱问题 我的代码的效率不是最高的, 但是可读性很好. class Solution(object): def numSquares(self, n): """ :type n: int :rtype: in…
49. Group Anagrams
49. Group Anagrams 题目 Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "…
30. Substring with Concatenation of All Words
欢迎fork and star:Nowcoder-Repository-github 30. Substring with Concatenation of All Words 题目 You are given a st…
1. Two Sum
1. Two Sum 题目 Given an array of integers, return indices of the two numbers such that they add up to a specifi…
[LeetCode] Palindrome Number 验证回文数字
Determine whether an integer is a palindrome. An integer is a palindrome when it re…