当前位置:网站首页>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);
}边栏推荐
- Maximum length of palindrome substring (string hash + binary)
- Automatic software test - read SMS verification code using SMS transponder and selenium
- 3h精通OpenCV(六)-图像堆叠
- The soft youth under the blessing of devcloud makes education "smart" in the cloud
- PWM output experiment based on stm32f103zet6 library function
- kubekey2.2.1 kubernetes1.23.7离线包制作+harbor部暑并上传镜像
- Precondition end of script headers or end of script output before headers
- 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
- 【网络是怎么连接的】第三章 探索集线器,交换机和路由器
猜你喜欢

美法官裁定,被控掩盖黑客行为的Uber前安全主管必须面对欺诈指控

Servlet学生管理系统(萌新练手版)

Adobe Premiere foundation - cool text flash (14)

【目标跟踪】|stark配置 win otb

Servlet student management system (Mengxin hands-on version)

Xiaomai technology x hologres: high availability of real-time data warehouse construction of ten billion level advertising

Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)

Abc253 D fizzbuzz sum hard (tolerance exclusion theorem)

markdown知识轻轻来袭

Adobe Premiere foundation - opacity (matte) (11)
随机推荐
软件测试——基础理论知识你都不一定看得懂
jdbc_ Related codes
MySql存储过程循环的使用分析详解
How to use idea?
POJ 1975 (transitive closure)
Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)
图像特征计算与表示——基于内容的图像检索
Shell基本语法--流程控制
3H proficient in opencv (VIII) - shape detection
Adobe Premiere foundation - time remapping (10)
行程卡“摘星”热搜第一!刺激旅游产品搜索量齐上涨
jdbc_相关代码
codeforces每日5题(均1700)-第二天
Codeworks 5 questions per day (1700 for each) - the next day
Find the maximum XOR value in the sequence given a number (01 Dictionary)
Sister Juan takes you to learn database -- 5-day dash day4
MySQL -connector/j driver download
Adobe Premiere基础-声音调整(音量矫正,降噪,电话音,音高换挡器,参数均衡器)(十八)
WBF: new method of NMS post filter frame for detection task?
Sd6.23 summary of intensive training