Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary sea…
分类:LeetCode
LeetCode | Path Sum II(路径和2)
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. F…
【剑指offer】面试题11:数值的整数次方
主要考察的是代码的完整性:是否将所有情况考虑清楚,以及错误的输入情况。考察思考问题是否全面。 题目描述: 给定一个double类型的浮点数base和int类型的整数exponent。求base的exponent次方。 输…
LeetCode算法题-Valid Anagram(Java实现)
这是悦乐书的第198次更新,第205篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第61题(顺位题号是242)。给定两个字符串s和t,写一个函数来确定t是否是s的anagram。例如: 输入…
448. Find All Numbers Disappeared in an Array
题目地址:https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/description/ 大意:给定一个整数数组,其中1 ≤ a[i…
[LeetCode] Combination Sum III 组合之和之三,Combination Sum,Combination Sum II,Combinations
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 t…
991. Broken Calculator
On a broken calculator that has a number showing on its display, we can perform two operations:Double: Multipl…
LeetCode | First Missing Positive(第一个缺失的正整数)
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] …
LeetCode | Combination Sum(元素的和)
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C wher…
LeetCode | Container with most water(装最多的水)
Given n non-negative integers a1, a2, …, an, where each represents a point at c…
Numbers of palindromic subsequence
Description: Find how many palindromic subsequence (need not necessarily be distinct) can be formed in a given…
[剑指offer] 左旋转字符串
本文首发于我的个人博客:尾尾部落 题目描述 汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果。对于一个给定的字符序列S,请你把其循环左移K位后的序列输出。例如,字符序…