Directly return the given String got passed and beat 90%+

  • 3

    Maybe this question should restrict more.

    // Encodes a URL to a shortened URL.
        public String encode(String longUrl) {
            return longUrl;
        // Decodes a shortened URL to its original URL.
        public String decode(String shortUrl) {
            return shortUrl;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.