Easiest C++ Approach

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;
}

};

Comments (0)