SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 95 forks source link

Adding code for issue #388. #393

Closed venkatsgithub1 closed 2 years ago

venkatsgithub1 commented 2 years ago

Solution for Longest substring with distinct characters.

Issue Id you have worked upon -

issue #388

Briefly explain your program logic -

The solution uses sliding window mechanism to maintain a window start, window end and uses a map to see if distinct characters are being used for max length of substring.

Screenshots(Attach 2 screenshots of your own input and output) -

Attach here Input: image Output: image


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

venkatsgithub1 commented 2 years ago

@SarthakKeshari - Added solution for issue #388