class Solution { public int lengthOfLongestSubstring(String s) { if(s.length()==0) { return 0; } int max=Integer.MIN_VALUE; for(int i=0;imax) { max=req.length(); } } } } return max; } boolean checkforduplicates(String str){ String req=""; for(int i=0;i