Dec 19th – Jan 11th around 20 days Need to do medium questions of these tags: DFS BFS DP Stack Heap Trie…
标签:LeetCode
716. Max Stack
Hard 讲真这道题说不上Hard吧,对Stack, PriorityQueue稍微熟悉一点就能做,注意几点: PriorityQueue的constructor,我一开始纠结于那个initial capacity要怎么…
重复值问题
题目:Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function sho…
617. Merge Two Binary Trees
题目地址:https://leetcode.com/problems/merge-two-binary-trees/description/ 大意:合并二叉树 # 617. Merge Two Binary Trees …
力扣(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][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, …
712. 两个字符串的最小ASCII删除和
class Solution(object): def minimumDeleteSum(self, s1, s2): """ :type s1: str :type s2: str :rtype: int """ # …
Leetcode - Power of Four
My code: public class Solution { public boolean isPowerOfFour(int num) { return num > 0 && (num &am…