当前位置:网站首页>2022.6.29-----leetcode. five hundred and thirty-five
2022.6.29-----leetcode. five hundred and thirty-five
2022-06-29 18:19:00 【Lu 727】
private Map<Integer, String> dataBase = new HashMap<Integer, String>();
private int id;// Self increasing 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);
}边栏推荐
- Adobe Premiere基础-不透明度(蒙版)(十一)
- My first experience of remote office | community essay solicitation
- It's really easy to make money in foreign lead and build a website
- Record that the server has been invaded by viruses: the SSH password has been changed, the login fails, the malicious program runs full of CPU, the jar package fails to start automatically, and you ha
- 2022.6.29-----leetcode.535
- Lodash deep copy usage
- jdbc_相关代码
- mysql -connector/j驱动下载
- You can do sideline work
- Jar package background startup and log output
猜你喜欢

Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)

markdown知识轻轻来袭

Adobe Premiere foundation - opacity (matte) (11)

What technology is an applet container? Can it help Internet of things enterprises break through the red sea?

小迈科技 X Hologres:高可用的百亿级广告实时数仓建设

How to use idea?

通过 hosts文件配置本地域名

Adobe Premiere基础-时间重映射(十)

Premature end of script headers 或 End of script output before headers

Serial port experiment based on stm32f103zet6 library function
随机推荐
MySql存储过程循环的使用分析详解
Serial port experiment based on stm32f103zet6 library function
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
It's really easy to make money in foreign lead and build a website
MySQL数据库每日备份并定时清理脚本
Programmer Resource Recommendation Guide
Shell基本语法--流程控制
Jar包后台启动并输出日志
【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
Find the maximum XOR value in the sequence given a number (01 Dictionary)
How QQ opens online customer service
js两个二维数组合并并去除相同项(整理)
Goldfish rhca memoirs: do447 build advanced job workflow -- create job template survey to set work variables
Niuke Xiaobai monthly race 52 E group logarithmic sum (inclusion exclusion theorem + dichotomy)
Image migration and data migration synchronization of old and new servers with different Alibaba cloud accounts
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
【网络是怎么连接的】第三章 探索集线器,交换机和路由器
JDBC Codes connexes
JS merge two 2D arrays and remove the same items (collation)
Shell tutorial circular statements for, while, until usage