随笔分类 - LeetCode
摘要:LeetCode 1409. Queries on a Permutation With Key查询带键的排列【Medium】【Python】【模拟】 Problem "LeetCode" Given the array of positive integers between and , you
阅读全文
摘要:LeetCode 1408. String Matching in an Array数组中的字符串匹配【Easy】【Python】【字符串】 Problem "LeetCode" Given an array of string . Return all strings in which is su
阅读全文
摘要:LeetCode 面试题 01.07. 旋转矩阵【Medium】【Python】【数学】 问题 "力扣" 给你一幅由 N × N 矩阵表示的图像,其中每个像素的大小为 4 字节。请你设计一种算法,将图像旋转 90 度。 不占用额外内存空间能否做到? 示例 1: 示例 2: 思路 数学 时间复杂度:
阅读全文
摘要:LeetCode 1394. Find Lucky Integer in an Array找出数组中的幸运数【Easy】【Python】【暴力】 Problem "LeetCode" Given an array of integers , a lucky integer is an integer
阅读全文
摘要:LeetCode 1395. Count Number of Teams统计作战单位数【Medium】【Python】【暴力】 Problem "LeetCode" There are soldiers standing in a line. Each soldier is assigned a u
阅读全文
摘要:LeetCode 1396. Design Underground System设计地铁系统【Medium】【Python】【设计】 Problem "LeetCode" Implement the class that supports three methods: 1. A customer w
阅读全文
摘要:LeetCode 0892. Surface Area of 3D Shapes三维形体的表面积【Easy】【Python】【数学】 Problem "LeetCode" On a grid, we place some cubes. Each value represents a tower of
阅读全文
摘要:LeetCode 面试题17. 打印从1到最大的n位数【剑指Offer】【Easy】【Python】【遍历】 问题 "力扣" 输入数字 n,按顺序打印出从 1 到最大的 n 位十进制数。比如输入 3,则打印出 1、2、3 一直到最大的 3 位数 999。 示例 1: 说明: 用返回一个整数列表来代替
阅读全文
摘要:LeetCode 面试题09. 用两个栈实现队列【剑指Offer】【Easy】【Python】【栈】【队列】 问题 "力扣" 用两个栈实现一个队列。队列的声明如下,请实现它的两个函数 appendTail 和 deleteHead ,分别完成在队列尾部插入整数和在队列头部删除整数的功能。(若队列中没
阅读全文
摘要:LeetCode 0070. Climbing Stairs爬楼梯【Easy】【Python】【动态规划】 Problem "LeetCode" You are climbing a stair case. It takes n steps to reach to the top. Each tim
阅读全文
摘要:LeetCode 0509. Fibonacci Number斐波那契数【Easy】【Python】【动态规划】 Problem "LeetCode" The Fibonacci numbers , commonly denoted form a sequence, called the Fibon
阅读全文
摘要:LeetCode 面试题10 II. 青蛙跳台阶问题【剑指Offer】【Easy】【Python】【动态规划】 问题 "力扣" 一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。 答案需要取模 1e9+7(1000000007),如计算初始结果为:10
阅读全文
摘要:LeetCode 面试题10 I. 斐波那契数列【剑指Offer】【Easy】【Python】【动态规划】 问题 "力扣" 写一个函数,输入 n ,求斐波那契(Fibonacci)数列的第 n 项。斐波那契数列的定义如下: 斐波那契数列由 0 和 1 开始,之后的斐波那契数就是由之前的两数相加而得出
阅读全文
摘要:LeetCode 0914. X of a Kind in a Deck of Cards卡牌分组【Easy】【Python】【数学】 Problem "LeetCode" In a deck of cards, each card has an integer written on it. Ret
阅读全文
摘要:LeetCode 面试题62. 圆圈中最后剩下的数字【剑指Offer】【Easy】【Python】【数学】 问题 "力扣" 0,1,,n 1这n个数字排成一个圆圈,从数字0开始,每次从这个圆圈里删除第m个数字。求出这个圆圈里剩下的最后一个数字。 例如,0、1、2、3、4这5个数字组成一个圆圈,从数字
阅读全文
摘要:LeetCode 1390. Four Divisors四因数【Medium】【Python】【数学】 Problem "LeetCode" Given an integer array , return the sum of divisors of the integers in that arr
阅读全文
摘要:LeetCode 1389. Create Target Array in the Given Order按既定顺序创建目标数组【Easy】【Python】【数组】 Problem "LeetCode" Given two arrays of integers and . Your task is
阅读全文
摘要:LeetCode 1386. Cinema Seat Allocation安排电影院座位【Medium】【Python】【哈希表】 Problem "LeetCode" A cinema has rows of seats, numbered from 1 to and there are ten
阅读全文
摘要:LeetCode 0113. Path Sum II路径总和 II【Medium】【Python】【回溯】 Problem "LeetCode" Given a binary tree and a sum, find all root to leaf paths where each path's
阅读全文
摘要:LeetCode 面试题34. 二叉树中和为某一值的路径【剑指Offer】【Medium】【Python】【回溯】 问题 "力扣" 输入一棵二叉树和一个整数,打印出二叉树中节点值的和为输入整数的所有路径。从树的根节点开始往下一直到叶节点所经过的节点形成一条路径。 示例: 给定如下二叉树,以及目标和
阅读全文

浙公网安备 33010602011771号