LeetCode算法题-Word Pattern(Java实现)

MMCV 2.x 与 MMSegmentation 1.2.2 版本升级:12个API迁移与3类报错解决方案 本文详细介绍了MMCV 2.x与MMSegmentation 1.2.2版本升级的实战指南,涵盖12个关键API迁移和3类常见报错的解决方案。通过环境准备、版本兼容性检查、API变更对照表及报错处理,帮助开发者顺利完成版本升级,提升计算机视觉项目的开发效率。 阅读详情

这是悦乐书的第202次更新,第212篇原创

01 看题和准备

今天介绍的是LeetCode算法题中Easy级别的第68题(顺位题号是290)。给定一个模式和一个字符串str,找到str是否完全匹配该模式。完全匹配是指在模式中的字母和str中的非空单词之间存在一一对应的关系。例如:

输入:pattern =“abba”,str =“dog cat cat dog”
输出:true

输入:pattern =“abba”,str =“dog cat cat fish”
输出:false

输入:pattern =“aaaa”,str =“dog cat cat dog”
输出:false

输入:pattern =“abba”,str =“dog dog dog dog”
输出:false

注意:您可以假设pattern仅包含小写字母,str包含由单个空格分隔的小写字母。

本次解题使用的开发工具是eclipse,jdk使用的版本是1.8,环境是win7 64位系统,使用Java语言编写和测试。

02 解题

特殊情况:如果pattern或者str为空,返回他们两个是否相等的判断。

正常情况:先将str按照空格切分成数组,然后先判断数组大小和pattern的长度,如果不相等直接返回false。使用HashMap,key存入pattern的单个字符,value存入数组的每一个元素。使用for循环,依次获取pattern的字符,如果map中含有当前字符为key的键值对,那么我们需要判断此字符对应的value是否等于当前指针对应的数组元素,如果不相等就直接返回false。 反之,我们就可以把当前字符和当前数组元素存入map。

但是在存入之前,还需要再判断一次。如果当前字符和上一个字符不相等,并且当前数组元素和前一个元素相等,那么直接返回false,前提就是指针大于等于1,因为map中存入的第一对键值对是肯定能够匹配的。

public boolean wordPattern(String pattern, String str) {
    if ("" == pattern || "" == str) {
        return pattern == str;
    }
    String[] arr = str.split(" ");
    if (arr.length != pattern.length()) {
        return false;
    }
    HashMap<Character, String> map = new HashMap<Character,String>();
    for (int i=0; i<pattern.length(); i++) {
        char ch = pattern.charAt(i);
        if (map.containsKey(ch)) {
            if (!map.get(ch).equals(arr[i])) {
                return false;
            }
        } else {
            if (i>=1 && pattern.charAt(i) != pattern.charAt(i-1) && arr[i].equals(arr[i-1])) {
                return false;
            } 
            map.put(ch, arr[i]);
        }
    }
    return true;
}

此解法因为用到了containsKey()方法,所以时间复杂度最好的情况是O(n),最坏的情况是O(n^2),空间复杂度是O(n)。

03 小结

算法专题目前已连续日更超过一个月,算法题文章68+篇,公众号对话框回复【数据结构与算法】、【算法】、【数据结构】中的任一关键词,获取系列文章合集。

以上就是全部内容,如果大家有什么好的解法思路、建议或者其他问题,可以下方留言交流,点赞、留言、转发就是对我最大的回报和支持!

超临界二氧化碳再热再压缩布雷顿循环建模与先进控制 超临界二氧化碳布雷顿循环建模与先进控制研究 本文研究了超临界二氧化碳再热再压缩布雷顿循环系统的建模与控制。通过MATLAB/Simscape构建了包含压缩机、透平、回热器等关键组件的动态模型,并设计了基于模型预测控制(MPC)和自抗扰控制(ADRC)的多层控制策略。系统采用转速控制的压缩机、阀门开度控制的透平,以及可变热源加热器,实现了全动态分析。研究结果表明,MPC与ADRC混合控制方案相较于传统PID控制,功率超调降低至0.9%,效率波动控制在±0.08%,扰动恢复时间缩短至12秒。 阅读详情

相关推荐

保姆级避坑指南:在Ubuntu 22.04上成功复现VMamba模型(附完整环境依赖清单)

本文提供了在Ubuntu 22.04上复现VMamba模型的详细指南,包括环境准备、CUDA与PyTorch的精确匹配、依赖安装的疑难杂症解决以及完整环境清单。特别针对Linux系统下的环境复现问题,提供了实用的避坑技巧和验证方法,帮助开发者高效完成VMamba模型的部署。

weixin_29083373的博客 265

word pattern java_LeetCode算法题-Word Pattern(Java实现)

这是悦乐书的第202次更新,第212篇原创01 看题和准备今天介绍的是LeetCode算法题中Easy级别的第68题(顺位题号是290)。给定一个模式和一个字符串str,找到str是否完全匹配该模式。完全匹配是指在模式中的字母和str中的非空单词之间存在一一对应的关系。例如:输入:pattern =“abba”,str =“dog cat cat dog”输出:true输入:pattern =“a...

weixin_35959379的博客 187

FMC/FSMC/EXMC总线NORFlash/PSRAM接口(异步-复用-不突发/同步-复用-突发)

目录 1 简介 1.1 框图 1.2 接口定义 1.3 读写时序图、时序配置参数 1.4 PSRAM控制器异步工作模式分类 1.5 PSRAM寄存器配置 1.5.1 控制寄存器BCR 1.5.2 片选时序寄存器BTR 1.5.3 写入时序寄存器BWTR 2 FPGA接口设计 2.1 实际配置的时序 2.2 接口信号处理 3 参考文献 1 简介 使...

leixj的博客 2万+

(java)Word Pattern

Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.

martinmateng的博客 343

遥感目标检测数据集汇总

文章目录1. 光学数据集1.1 DIOR1.2 LEVIR1.3 DOTA1.4 RSOD1.5 NWPU VHR-101.6 VEDAI1.7 COWC1.8 ITCVD1.9 DIUx xView 20181.10 HRSC20161.11 TAS1.12 SZTAKI‐INRIA1.13 UCAS AOD1.14 DLR 3K Vehicle2. SAR2.1 SSDD2.2 SSDD+2....

quanwei的博客 6万+

mot_challenge官方评估代码

mot_challenge官方代码使用介绍 评估mot17验证集:每个视频序列的后一半帧作为验证集 下载源码:git clone https://hub.fastgit.org/JonathonLuiten/TrackEval.git 官网上下载data样例,放在TrackEval/下,结构如下: data |-- gt | |-- bdd100k | |-- davis | |-- kitti | |-- mot_challenge | | |-- MOT15-train |

qq_37866436的博客 4896

LeetCode第290题——单词规律,给定一种规律 pattern 和一个字符串 s ,判断 s 是否遵循相同的规律。不使用HashMap,使用转换拆分遍历实现。

力扣第290题单词规律,不使用哈希表的实现方式。

回水的博客 421

华为OD机试真题 新系统 2026-05-13 Python&JS语言 实现【查找能被整除的最大整数】

给定一个字符串和一个正整数,字符串由大小写字母和数字组成,要求从字符串中找出最大且能被给定正整数整除的数。

MISAYAONE的博客 229

290. 单词规律(Java)

290. 单词规律 给定一种规律 pattern 和一个字符串 str ,判断 str 是否遵循相同的规律。 这里的 遵循 指完全匹配,例如, pattern 里的每个字母和字符串 str 中的每个非空单词之间存在着双向连接的对应规律。 示例1: 输入: pattern = “abba”, str = “dog cat cat dog” 输出: true 示例 2: 输入:pattern = “abba”, str = “dog cat cat fish” 输出: false 示例 3: 输入: patte

weixin_43786147的博客 357

【模型实战】MiMo-VL-7B讲解与实战

维度成绩MMMU70.6(图像理解最难测试之一)VideoMME70.8(视频理解标杆)59.4(超越78B参数模型)56.1(超过专用GUI模型)Elo评分开源VLM排名第一(7B~72B)社区热度过去一个月下载超1,600次(RL+SFT)📌一句话概括MiMo-VL 是目前性能最强、推理最稳、体验最佳、生态最全的7B级开源视觉语言模型。

m0_47867638的博客 1202

基于Django+Vue3的目标检测系统设计与实现,Web前后端分离,Vue3前台系统+Django后台管理系统开发,YOLOv11 Web目标检测,实现图片、视频和摄像头检测等功能,全网独发

基于Django+Vue3的智能目标检测系统设计与实现,Web前后端分离,YOLOv11 Web目标检测,Vue3前台系统+Django后台管理系统开发,实现图片检测、视频检测、摄像头检测、登录、注册和个人中心功能

在职AI算法工程师,擅长计算机视觉,YOLO目标检测、分割等,擅长web、pyqt界面可视化,好内容持续更新中,来这里跟大家一起学习,共同进步 3671

LeetCode Word Pattern II

原题链接在这里:https://leetcode.com/problems/word-pattern-ii/ 题目: Given apatternand a stringstr, find ifstrfollows the same pattern. Herefollowmeans a full match, such that there is a bijection bet...

weixin_30553065的博客 60

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

word pattern java_[Leetcode] Word Pattern 单词模式

Word PatternGiven a pattern and a string str, find if str follows the same pattern.Examples:pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog cat cat fish" shou...

weixin_35529551的博客 152

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Leetcode【290】Word Pattern(Java版)

1、这道题最直白的思路是Map,生成键值对 2、这里的Objects.equals很好理解,判断想不想等,特别注意的是,被比较的两个值都可以是null 3、重点是为啥两个Map.put()操作可以被比较??? 因为Map.put()操作也是由返回值的 如果没有键映射,则返回NULL。 该函数返回与指定键关联的旧值。 这个操作不管啥条件都会覆盖旧的。 第三条不用看 如果新加入的,则返回nul...

ssjdoudou的博客 6973

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

LeetCode-Word-Pattern

title: LeetCode-Word-Pattern date: 2019-01-31 12:23:25 tags: LeetCode categories: LeetCode 290. Word Pattern Difficulty: Easy Given a pattern and a string str, find if str follows the same pattern. H...

Yoke 240

关于LeetCode中Word Pattern一题的理解

题目如下: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s

zsy112371的专栏 431

[leetcode-290]Word Pattern(java)

问题描述:https://leetcode.com/problems/word-pattern/分析:这道题比较简单,维护一个hash表,key为pattern中的字符,value为被切割的字符串。代码如下:3mspublic class Solution { public boolean wordPattern(String pattern, String str) { c

中华胡杨的专栏 2228

word pattern java_Java [Leetcode 290]Word Pattern

题目描述:Given apatternand a stringstr, find ifstrfollows the same pattern.Herefollowmeans a full match, such that there is a bijection between a letter inpatternand anon-emptyword instr.Examp...

weixin_36306387的博客 136

Java [Leetcode 290]Word Pattern

题目描述: Given apatternand a stringstr, find ifstrfollows the same pattern. Herefollowmeans a full match, such that there is a bijection between a letter inpatternand anon-emptyword in...

dkk37351的博客 125

【Lintcode】829. Word Pattern II

题目地址: https://leetcode.com/problems/word-pattern-ii/ 给定两个字符串ppp和sss,问sss是否遵循ppp形成的模式。这里遵循ppp形成的模式的意思是,设ppp中的字母组成的集合为TTT,存在一个从TTT到sss的所有子串的一个子集SSS的双射,使得将ppp中每个字母展开成那个子串时,得到的字符串就是sss。 思路是DFS。事实上这题就是隐式图搜索。对ppp的每个字母,枚举其对应的子串。同时用一个HashMap对字母到子串进行映射,用一个HashSet存被

数学、算法爱好者的博客 667

LeetCode 290. Word Pattern

欢迎访问原文所在博客:https://52heartz.top/articles/leetcode-290-word-pattern/ 解答1[Java]: class Solution { public boolean wordPattern(String pattern, String str) { String[] words = str.split(" "); ...

user2639的博客 180

给定一种规律 pattern 和一个字符串 str ,判断 str 是否遵循相同的规律。

mark一下学习笔记 public static void main(String args[]) { String pattern = "bbba"; String str = "dog cat cat fish"; boolean max = wordPattern(pattern, str); System.out.println(max); } /**...

ccmedu的博客 3445

[LeetCode 290] Word Pattern

Given a pattern and a string str, find if str follows the same pattern. Examples: pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog cat cat fish" should r

coder 进阶的专栏 4140

LeetCode 290. Word Pattern 单词模式(Java)

题目: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Exa...

qq_41878358的博客 250

LeetCode Word Pattern

原题链接在这里:https://leetcode.com/problems/word-pattern/ 题目: Given apatternand a stringstr, find ifstrfollows the same pattern. Herefollowmeans a full match, such that there is a bijection betwee...

weixin_30593261的博客 82

leetcode Word Pattern题解

题目描述: Given apatternand a stringstr, find ifstrfollows the same pattern. Herefollowmeans a full match, such that there is a bijection between a letter inpatternand anon-emptyword instr. ...

leo_weile的博客 475
上一篇: LeetCode算法题-Move Zeroes(Java实现-三种解法)
下一篇: LeetCode算法题-Nim Game(Java实现)
程序员小川
博客等级 码龄10年 47粉丝 305原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值