题目地址:https://leetcode.com/problems/merge-two-binary-trees/description/ 大意:合并二叉树 # 617. Merge Two Binary Trees …
分类:LeetCode
力扣(LeetCode)-131 分割字符串
本题考察的是深度优先搜索+回溯+回文串判断 题目描述 给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。 返回 s 所有可能的分割方案。 示例: 输入: “aab” 输出: [ […
2018-06-27 19. Remove Nth Node From End of List
题意:给你一个单项链表和一个值n,将倒着数第n个节点删除后,返回head指针。题意要求最好只遍历链表一遍。 解题思路: 思路一:定义一个全局变量cnt,使用递归调用,找到最后一个节点,每返回一个节点cnt就加一,如果cn…
246. Strobogrammatic Number
246- Strobogrammatic Number **Question Editorial Solution My Submissions Total Accepted: 12358 Total Submissio…
[LeetCode] Burst Balloons 打气球游戏
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number…
[LeetCode] Longest Word in Dictionary through Deleting 删除后得到的字典中的最长单词
Given a string and a string dictionary, find the longest string in the dictionary that can be formed by…
[LeetCode] Optimal Division 最优分隔
Given a list of positive integers, the adjacent integers will perform the float division. For exam…
LeetCode 257 Binary Tree Paths
题目描述 Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2…
[Leetcode] Reorder List 链表重新排序
Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do…
[LeetCode][Python]268. Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the…
444. Sequence Reconstruction
Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequ…
334. 递增的三元子序列
334. 递增的三元子序列 问题 给定一个未排序的数组,判断这个数组中是否存在长度为 3 的递增子序列。 数学表达式如下: 如果存在这样的 i, j, k, 且满足 0 ≤ i < j < k ≤ n-1, …