Design TinyURL

Medium

📝 Description

Design a URL shortening service that encodes and decodes URLs

Input Format

Series of encode and decode operations

Output Format

Shortened URL and original URL

Constraints

At most 10^4 operations

🔍 Sample Input

encode("https://example.com/very/long/url")
            

✅ Sample Output

"http://tinyurl.com/abcd123"
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run