Count of unique Substrings Count of distinct substrings Count of substrings having unique chars is different Distinct Substrings Definition: Distinct substrings are all the substrings of a string, counted without regard to whether they contain repeated characters. Two substrings are considered distinct if they differ in at least one character or their position in the string. Example: For the string "aba": Substrings: "", "a", "b", "a", "ab", "ba", "aba" Distinct Substrings: "", "a", "b", "ab", "ba", "aba" Total distinct substrings: 6 Unique Substrings Definition: Unique substrings are those that appear only once in the string. If a substring occurs multiple times, it is not counted as unique. Example: For the string "aba": Substrings: "", "a", "b", "a", "ab", "ba", "aba" Unique Substrings: "", "b", "ab", "ba", "aba" (The substring "a" is not unique because it appears twice.) Total unique substrings: 5 Summary Distinct Substrings: Count every unique instance of substrings, including those that appear multiple times. Unique Substrings: Only count substrings that appear exactly once in the original string. Exa