Function to return the count of distinct state codes
static int countDistinctCode ( String str ) { HashSet < String > codes = new HashSet < String > ( ) ; for ( int i = 0 ; i < str . Length - 1 ; i ++ )