Created
March 20, 2017 13:57
-
-
Save lishunan246/93489b0dedb88074e6aa3b5bebbb954d to your computer and use it in GitHub Desktop.
Encode and Decode TinyURL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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