Skip to content

Instantly share code, notes, and snippets.

@lishunan246
Created March 20, 2017 13:57
Show Gist options
  • Save lishunan246/93489b0dedb88074e6aa3b5bebbb954d to your computer and use it in GitHub Desktop.
Save lishunan246/93489b0dedb88074e6aa3b5bebbb954d to your computer and use it in GitHub Desktop.
Encode and Decode TinyURL
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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment