We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Sherlock and Anagrams
- Discussions
Sherlock and Anagrams
Sherlock and Anagrams
Sort by
recency
|
28 Discussions
|
Please Login in order to post a comment
I thought to use a double for loop, so we start from every position, grow every size of substring until end of string, sort it, and store the substring. When we find a pair, we count up.
cdcd expected output=5. Why? substring sorted their count when more than 1: c:2 d:2 cd: 3
Java
Java