NenadPantelic / cave-for-devs

Collection of the useful resources, tutorials and exercises for cs students and fresh graduates, but also for all the professionals who want to work on some challenges and find some stuff for maintaining brain and fingers active.
MIT License
0 stars 1 forks source link

CE-LC#3: Longest Substring without Repeating Characters #5

Open NenadPantelic opened 3 years ago

NenadPantelic commented 3 years ago

Add a solution for the LeetCode problem #3: Longest Substring without Repeating Characters. Link: https://leetcode.com/problems/longest-substring-without-repeating-characters/ Languages to pick:

Note: put the file in the appropriate folder (based on the language). It is totally good to add another version of the solution with a different approach. In that case, use the same file (just add version no), e.g.

class Solution:
    # v1
    def lengthOfLongestSubstring(self, s: str) -> int:

    # v2
    def lengthOfLongestSubstring(self, s: str) -> int:

Different solutions should be conceptually different, e.g iterative and recursive, different algorithms or different ideas in order to satisfy code review. Tests can be added in the file itself. If you wrote a comment in the editorial on Leetcode about your solution, please add the link below version no in the comment.