Constraints are flexible. So we can do bruteforce for this problem. We can generate all the substrings with a n2 loop, where n is the size of the string.
Every-time we generate a substring we insert it into a set. Set is a data-structure where every element comes only once and they are sorted. After inserting all the substrings, only unique substrings will remain in the set. So printing the size of the set is the answer for this problem.



73% Solution Ratio
skmonirEarliest, Nov '18
Alamin_justFastest, 0.0s
Alamin_justLightest, 131 kB
touhidurrrShortest, 105B
Toph uses cookies. By continuing you agree to our Cookie Policy.