LeetCode刷题笔录Wildcard Matching

中国高精度年度平均气温栅格数据集(1901-2024) 本文基于中国月度平均气温栅格数据集,计算生成1901-2024年1km分辨率的年度平均气温数据集,并按中国省市行政区划进行裁剪。该数据集融合CRU全球数据和WorldClim高分辨率数据,经496个站点验证,具有高时空精度和长时间序列特点,覆盖全国(含港澳台)逾百年气温记录,为气候变化研究、生态水文分析及农业生产评估等提供重要数据支撑。数据格式为Tif,单位为0.1℃,可获取全国、各省及各市三个尺度的气温栅格数据。 阅读详情

Implement wildcard pattern matching with support for '?' and '*'.

'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).

The matching should cover the entire input string (not partial).

The function prototype should be:
bool isMatch(const char *s, const char *p)

Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa", "*") → true
isMatch("aa", "a*") → true
isMatch("ab", "?*") → true
isMatch("aab", "c*a*b") → false
递归,分为p[j] ='*'和!='*'两种情况。

1.p[j] != '*'

如果s[i] == p[j](包括p[j]是?的情况),则递归下一层i+1和j+1

如果不相等则返回false

2.p[j] == '*'

则对于从i开始一直到s结尾的s的每一个substring都要进行匹配

public class Solution {
    public boolean isMatch(String s, String p) {
        return isMatch(s, p, 0, 0);
    }
    
    public boolean isMatch(String s, String p, int i, int j){
        if(j == p.length()){
            return i == s.length();
        }
        
        if(p.charAt(j) != '*'){
            if(i >= s.length() || (p.charAt(j) != s.charAt(i) && p.charAt(j) != '?'))
                return false;
            else
                return isMatch(s, p, i + 1, j + 1);
        }
        
        else{
            while(i < s.length()){
                if(isMatch(s, p, i, j + 1))
                    return true;
                i++;
            }
        }
        
        return isMatch(s, p, i, j + 1);
    }
    
    
}




故障诊断知识库建设指南 从数据融合到知识图谱构建,从智能推理引擎开发到动态进化机制落地,故障诊断知识库的建设路径已形成 “数据 - 知识 - 智能” 的闭环体系。随着大模型技术的深度融入,知识库将实现从 “规则驱动” 到 “认知推理” 的跨越 —— 通过自然语言理解解析复杂故障描述、多模态分析融合图像与信号数据、预测性算法推演故障发展趋势,持续提升诊断的精准度与前瞻性。 阅读详情

相关推荐

语音测试(二)音频标注(praat)

通过点击红线下方的圆点进行区域划分,在区域中标注所属的类别。按住Alt+Backspace 键取消蓝色线条。

beishida123的博客 3733

LeetCode刷题笔录Add Binary

Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 具体一位一位地加就行了,考虑进位的问题。还有最后记得把生成的string反过来再返回,因为我们是从最低位开始加的。 public class Solu

likecool21的专栏 1127

生成式引擎优化(GEO)- 搜索引擎优化

生成式引擎优化(GEO)是针对AI内容生成平台(如ChatGPT)的新型优化策略,旨在提升品牌内容在AI生成答案中的引用率,与传统SEO存在显著差异。GEO通过优化内容权威性、结构化和语义关联,适应AI的RAG技术架构,采用3C原则(可爬性、网络共识、反馈校正)提升内容可见性。其核心区别在于目标(引用率vs排名)、技术(语义优化vs关键词)及算法透明度(封闭vs开放)。适用场景包括商业决策、行业权威建设及公共知识服务,帮助品牌在AI时代占据信息主导权。

解锁AI流量新红利!🚀 GEO优化(生成引擎优化)助您掌控AI搜索,让AI成为您的品牌最佳代言人! 1399

LeetCode刷题笔录Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. bu

likecool21的专栏 964

解决国内网页无法加载reCaptcha的方法

科普: reCaptcha是Google公司的验证码服务,方便快捷,改变了传统验证码需要输入n位失真字符的特点。reCaptcha在使用的时候是这样的: 只需要点一下复选框,Google会收集一些鼠标轨迹、网络信息、浏览器信息等等,依靠后端的神经网络判断是机器还是人,绝大多数验证会一键通过,无需像传统验证码一样。但是reCaptcha使用了google.com的域名,这个域名在国内是被墙的。所以,也就导致了官网上无法注册/登录的问题,挡住了不少人入正的脚步。 解决办法: 【第一步】安装fir

调皮李小怪博客 25万+

LeGo-LOAM源码篇:源码分析(3)

mapOptmization.cpp,主要内容包括回环检测、scan-to-map位姿优化、因子图。

slamml 1382

LeetCode刷题笔录Reverse Words in a String

https://oj.leetcode.com/problems/reverse-words-in-a-string/ 我的做法是从后往前扫描,遇到空格就

likecool21的专栏 844

MLX90640 热成像 STM32

MLX90640 热成像

zhaocundang's blog 5004

LeetCode刷题笔录String to Integer (atoi)

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

likecool21的专栏 803

【2026最新版】PCL点云处理算法汇总(C++长期更新版)

PCL学习目录。博客长期更新,最近一次更新时间为:2026年10月4日。

