Driver program to test above function
public static void main ( String args [ ] ) { String str = " ababa " ; System . out . println ( " Count ▁ of ▁ distinct ▁ substrings ▁ is ▁ " + countDistinctSubstring ( str ) ) ; } }