Brute force solution

how to solve this question using the brute force method

@rohitkandpal683
hello Rohit,
a)
check all substring of length 1 -> if there exist any substring of length 1 with all character distinct then move to next length i.e 2 otherwise stop here
check all substring of of length 2-> if there exist any substring of length 2 with all character distinct then move to next length i.e 3 otherwise stop here
check all substring of of length 3-> if there exist any substring of length 3 with all character distinct then move to next length i.e 4 otherwise stop here
In this way u can check for all possible substring length and store maximum substring lenght which satisfies property

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.