点云侠的博客 63万+

【SOUND】Linux音频子系统ASoC的驱动框架总分析

ALSA系统在芯片(ASoC)层的总体项目目标是为嵌入式芯片处理器(例如PXA2XX,AU1X00,IMX等)和便携式音频编解码器提供更好的ALSA支持。 在进入ASoC子系统之前,内核对SoC音频有一些支持,但是它有一些局限性:ASoC层旨在解决这些问题并提供以下内容特征 :为了实现这一切,ASoC基本上将嵌入式音频系统分为多个可重复使用的组件驱动程序:另外,这里提下OSS(Open Sound System)这个基本被弃用的音频框架。 可以参考Linux OSS架构声卡驱动框架 2.3 ASoC重要

wang 恒 的博客 1780

LeetCode刷题笔录Longest Valid Parentheses

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()",

likecool21的专栏 789

《Java开发及前端最全面试题-Offer直通车》目录

Java开发是需求最广,工资高的细分领域,同时也是会的人最多,有的公司招1个Java开发,要面试几十甚至上百面试者,同时要求很高,要求通晓技术栈很多及很深深度。如果你正准备面试,想要脱颖而出,那么《Java开发及前端最全面试题-Offer直通车》是你的不二选择。本书汇集了多篇超过1万字的精华内容,无论是Java基础、数据库、SpringBoot和SpringCloud等必问的,还是前端、k8s等容器和虚拟化和大数据各类技术面试,本书都为你提供了最全面的试题和参考答案。

大模型大数据攻城狮的专栏 1178

LeetCode刷题笔录Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac", return true. When s3 = "aadbbbaccc", return

likecool21的专栏 739

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

LeetCode刷题笔录Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all va

likecool21的专栏 714

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

LeetCode刷题笔录Simplify Path

Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" click to show corner cases. Corner Cases: Did

likecool21的专栏 691

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

LeetCode刷题笔录Count and Say

The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as 

likecool21的专栏 661

LeetCode刷题笔录Roman to Integer

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 和Integer to Roman那题一样挺无聊的。

likecool21的专栏 649

LeetCode刷题笔录Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is

likecool21的专栏 623

LeetCode刷题笔录Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from the original string by deleting some (can be non

likecool21的专栏 584

求集合的交集/差集

先利用外部排序使两个磁盘文件有序,然后顺序读取两个文件,使用双指针求交集。在进阶 1 中,我们是通过双指针去做的,最坏情况下我们需要完整遍历。时,O(n log m) 可能明显优于 O(n + m)。的,这就使得我们可以通过从 1~1000 遍历来确定交集。,它们已经按非降序排序,请你返回两个数组的。和上一题的区别在于,这里需要找到重复的元素。返回一个数组,数组中的每个元素在。的每个字符串中都出现的共用字符(**注意:**列表中的整数可以按。较小,可以完整加载到内存,而。正整数组成的一个非空数组,按。

jyyyyx的算法之旅 111

LeetCode Hot 100 二叉树专题(二)3 题(Java)

本篇文章共 3 题:543. 二叉树的直径、102. 二叉树的层序遍历、108. 将有序数组转换为二叉搜索树。 每道题都统一按「① 题目分析 & 解题思路 → ② 常见解法(附代码)及讲解 → ③ 知识点总结」的顺序组织;代码使用 Java 编写,节点定义沿用 LeetCode 默认的 TreeNode。

2401_88612756的博客 352

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等)

LeetCode 面试经典 150_多维动态规划_交错字符串(97_C++_中等) 题目描述: 给定三个字符串 s1、s2、s3,请你帮忙验证 s3 是否是由 s1 和 s2 交错 组成的。 两个字符串 s 和 t 交错 的定义与过程如下,其中每个字符串都会被分割成若干 非空 子字符串: - s = s1 + s2 + ... + sn - t = t1 + t2 + ... + tm - |n - m| <= 1 - 交错 是 s1 + t

huayimenghan的博客 201

LeetCode 每日一题 2026/11/2-2026/11/8

记录了初步解题思路 以及本地实现代码;并不一定为最优 也希望大家能一起探讨 一起进步

AlphaTao的博客 175

leetcode 3736. 最小操作次数使数组元素相等 III 简单

中的所有元素都等于 3。中的所有元素都等于 5。在一步操作中,你可以将任意单个元素。返回使数组中的所有元素都。

2401_88085478的博客 201

LeetCode 1861. 旋转盒子|Go 双指针解法

j >= 0,如果写成j>0,会漏掉第 0 列,最左侧石头处理失败旋转矩阵行列互换:原 m 行 n 列 → 结果 n 行 m 列,make 数组长度不要写反旋转公式m-1-i:是原总行数 m,不是 n!很容易写成n-1-i区分:本题和轮转数组(189)分组循环不一样!189:所有元素固定移动 k 步,需要 gcd 分组1861:障碍物分割成多个独立段,石头向段末尾挤,用双指针更合适。

2503_92676540的博客 175
上一篇: LeetCode刷题笔录Max Points on a Line
下一篇: LeetCode刷题笔录Longest Valid Parentheses
likecool21
博客等级 码龄14年 14粉丝 123原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值