LeetCode:535. Encode and Decode TinyURL
来源:互联网 发布:windows如何禁止更新 编辑:程序博客网 时间:2024/05/21 11:57
Note: This is a companion problem to the System Design problem: Design TinyURL.
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl
and it returns a short URL such as http://tinyurl.com/4e9iAk
.
Design the encode
and decode
methods for the TinyURL service. There is no restriction on how your encode/decode algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be decoded to the original URL.
Subscribe to see which companies asked this question.
Show Similar Problems
其实我不明白这道题的出题想干什么;
AC:
class Solution {public: // Encodes a URL to a shortened URL. string encode(string longUrl) { return longUrl; } // Decodes a shortened URL to its original URL. string decode(string shortUrl) { return shortUrl; }};// Your Solution object will be instantiated and called as such:// Solution solution;// solution.decode(solution.encode(url));
0 0
- leetcode题解-535. Encode and Decode TinyURL
- 【LeetCode】535. Encode and Decode TinyURL
- LeetCode:535. Encode and Decode TinyURL
- Leetcode 535. Encode and Decode TinyURL
- leetcode 535. Encode and Decode TinyURL
- Leetcode 535. Encode and Decode TinyURL
- LeetCode 535. Encode and Decode TinyURL
- 【LeetCode】535. Encode and Decode TinyURL
- python--leetcode 535. Encode and Decode TinyURL
- leetcode 535. Encode and Decode TinyURL
- LeetCode-Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- 535. Encode and Decode TinyURL
- c++ 容器vector的基本操作
- 给出每个站点之间的最短距离,求出最短路径,用unordered_map来实现,让你实现find_cheapest_transform函数
- Glide源码分析(一)——DiskLruCache磁盘缓存的实现
- 2013第四届蓝桥杯预赛试题本科c++前缀判断
- Sql profiles-->使用sql tuning生成sql profile
- LeetCode:535. Encode and Decode TinyURL
- iptables详解
- 3-5对迭代器做切片操作
- 带头结点的双向循环链表
- STl的set容器的总结
- 深入.net第四章
- 3-6在一个for语句中迭代多个可迭代对象
- java 文件操作(二)---Files和Path
- Bootstrap 进度条