codeparrot/xlcost-text-to-code huggingface dataset:
Maximum Consecutive Zeroes in Concatenated Binary String | Java program to find maximum number of consecutive zeroes after concatenating a binary string ; returns the maximum size of a substring consisting only of zeroes after k concatenation ; stores the maximum length of the required substring ; if the current character is 0 ; stores maximum length of current substrings with zeroes ; if the whole string is filled with zero ; computes the length of the maximal prefix which contains only zeroes ; computes the length of the maximal suffix which contains only zeroes ; if more than 1 concatenations are to be made ; Driver code
class GFG { static int max_length_substring ( String st , int n , int k ) { int max_len = 0 ; int len = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( st . charAt ( i ) == '0' ) len ++ ; else len = 0 ; max_len = Math . max ( max_len , len ) ; } if ( max_len == n ) return n * k ; int pref = 0 , suff = 0 ; for ( int i = 0 ; st . charAt ( i ) == '0' ; ++ i , ++ pref ) ; for ( int i = n - 1 ; st . charAt ( i ) == '0' ; -- i , ++ suff ) ; if ( k > 1 ) max_len = Math . max ( max_len , pref + suff ) ; return max_len ; } public static void main ( String [ ] args ) { int n = 6 ; int k = 3 ; String st = "110010" ; int ans = max_length_substring ( st , n , k ) ; System . out . println ( ans ) ; } }
Sub | Java implementation of the approach ; Function that checks if the String contain exactly K characters having ASCII value greater than p ; if ASCII value is greater than ' p ' ; if count of satisfying characters is equal to ' K ' then return true ; otherwise return false ; function to count sub - Strings ; length of the String ; count of sub - Strings ; ' i ' is the starting index for the sub - String ; ' j ' is the no . of characters to include in the sub - String ; check if the sub - String satisfies the condition ; Driver code
class GFG { boolean isValidSubString ( String r , int K , int p ) { int c = 0 ; for ( int i = 0 ; i < r . length ( ) ; i ++ ) { if ( ( int ) r . charAt ( i ) > p ) { c ++ ; } } if ( c == K ) { return true ; } else { return false ; } } void countSubStrings ( String s , int K , int p ) { int l = s . length ( ) ; int count = 0 ; for ( int i = 0 ; i < l ; i ++ ) { for ( int j = K ; ( i + j ) <= l ; j ++ ) { String r = s . substring ( i , ( i + j ) ) ; if ( isValidSubString ( r , K , p ) ) { count ++ ; } } } System . out . println ( count ) ; } public static void main ( String args [ ] ) { GFG g = new GFG ( ) ; String s = " abepztydba " ; int K = 4 ; int p = 110 ; g . countSubStrings ( s , K , p ) ; } }
Count number of substrings with numeric value greater than X | Java implementation of the approach ; Function that counts valid sub - strings ; Only take those numbers that do not start with '0' . ; converting the sub - string starting from index ' i ' and having length ' len ' to int and checking if it is greater than X or not ; Driver code
import java . util . * ; class GFG { static int count ( String S , int X ) { int count = 0 ; int N = S . length ( ) ; for ( int i = 0 ; i < N ; ++ i ) { if ( S . charAt ( i ) != '0' ) { for ( int len = 1 ; ( i + len ) <= N ; ++ len ) { int num = Integer . parseInt ( S . substring ( i , i + len ) ) ; if ( num > X ) count ++ ; } } } return count ; } public static void main ( String [ ] args ) { String S = "2222" ; int X = 97 ; System . out . println ( count ( S , X ) ) ; } }
Check whether a binary string can be formed by concatenating given N numbers sequentially | Java implementation of the approach ; Function that returns false if the number passed as argument contains digit ( s ) other than '0' or '1' ; Function that checks whether the binary String can be formed or not ; Empty String for storing the binary number ; check if a [ i ] can be a part of the binary String ; Conversion of int into String ; if a [ i ] can 't be a part  then break the loop ; possible to create binary String ; impossible to create binary String ; Driver code
import java . util . * ; class Solution { static boolean isBinary ( int n ) { while ( n != 0 ) { int temp = n % 10 ; if ( temp != 0 && temp != 1 ) { return false ; } n = n / 10 ; } return true ; } static void formBinaryStr ( int n , int a [ ] ) { boolean flag = true ; String s = " " ; for ( int i = 0 ; i < n ; i ++ ) { if ( isBinary ( a [ i ] ) ) s += " " + a [ i ] ; else { flag = false ; break ; } } if ( flag ) System . out . print ( s + "NEW_LINE"); else System . out . print ( "-1NEW_LINE"); } public static void main ( String args [ ] ) { int a [ ] = { 10 , 1 , 0 , 11 , 10 } ; int N = a . length ; formBinaryStr ( N , a ) ; } }
Check if all the palindromic sub | Java implementation of the approach ; Function to check if the string is palindrome ; Function that checks whether all the palindromic sub - strings are of odd length . ; Creating each substring ; If the sub - string is of even length and is a palindrome then , we return False ; Driver code
import java . util . * ; class GFG { static boolean checkPalindrome ( String s ) { for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) != s . charAt ( s . length ( ) - i - 1 ) ) return false ; } return true ; } static boolean CheckOdd ( String s ) { int n = s . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String x = " " ; for ( int j = i ; j < n ; j ++ ) { x += s . charAt ( j ) ; if ( x . length ( ) % 2 == 0 && checkPalindrome ( x ) == true ) return false ; } } return true ; } public static void main ( String args [ ] ) { String s = " geeksforgeeks " ; if ( CheckOdd ( s ) ) System . out . print ( " YES " ) ; else System . out . print ( " NO " ) ; } }
Number of permutations of a string in which all the occurrences of a given character occurs together | Java implementation of above approach ; Function to return factorial of the number passed as argument ; Function to get the total permutations which satisfy the given condition ; Create has to store count of each character ; Store character occurrences ; Count number of times Particular character comes ; If particular character isn 't  present in the string then return 0 ; Remove count of particular character ; Total length of the string ; Assume all occurrences of particular character as a single character . ; Compute factorial of the length ; Divide by the factorials of the no . of occurrences of all the characters . ; return the result ; Driver Code ; Assuming the string and the character are all in uppercase
import java . util . * ; class solution { static int fact ( int n ) { int result = 1 ; for ( int i = 1 ; i <= n ; i ++ ) result *= i ; return result ; } static int getResult ( String str , char ch ) { int has [ ] = new int [ 26 ] ; for ( int i = 0 ; i < 26 ; i ++ ) has [ i ] = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) has [ str . charAt ( i ) - ' A ' ] ++ ; int particular = has [ ch - ' A ' ] ; if ( particular == 0 ) return 0 ; has [ ch - ' A ' ] = 0 ; int total = str . length ( ) ; total = total - particular + 1 ; int result = fact ( total ) ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( has [ i ] > 1 ) { result = result / fact ( has [ i ] ) ; } } return result ; } public static void main ( String args [ ] ) { String str = " MISSISSIPPI " ; System . out . println ( getResult ( str , ' S ' ) ) ; } }
Check if there exists any sub | Java program to check if there exists at least 1 sub - sequence in a string which is not palindrome ; Function to check if there exists at least 1 sub - sequence in a string which is not palindrome ; use set to count number of distinct characters ; insert each character in set ; If there is more than 1 unique characters , return true ; Else , return false ; Driver code
import java . util . * ; class GFG { static boolean isAnyNotPalindrome ( String s ) { Set < Character > unique = new HashSet < Character > ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) unique . add ( s . charAt ( i ) ) ; if ( unique . size ( ) > 1 ) return true ; else return false ; } public static void main ( String [ ] args ) { String s = " aaaaab " ; if ( isAnyNotPalindrome ( s ) ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }
Arrangement of words without changing the relative position of vowel and consonants | Java program for Arrangement of words without changing the relative position of vowel and consonants ; this function return n ! ; this will return total number of ways ; freq maintains frequency of each character in word ; check character is vowel or not ; the characters that are not vowel must be consonant ; number of ways to arrange vowel ; multiply both as these are independent ; Driver function ; string contains only capital letters ; this will contain ans
class GFG { static long factorial ( long n ) { long res = 1 ; for ( int i = 1 ; i <= n ; i ++ ) res = res * i ; return res ; } static long count ( String word ) { int freq [ ] = new int [ 27 ] ; for ( int i = 0 ; i < 27 ; i ++ ) freq [ i ] = 0 ; long vowel = 0 , consonant = 0 ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { freq [ word . charAt ( i ) - ' A ' ] ++ ; if ( word . charAt ( i ) == ' A ' || word . charAt ( i ) == ' E ' || word . charAt ( i ) == ' I ' || word . charAt ( i ) == ' O ' || word . charAt ( i ) == ' U ' ) { vowel ++ ; } else consonant ++ ; } long vowelArrange ; vowelArrange = factorial ( vowel ) ; vowelArrange /= factorial ( freq [ 0 ] ) ; vowelArrange /= factorial ( freq [ 4 ] ) ; vowelArrange /= factorial ( freq [ 8 ] ) ; vowelArrange /= factorial ( freq [ 14 ] ) ; vowelArrange /= factorial ( freq [ 20 ] ) ; long consonantArrange ; consonantArrange = factorial ( consonant ) ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( i != 0 && i != 4 && i != 8 && i != 14 && i != 20 ) consonantArrange /= factorial ( freq [ i ] ) ; } long total = vowelArrange * consonantArrange ; return total ; } public static void main ( String [ ] args ) { String word = " COMPUTER " ; long ans = count ( word ) ; System . out . println ( ans ) ; } }
Check if it is possible to create a palindrome string from given N | Java implementation of the above approach ; Function to check if a string is palindrome or not ; String that stores characters of s in reverse order ; Length of the string s ; String used to form substring using N ; Variable to store sum of digits of N ; Forming the substring by traversing N ; Appending the substr to str till it 's length becomes equal to sum ; Trimming the string str so that it 's length becomes equal to sum ; Driver code ; Calling function isPalindrome to check if str is Palindrome or not
import java . io . * ; import java . util . * ; public class GFG { static boolean isPalindrome ( String s ) { String s1 = " " ; int N = s . length ( ) ; for ( int i = N - 1 ; i >= 0 ; i -- ) s1 += s . charAt ( i ) ; if ( s . equals ( s1 ) ) return true ; return false ; } static boolean createString ( int N ) { String str = " " ; String s = " " + N ; String letters = " abcdefghij " ; int sum = 0 ; String substr = " " ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { int digit = s . charAt ( i ) - '0' ; substr += letters . charAt ( digit ) ; sum += digit ; } while ( str . length ( ) <= sum ) { str += substr ; } str = str . substring ( 0 , sum ) ; return isPalindrome ( str ) ; } public static void main ( String args [ ] ) { int N = 61 ; boolean flag = createString ( N ) ; if ( flag ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }
Program to find the product of ASCII values of characters in a string | Java program to find product of ASCII value of characters in string ; Function to find product of ASCII value of characters in string ; Traverse string to find the product ; Return the product ; Driver Code
class GFG { static long productAscii ( String str ) { long prod = 1 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { prod *= str . charAt ( i ) ; } return prod ; } public static void main ( String [ ] args ) { String str = " GfG " ; System . out . println ( productAscii ( str ) ) ; } }
Check if a large number can be divided into two or more segments of equal sum | Java program to Check if a large number can be divided into two or more segments of equal sum ; Function to check if a number can be divided into segments ; length of string ; array to store prefix sum ; first index ; calculate the prefix ; iterate for all number from second number ; sum from 0 th index to i - 1 th index ; counter turns true when sum is obtained from a segment ; iterate till the last number ; sum of segments ; if segment sum is equal to first segment ; when greater than not possible ; if at the end all values are traversed and all segments have sum equal to first segment then it is possible ; Driver Code
public class GFG { static boolean check ( String s ) { int n = s . length ( ) ; int [ ] Presum = new int [ n ] ; char [ ] s1 = s . toCharArray ( ) ; Presum [ 0 ] = s1 [ 0 ] - '0' ; for ( int i = 1 ; i < n ; i ++ ) { Presum [ i ] = Presum [ i - 1 ] + ( s1 [ i ] - '0' ) ; } for ( int i = 1 ; i <= n - 1 ; i ++ ) { int sum = Presum [ i - 1 ] ; int presum = 0 ; int it = i ; int flag = 0 ; while ( it < n ) { presum += s1 [ it ] - '0' ; if ( presum == sum ) { presum = 0 ; flag = 1 ; } else if ( presum > sum ) { break ; } it ++ ; } if ( presum == 0 && it == n && flag == 1 ) { return true ; } } return false ; } public static void main ( String [ ] args ) { String s = "73452" ; if ( check ( s ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }
Balance a string after removing extra brackets | Java implementation of above approach ; Print balanced and remove extra brackets from string ; Maintain a count for opening brackets Traversing string ; check if opening bracket ; print str . charAt ( i ) and increment count by 1 ; check if closing bracket and count != 0 ; decrement count by 1 ; if str . charAt ( i ) not a closing brackets print it ; balanced brackets if opening brackets are more then closing brackets ; print remaining closing brackets ; Driver Method
class GFG { public static void balancedString ( String str ) { int count = 0 , i ; int n = str . length ( ) ; for ( i = 0 ; i < n ; i ++ ) { if ( str . charAt ( i ) == ' ( ' ) { System . out . print ( str . charAt ( i ) ) ; count ++ ; } else if ( str . charAt ( i ) == ' ) ' && count != 0 ) { System . out . print ( str . charAt ( i ) ) ; count -- ; } else if ( str . charAt ( i ) != ' ) ' ) System . out . print ( str . charAt ( i ) ) ; } if ( count != 0 ) for ( i = 0 ; i < count ; i ++ ) System . out . print ( " ) " ) ; } public static void main ( String args [ ] ) { String str = " gau ) ra ) v ( ku ( mar ( rajput ) ) " ; balancedString ( str ) ; } }
Minimum operation require to make first and last character same | Java program to minimum operation require to make first and last character same ; Recursive function call ; Decrement ending index only ; Increment starting index only ; Increment starting index and decrement index ; Driver Code ; Function call
import java . util . * ; class GFG { static final int MAX = Integer . MAX_VALUE ; static int minOperation ( String s , int i , int j , int count ) { if ( ( i >= s . length ( ) && j < 0 ) || ( i == j ) ) return MAX ; if ( s . charAt ( i ) == s . charAt ( j ) ) return count ; if ( i >= s . length ( ) ) return minOperation ( s , i , j - 1 , count + 1 ) ; else if ( j < 0 ) return minOperation ( s , i + 1 , j , count + 1 ) ; else return Math . min ( minOperation ( s , i , j - 1 , count + 1 ) , minOperation ( s , i + 1 , j , count + 1 ) ) ; } public static void main ( String [ ] args ) { String s = " bacdefghipalop " ; int ans = minOperation ( s , 0 , s . length ( ) - 1 , 0 ) ; if ( ans == MAX ) System . out . println ( - 1 ) ; else System . out . println ( ans ) ; } }
Count strings with consonants and vowels at alternate position | Java implementation of above approach ; Function to find the count of strings ; Variable to store the final result ; Loop iterating through string ; If ' $ ' is present at the even position in the string ; ' sum ' is multiplied by 21 ; If ' $ ' is present at the odd position in the string ; ' sum ' is multiplied by 5 ; Driver code ; Let the string ' str ' be s$$e$ ; Print result
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int countStrings ( String s ) { int sum = 1 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( i % 2 == 0 && s . charAt ( i ) == ' $ ' ) sum *= 21 ; else if ( s . charAt ( i ) == ' $ ' ) sum *= 5 ; } return sum ; } public static void main ( String args [ ] ) { String str = " s $ $ e $ " ; System . out . println ( countStrings ( str ) ) ; } }
Remove duplicates from a string in O ( 1 ) extra space | Java implementation of above approach ; Function to remove duplicates ; keeps track of visited characters ; gets character value ; keeps track of length of resultant String ; check if Xth bit of counter is unset ; mark current character as visited ; Driver code
import java . util . Arrays ; class GFG { static char [ ] removeDuplicatesFromString ( String string ) { int counter = 0 ; char [ ] str = string . toCharArray ( ) ; int i = 0 ; int size = str . length ; int x ; int length = 0 ; while ( i < size ) { x = str [ i ] - 97 ; if ( ( counter & ( 1 << x ) ) == 0 ) { str [ length ] = ( char ) ( ' a ' + x ) ; counter = counter | ( 1 << x ) ; length ++ ; } i ++ ; } return Arrays . copyOfRange ( str , 0 , length ) ; } public static void main ( String [ ] args ) { String str = " geeksforgeeks " ; System . out . println ( removeDuplicatesFromString ( str ) ) ; } }
Remove duplicates from a string in O ( 1 ) extra space | Java implementation of above approach ; Method to remove duplicates ; table to keep track of visited characters ; to keep track of end index of resultant string ; Driver code
import java . util . Arrays ; class GFG { static char [ ] removeDuplicatesFromString ( String string ) { int [ ] table = new int [ 256 ] ; char [ ] chars = string . toCharArray ( ) ; int endIndex = 0 ; for ( int i = 0 ; i < chars . length ; i ++ ) { if ( table [ chars [ i ] ] == 0 ) { table [ chars [ i ] ] = - 1 ; chars [ endIndex ++ ] = chars [ i ] ; } } return Arrays . copyOfRange ( chars , 0 , endIndex ) ; } public static void main ( String [ ] args ) { String str = " geeksforgeeks " ; System . out . println ( removeDuplicatesFromString ( str ) ) ; } }
Check if the characters in a string form a Palindrome in O ( 1 ) extra space | Java program to check if the characters in the given string forms a Palindrome in O ( 1 ) extra space ; Utility function to get the position of first character in the string ; Get the position of first character in the string ; Utility function to get the position of last character in the string ; Get the position of last character in the string ; Function to check if the characters in the given string forms a Palindrome in O ( 1 ) extra space ; break , when all letters are checked ; if mismatch found , break the loop ; Driver code
import java . io . * ; class GFG { static int firstPos ( String str , int start , int end ) { int firstChar = - 1 ; for ( int i = start ; i <= end ; i ++ ) { if ( str . charAt ( i ) >= ' a ' && str . charAt ( i ) <= ' z ' ) { firstChar = i ; break ; } } return firstChar ; } static int lastPos ( String str , int start , int end ) { int lastChar = - 1 ; for ( int i = start ; i >= end ; i -- ) { if ( str . charAt ( i ) >= ' a ' && str . charAt ( i ) <= ' z ' ) { lastChar = i ; break ; } } return lastChar ; } static boolean isPalindrome ( String str ) { int firstChar = 0 , lastChar = str . length ( ) - 1 ; boolean ch = true ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { firstChar = firstPos ( str , firstChar , lastChar ) ; lastChar = lastPos ( str , lastChar , firstChar ) ; if ( lastChar < 0 firstChar < 0 ) break ; if ( str . charAt ( firstChar ) == str . charAt ( lastChar ) ) { firstChar ++ ; lastChar -- ; continue ; } ch = false ; break ; } return ch ; } public static void main ( String [ ] args ) { String str = " m ▁ a ▁ 343 ▁ la ▁ y ▁ a ▁ l ▁ am " ; if ( isPalindrome ( str ) ) System . out . print ( " YES " ) ; else System . out . println ( " NO " ) ; } }
Maximum length subsequence possible of the form R ^ N K ^ N | Java program to find the maximum length of a substring of form R ^ nK ^ n ; function to calculate the maximum length of substring of the form R ^ nK ^ n ; Count no . Of R 's before a K ; Count no . Of K 's after a K ; Update maximum length ; Driver code
public class gfg { int find ( String s ) { int max = 0 , i , j = 0 , countk = 0 , countr = 0 ; int table [ ] [ ] = new int [ s . length ( ) ] [ 2 ] ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' R ' ) countr ++ ; else table [ j ++ ] [ 0 ] = countr ; } j -- ; for ( i = s . length ( ) - 1 ; i >= 0 ; i -- ) { if ( s . charAt ( i ) == ' K ' ) { countk ++ ; table [ j -- ] [ 1 ] = countk ; } if ( Math . min ( table [ j + 1 ] [ 0 ] , table [ j + 1 ] [ 1 ] ) > max ) max = Math . min ( table [ j + 1 ] [ 0 ] , table [ j + 1 ] [ 1 ] ) ; } return max ; } public static void main ( String srgs [ ] ) { String s = " RKRRRKKRRKKKKRR " ; gfg ob = new gfg ( ) ; int n = ob . find ( s ) ; System . out . println ( n ) ; } }
Longest common anagram subsequence from N strings | Java program to find longest possible subsequence anagram of N strings . ; function to store frequency of each character in each string ; function to Find longest possible sequence of N strings which is anagram to each other ; to get lexicographical largest sequence . ; find minimum of that character ; print that character minimum number of times ; Driver code ; to store frequency of each character in each string ; to get frequency of each character ; function call
class GFG { final int MAX_CHAR = 26 ; static void frequency ( int fre [ ] [ ] , String s [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { String str = s [ i ] ; for ( int j = 0 ; j < str . length ( ) ; j ++ ) fre [ i ] [ str . charAt ( j ) - ' a ' ] ++ ; } } static void LongestSequence ( int fre [ ] [ ] , int n ) { for ( int i = 24 ; i >= 0 ; i -- ) { int mi = fre [ 0 ] [ i ] ; for ( int j = 1 ; j < n ; j ++ ) mi = Math . min ( fre [ j ] [ i ] , mi ) ; while ( mi -- != 0 ) System . out . print ( ( char ) ( ' a ' + i ) ) ; } } public static void main ( String args [ ] ) { String s [ ] = { " loo " , " lol " , " olive " } ; int n = s . length ; int fre [ ] [ ] = new int [ n ] [ 26 ] ; frequency ( fre , s , n ) ; LongestSequence ( fre , n ) ; } }
Check if two strings are permutation of each other | Java program to check whether two strings are Permutations of each other ; function to check whether two strings are Permutation of each other ; Get lengths of both strings ; If length of both strings is not same , then they cannot be Permutation ; Sort both strings ; Compare sorted strings ; Driver program to test to print printDups
import java . util . * ; class GfG { static boolean arePermutation ( String str1 , String str2 ) { int n1 = str1 . length ( ) ; int n2 = str2 . length ( ) ; if ( n1 != n2 ) return false ; char ch1 [ ] = str1 . toCharArray ( ) ; char ch2 [ ] = str2 . toCharArray ( ) ; Arrays . sort ( ch1 ) ; Arrays . sort ( ch2 ) ; for ( int i = 0 ; i < n1 ; i ++ ) if ( ch1 [ i ] != ch2 [ i ] ) return false ; return true ; } public static void main ( String [ ] args ) { String str1 = " test " ; String str2 = " ttew " ; if ( arePermutation ( str1 , str2 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }
Check if two strings are permutation of each other | Java function to check whether two strings are Permutations of each other ; Create a count array and initialize all values as 0 ; For each character in input strings , increment count in the corresponding count array ; If both strings are of different length . Removing this condition will make the program fail for strings like " aaca " and " aca " ; See if there is any non - zero value in count array
static boolean arePermutation ( char str1 [ ] , char str2 [ ] ) { int count [ ] = new int [ NO_OF_CHARS ] ; int i ; for ( i = 0 ; str1 [ i ] && str2 [ i ] ; i ++ ) { count [ str1 [ i ] ] ++ ; count [ str2 [ i ] ] -- ; } if ( str1 [ i ] str2 [ i ] ) return false ; for ( i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( count [ i ] != 0 ) return false ; return true ; }