<filename>medium/python/c0263_535_encode-and-decode-tinyurl/00_leetcode_0263.py<gh_stars>0
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#535. Encode and Decode TinyURL
#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.
#class Codec:
#    def encode(self, longUrl):
#        """Encodes a URL to a shortened URL.
#        :type longUrl: str
#        :rtype: str
#        """
#    def decode(self, shortUrl):
#        """Decodes a shortened URL to its original URL.
#        :type shortUrl: str
#        :rtype: str
#        """
## Your Codec object will be instantiated and called as such:
## codec = Codec()
## codec.decode(codec.encode(url))



# Time Is Money
<filename>medium/python/c0263_535_encode-and-decode-tinyurl/00_leetcode_0263.py<gh_stars>0
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#535. Encode and Decode TinyURL
#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.
#class Codec:
#    def encode(self, longUrl):
#        """Encodes a URL to a shortened URL.
#        :type longUrl: str
#        :rtype: str
#        """
#    def decode(self, shortUrl):
#        """Decodes a shortened URL to its original URL.
#        :type shortUrl: str
#        :rtype: str
#        """
## Your Codec object will be instantiated and called as such:
## codec = Codec()
## codec.decode(codec.encode(url))



# Time Is Money
# DRUNKWATER TEMPLATE(add description and prototypes) # Question Title and Description on leetcode.com # Function Declaration and Function Prototypes on leetcode.com #535. Encode and Decode TinyURL #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. #class Codec: #    def encode(self, longUrl): #        """Encodes a URL to a shortened URL. #        :type longUrl: str #        :rtype: str #        """ #    def decode(self, shortUrl): #        """Decodes a shortened URL to its original URL. #        :type shortUrl: str #        :rtype: str #        """ ## Your Codec object will be instantiated and called as such: ## codec = Codec() ## codec.decode(codec.encode(url)) # Time Is Money