当前位置:网站首页>2022.6.29-----leetcode.535
2022.6.29-----leetcode.535
2022-06-29 17:59:00 【路Lu727】
private Map<Integer, String> dataBase = new HashMap<Integer, String>();
private int id;//自增id
public String encode(String longUrl) {
id++;
dataBase.put(id, longUrl);
return "http://tinyurl.com/" + id;
}
public String decode(String shortUrl) {
int p = shortUrl.lastIndexOf('/') + 1;
int key = Integer.parseInt(shortUrl.substring(p));
return dataBase.get(key);
}边栏推荐
- 小迈科技 X Hologres:高可用的百亿级广告实时数仓建设
- jdbc认识上手
- 【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
- jdbc_ Related codes
- [wangdingbei 2020 Qinglong formation]areuserialz
- On adding and subtracting dates
- js两个二维数组合并并去除相同项(整理)
- Adobe Premiere基础-批量素材导入序列-变速和倒放(回忆)-连续动作镜头切换-字幕要求(十三)
- YoloV6+TensorRT+ONNX:基于WIN10+TensorRT8+YoloV6+ONNX的部署
- What technology is an applet container? Can it help Internet of things enterprises break through the red sea?
猜你喜欢

自动化软件测试 - 利用短信转发器结合Selenium读取短信验证码

Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)

Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)

jdbc_相關代碼

Precondition end of script headers or end of script output before headers

国内酒店交易DDD应用与实践——理论篇

On adding and subtracting dates

My first experience of remote office | community essay solicitation

Adobe Premiere基础-常用的视频特效(裁剪,黑白,剪辑速度,镜像,镜头光晕)(十五)

What technology is an applet container? Can it help Internet of things enterprises break through the red sea?
随机推荐
Timer interrupt experiment based on stm32f103zet6 library function
金鱼哥RHCA回忆录:DO447构建高级作业工作流--创建作业模板调查以设置工作的变量
Two controller layer interface authentication methods
shell教程之循环语句for,while,until用法
记录服务器被入侵病毒:ssh密码被更改登录失败、恶意程序跑满了cpu、jar包启动失败自动kill、一直弹出You have new mail in /var/spool/mail/root
通过 hosts文件配置本地域名
3H proficient in opencv (VIII) - shape detection
源码安装MAVROS
JS merge two one-dimensional arrays and remove the same items (collation)
Top 30 open source software
字典树(随学)
MaxCompute Studio
Workflow module jar package startup error: liquibase – waiting for changelog lock
codeforces每日5题(均1700)-第二天
Abc253 D fizzbuzz sum hard (tolerance exclusion theorem)
QQ如何开通在线客服
Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)
It's really easy to make money in foreign lead and build a website
Error building SqlSession问题
Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa