avatar
文章
823
标签
1101
分类
40
首页
主线
归档
标签
关于
家书
  • 父亲的与子书
  • 给女友的情书
LogoHespethornのBlog
搜索
首页
主线
归档
标签
关于
家书
  • 父亲的与子书
  • 给女友的情书

Leetcode-C++

Leetcode 0048. Rotate Image
发表于2023-05-04|AlgorithmsLeetcode-C++
48. Rotate ImageYou are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, wh...
Leetcode 0046. Permutations
发表于2023-05-01|AlgorithmsLeetcode-C++
46. PermutationsGiven an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Example...
Leetcode 0045. 跳跃游戏 II
发表于2023-04-26|AlgorithmsLeetcode-C++
45. 跳跃游戏 II给定一个长度为 n 的 0 索引整数数组 nums。初始位置为 nums[0]。 每个元素 nums[i] 表示从索引 i 向后跳转的最大长度。换句话说,如果你在索引 i 处,你可以跳转到任意 (i + j) 处: 0 <= j <= nums[i] 且 i + j < ...
Leetcode 0042. 接雨水
发表于2023-04-24|AlgorithmsLeetcode-C++
42. 接雨水给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。 示例 1: 示例 2: 解题思路核心思路是双指针边界,通过每个柱子能接住的雨水量取决于其左右两侧的最高柱子中较矮的那个(短板效应): 边界定义: 对于位置 i,左侧最高柱子高度为 le...
Leetcode 0040. Combination Sum II
发表于2023-04-19|AlgorithmsLeetcode-C++
40. Combination Sum IIGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the...
Leetcode 0039. Combination Sum
发表于2023-04-15|AlgorithmsLeetcode-C++
39. Combination SumGiven an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where t...
Leetcode 0035. Search Insert Position
发表于2023-04-12|AlgorithmsLeetcode-C++
35. Search Insert Position题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if i...
Leetcode 0034. Find First and Last Position of Element in Sorted Array
发表于2023-04-08|AlgorithmsLeetcode-C++
34. Find First and Last Position of Element in Sorted Array题目Given an array of integers nums sorted in ascending order, find the starting and ending position...
Leetcode 0033. Search in Rotated Sorted Array
发表于2023-04-06|AlgorithmsLeetcode-C++
33. Search in Rotated Sorted Array题目Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] mig...
Leetcode 0028. Find the Index of the First Occurrence in a String
发表于2023-04-03|AlgorithmsLeetcode-C++
28. Find the Index of the First Occurrence in a StringGiven two strings needle and haystack, return the index of the first occurrence of needle in haystack, ...
Leetcode 0027. Remove Element
发表于2023-03-29|AlgorithmsLeetcode-C++
27. Remove Element给你一个数组 nums 和一个值 val,你需要 原地 移除所有数值等于 val 的元素。元素的顺序可能发生改变。然后返回 nums 中与 val 不同的元素的数量。 假设 nums 中不等于 val 的元素数量为 k,要通过此题,您需要执行以下操作: 更改 nums 数组,...
Leetcode 0026. Remove Duplicates from Sorted Array
发表于2023-03-24|AlgorithmsLeetcode-C++
26. Remove Duplicates from Sorted Array给你一个 非严格递增排列 的数组 nums ,请你** 原地** 删除重复出现的元素,使每个元素 只出现一次 ,返回删除后数组的新长度。元素的 相对顺序 应该保持 一致 。然后返回 nums 中唯一元素的个数。 考虑 nums 的唯一元...
Leetcode 0025.reverse-nodes-in-k-group
发表于2023-03-21|AlgorithmsLeetcode-C++
25. K 个一组翻转链表给你链表的头节点 head ,每 k 个节点一组进行翻转,请你返回修改后的链表。 k 是一个正整数,它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍,那么请将最后剩余的节点保持原有顺序。 你不能只是单纯的改变节点内部的值,而是需要实际进行节点交换。 示例 1: 示例 2...
Leetcode 0024. Swap Nodes in Pairs
发表于2023-03-19|AlgorithmsLeetcode-C++
24. Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the...
Leetcode 0023.merge-k-sorted-lists
发表于2023-03-14|AlgorithmsLeetcode-C++
23. 合并 K 个升序链表给你一个链表数组,每个链表都已经按升序排列。 请你将所有链表合并到一个升序链表中,返回合并后的链表。 示例 1: 示例 2: 示例 3: 题目大意多个有序链表的合并,使用归并排序整理有序链表,更优秀的思考是采用优先级队列(小根堆)来排序。归并可以看21题。 解题思路解...
1…78910
avatar
Hespethorn
文章
823
标签
1101
分类
40
GitHub
fox
ciwei
最新文章
计算机原则五讲(一):这笔投入能换回什么2026-11-20
计算机原则五讲(三):责任放在哪一层2026-11-20
计算机原则五讲(二):故障发生时还剩什么保证2026-11-20
计算机原则五讲(五):规模一上来,系数说了算2026-11-20
计算机原则五讲(六):没有免费的优化2026-11-20
分类
  • AI-ML53
    • AI-App20
    • AI-News33
  • Algorithms219
    • DSA35
    • Leetcode-C++141
    • Leetcode-Mysql6
    • Leetcode-Python37
  • CS-Fundamentals41
    • CS501
    • CS61A20
    • CS61B20
  • CS-Principles13
  • Database20
    • Mysql5
标签
CS-Principles专栏介绍分治存储垃圾回收容错引用透明封装关注点分离逃逸分析分布式事务数据一致性安全工程算法分析网络协议操作系统软件测试语言运行时工程运维版本管理
归档
  • 2026年11月 20
  • 2026年10月 10
  • 2026年09月 53
  • 2026年08月 56
  • 2026年07月 38
  • 2026年06月 47
网站信息
文章数目 :
823
运行时间 :
本站总字数 :
1885.8k
最后更新时间 :
搜索
数据加载中