Leetcode 0032.longest-valid-parentheses(python)
32. Longest Valid Parentheses题目Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) ...
Leetcode 0031.next-permutation
31. Next Permutation题目A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3],...
Leetcode 0031.next-permutation(python)
31. Next Permutation题目A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3],...
Leetcode 0030.Substring with Concatenation of All Words(C++)
30. Substring with Concatenation of All Words题目You are given a string s and an array of strings words of the same length. Return all starting indices of subs...
Leetcode 0030.Substring with Concatenation of All Words(python)
30. Substring with Concatenation of All Words一、问题描述给定一个字符串 s 和一个字符串数组 words,找出 s 中所有恰好由 words 中所有单词串联形成的子串的起始索引。 注意:words 中的单词可以以任意顺序串联。 示例 1: 示例 2: 示例...
Leetcode 0035.search-insert-position
35. Search Insert Position题目Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index w...
Leetcode 0035.search-insert-position(python)
35. Search Insert Position题目Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index w...
Leetcode 0034.find-first-and-last-position-of-element-in-sorted-array
34. Find First and Last Position of Element in Sorted Array题目Given an array of integers nums sorted in non-decreasing order, find the starting and ending pos...
Leetcode 0034.find-first-and-last-position-of-element-in-sorted-array(python)
34. Find First and Last Position of Element in Sorted Array题目Given an array of integers nums sorted in non-decreasing order, find the starting and ending pos...
C++ Vector
一、vector 容器概述vector 是 C++ 标准模板库(STL)中 最用的序列容器之一,它基于动态数组实现,能够存储同类型元素并支持高效的随机访问。自 C++98 标准首次引入以来,vector 凭借其灵活的内存管理和优秀的性能表现,成为了 C++ 开发者处理动态数据集合的首选工具。 与静态数组相比,ve...
Leetcode 0033.search-in-rotated-sorted-array
33. Search in Rotated Sorted Array题目There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, ...
Leetcode 0033.search-in-rotated-sorted-array(python)
33. Search in Rotated Sorted Array题目There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, ...
Leetcode 0029.Divide Two Integers(C++)
29. Divide Two Integers题目Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer d...
Leetcode 0029.Divide Two Integers(python)
29. Divide Two Integers你选用何种方法解题?本题的核心是不使用乘法、除法和取模运算实现整数除法。 方法选择理由: 位运算(位移法):通过左移实现快速乘法,时间效率高 负数倍增法:使用负数处理避免溢出问题,更安全 解题过程问题分析输入:被除数 dividend,除数 divisor输...
Leetcode 0028.Implement strStr()(python)
28. Implement strStr()你选用何种方法解题?本题的核心是实现字符串匹配算法。 方法选择理由: 暴力匹配:代码简单,适合短字符串 KMP 算法:时间效率更高,适合长字符串 解题过程问题分析输入:主串 haystack,模式串 needle输出:needle 在 haystack 中第一...

