Approach 1 brute force intuition check all the substring one by one to see if it has no duplicate character algorithm suppose we have a function boolean allunique string substring which will return true if the characters in the substring are all unique otherwise false we can iterate through all the possible substrings of the given string s and call the function.