ICode9

精准搜索请尝试: 精确搜索
  • 「LeetCode 1397」找到所有好字符串2022-08-15 19:01:11

    传送门 Problem 给你两个长度为 \(n\) 的字符串 \(s_1\) 和 \(s_2\),以及一个长度为 \(m\) 的字符串 evil 。请你返回好字符串的数目。 好字符串的定义为:它的长度为 \(n\) 字典序大于等于 \(s_1\),字典序小于等于 \(s_2\),且不包含 evil 为子字符串。 由于答案可能很大,请

  • LeetCode/最多能完成排序的块2022-08-15 07:00:08

    1. 最多能完成排序的块I 给定一个长度为 n 的整数数组 arr ,它表示在 [0, n - 1] 范围内的整数的排列。 我们将 arr 分割成若干 块 (即分区),并对每个块单独排序。将它们连接起来后,使得连接的结果和按升序排序后的原数组相同。 返回数组能分成的最多块数量。 //从左往右遍历、融合不

  • LeetCode 旋转字符串算法题解 All In One2022-08-14 01:02:54

    LeetCode 旋转字符串算法题解 All In One js / ts 实现旋转字符串 旋转原理 图解 // 2 倍 s, 一定包含所有(字符移动)旋转操作之后的组合 ✅ // 如, `abc` => `abcabc` (abc, bca, cab) 796. Rotate String "use strict"; /** * * @author xgqfrms * @license MIT * @cop

  • LeetCode Pow(x, n)算法题解 All In One2022-08-14 01:01:08

    LeetCode Pow(x, n)算法题解 All In One js / ts 实现 Pow(x, n) 50. Pow(x, n) https://leetcode.cn/problems/powx-n/ https://www.youtube.com/watch?v=ZTACajQOb2E refs ©xgqfrms 2012-2020 www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问! 原创文

  • leetcode 72 动规经典题《编辑距离》问题的理解2022-08-13 01:00:53

    编辑距离 题目链接 https://leetcode.cn/problems/edit-distance/comments/ 题目内容 给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数  。 你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个字符 示例 1: 输入:wor

  • 如何使用 LeetCode 创建面试评测题库 All In One2022-08-13 00:31:30

    如何使用 LeetCode 创建面试评测题库 All In One LeetCode & Typescript 难度最高的 10 题 测评 https://e.leetcode-cn.com/assessment/erqmxxynsgzd-0001 LeetCode 4. Median of Two Sorted Arrays / LeetCode 4. 寻找两个正序数组的中位数 Hard / 难度系数 ⭐️⭐️⭐️⭐️ /** *

  • leetcode-数组-1512022-08-12 16:33:28

    /** * <p>给你一个字符串 <code>s</code> ,颠倒字符串中 <strong>单词</strong> 的顺序。</p> * * <p><strong>单词</strong> 是由非空格字符组成的字符串。<code>s</code> 中使用至少一个空格将字符串中的 <strong>单词</strong> 分隔开。</p>

  • 125. 验证回文串--LeetCode2022-08-12 08:31:17

    来源:力扣(LeetCode) 链接:https://leetcode.cn/problems/valid-palindrome 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 朴素做法 对原串做一些处理(过滤不需要的字符,统一字符大小写) 从尾到头遍历一次串,再与处理后的原串比较,如果一样就是回文串 否则就

  • LeetCode 旋转数组算法题解 All In One2022-08-12 05:00:35

    LeetCode 旋转数组算法题解 All In One 189. Rotate Array /** Do not return anything, modify nums in-place instead. */ // solution 1:暴力破解:❌ Time Limit Exceeded // function rotate(nums: number[], k: number): void { // if(k === 0) { // // return; //

  • LeetCode/用户分组2022-08-12 01:03:26

    有 n 个人被分成数量未知的组。每个人都被标记为一个从 0 到 n - 1 的唯一ID 。 给定一个整数数组 groupSizes ,其中 groupSizes[i] 是第 i 个人所在的组的大小 例如,如果 groupSizes[1] = 3 ,则第 1 个人必须位于大小为 3 的组中 每个人应该恰好只出现在一个组中,并且每个人必

  • LeetCode 5 Longest Palindromic Substring2022-08-11 03:00:48

    Given a string s, return the longest palindromic substring in s. Solution 求在 \(s\) 中的最长回文字串。对于每一个位置,进行左右拓展,计算出长度并更新答案即可。 \(Notes:\) 对于奇数或者偶数长度的字串,为了统一: 奇数: \(check(s,i,i)\) 偶数:\(check(s,i,i+1)\) 点击查看

  • leetcode 螺旋矩阵算法题 All In One2022-08-11 00:02:21

    leetcode 螺旋矩阵算法题解 All In One js / ts 实现螺旋矩阵 LeetCode 54. Spiral Matrix "use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @created 2022-06-08 * @modified * * @description 54. 螺旋矩阵 * @description 54. Spi

  • LeetCode 39 Combination Sum 回溯2022-08-08 19:04:23

    Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from can

  • leetcode 155. Min Stack最小栈(中等)2022-08-08 13:02:29

    一、题目大意 标签: 栈和队列 https://leetcode.cn/problems/min-stack 设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 实现 MinStack 类: MinStack() // 初始化堆栈对象。 void push(int val) // 将元素val推入堆栈。 void pop() // 删除堆栈顶部的元素。

  • leetcode-贪心-1342022-08-08 10:33:46

    /** * <p>在一条环路上有 <code>n</code>&nbsp;个加油站,其中第 <code>i</code>&nbsp;个加油站有汽油&nbsp;<code>gas[i]</code><em>&nbsp;</em>升。</p> * * <p>你有一辆油箱容量无限的的汽车,从第<em> </em><

  • LeetCode刷题19-执行时长2022-08-08 00:31:25

        1 package exam; 2 3 import java.util.Scanner; 4 5 /** 6 * 功能描述 7 * 8 * @author ASUS 9 * @version 1.0 10 * @Date 2022/8/7 11 */ 12 public class Main01 { 13 public static void main(String[] args) { 14 Scanner scanner = n

  • 744. 寻找比目标字母大的最小字母--LeetCode2022-08-07 20:31:40

    744. 寻找比目标字母大的最小字母 来源:力扣(LeetCode) 链接:https://leetcode.cn/problems/find-smallest-letter-greater-than-target 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 可以用二分来找到一个letters[x],letters[x]满足<=target , 这时只需要判断

  • LeetCode 895. Maximum Frequency Stack2022-08-07 14:03:23

    原题链接在这里:https://leetcode.com/problems/maximum-frequency-stack/ 题目: Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack. Implement the FreqStack class: FreqStack() constructs an empty fre

  • LeetCode刷题17-转骰子2022-08-07 13:32:52

    1 package com.example.demo.leetcode.case202208; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 import java.util.Scanner; 6 import java.util.stream.Collectors; 7 8 /** 9 * 功能描述 10 * 11 * @author ASUS 12 * @version 1.

  • [LeetCode] 636. Exclusive Time of Functions2022-08-07 09:33:14

    On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1. Function calls are stored in a call stack: when a function call starts, its ID is pushed onto the stack, and when a function call

  • LeetCode 90 Subsets II 回溯2022-08-07 05:00:09

    Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Solution 如何处理相同的子集:先把 \(vector\) \(sort\) 一下,然后在 \(ans\)

  • LeetCode刷题15-内存资源分配2022-08-07 03:01:58

    package com.example.demo.leetcode.case202208; import java.util.*; import java.util.stream.Collectors; /** * 功能描述 * * @author ASUS * @version 1.0 * @Date 2022/8/7 */ public class Main2022080701 { /* 有一个简易内存池,内存按照大小粒度分类,每

  • LeetCode刷题11-数组去重和排序2022-08-06 18:29:21

    package com.example.demo.leetcode.case202208; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; import java.util.stream.Collectors; /** * 功能描述 * * @author ASUS * @version 1.0 * @Date 2022/8/6 */ public class Main2022

  • LeetCode刷题10-寻找身高相近的小朋友2022-08-06 18:09:13

    package com.example.demo.leetcode.case202208; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; /** * 功能描述 * * @author ASUS * @version 1.0 * @Date 2022/8/6 *

  • LeetCode刷题9-两数之和绝对值最小2022-08-06 16:30:14

    package com.example.demo.leetcode.case202208; import java.util.*; import java.util.stream.Collectors; /** * 功能描述 * * @author ASUS * @version 1.0 * @Date 2022/8/6 */ public class Main2022080603 { /* 标题: 两数之和绝对值最小

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有