dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static int countWords ( String [ ] str , int n ) { Dictionary < String , int > m = new Dictionary < String , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . ContainsKey ( str [ i ] ) ) { int get = m [ str [ i ] ] ; m . Remove ( str [ i ] ) ; m . Add ( str [ i ] , get + 1 ) ; } else { m . Add ( str [ i ] , 1 ) ; } } int res = 0 ; foreach ( KeyValuePair < String , int > it in m ) { if ( it . Value == 2 ) res ++ ; } return res ; } public static void Main ( String [ ] args ) { String [ ] a = { " hate " , " love " , " peace " , " love " , " peace " , " hate " , " love " , " peace " , " love " , " peace " } ; int n = a . Length ; Console . WriteLine ( countWords ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, res
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int V = 4 ; static bool colorGraph ( int [ , ] G , int [ ] color , int pos , int c ) { if ( color [ pos ] != - 1 && color [ pos ] != c ) return false ; color [ pos ] = c ; bool ans = true ; for ( int i = 0 ; i < V ; i ++ ) { if ( G [ pos , i ] == 1 ) { if ( color [ i ] == - 1 ) ans &= colorGraph ( G , color , i , 1 - c ) ; if ( color [ i ] != - 1 && color [ i ] != 1 - c ) return false ; } if ( ! ans ) return false ; } return true ; } static bool isBipartite ( int [ , ] G ) { int [ ] color = new int [ V ] ; for ( int i = 0 ; i < V ; i ++ ) color [ i ] = - 1 ; int pos = 0 ; return colorGraph ( G , color , pos , 1 ) ; } public static void Main ( String [ ] args ) { int [ , ] G = { { 0 , 1 , 0 , 1 } , { 1 , 0 , 1 , 0 } , { 0 , 1 , 0 , 1 } , { 1 , 0 , 1 , 0 } } ; if ( isBipartite ( G ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: V, i, pos
Accumulator variables: ans, i
Iterator variables: i
Boolean variables: ans
Class/struct names: GFG
C# program:
using System ; class GFG { static string evenlength ( string n ) { string res = n ; for ( int j = n . Length - 1 ; j >= 0 ; -- j ) res += n [ j ] ; return res ; } public static void Main ( ) { string n = "10" ; Console . WriteLine ( evenlength ( n ) ) ; } }

Index/key variables: j
Accumulator variables: res
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countinString ( char ch , String s ) { if ( s . Length == 0 ) return 0 ; int count = 0 ; if ( s [ 0 ] == ch ) count ++ ; count += countinString ( ch , s . Substring ( 1 ) ) ; return count ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; char c = ' e ' ; Console . WriteLine ( countinString ( c , str ) ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool uniqueCharacters ( String str ) { for ( int i = 0 ; i < str . Length ; i ++ ) for ( int j = i + 1 ; j < str . Length ; j ++ ) if ( str [ i ] == str [ j ] ) return false ; return true ; } public static void Main ( ) { string input = " GeeksforGeeks " ; if ( uniqueCharacters ( input ) == true ) Console . WriteLine ( " The ▁ String ▁ " + input + " ▁ has ▁ all ▁ unique ▁ characters " ) ; else Console . WriteLine ( " The ▁ String ▁ " + input + " ▁ has ▁ duplicate ▁ characters " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static Boolean strcheck ( String s1 , String s2 ) { if ( s1 . CompareTo ( s2 ) != 0 ) return false ; return true ; } public static Boolean check ( String s ) { if ( s . Length >= 10 ) return true ; for ( int i = 1 ; i < s . Length ; i ++ ) { for ( int j = i + 1 ; j < s . Length ; j ++ ) { for ( int k = j + 1 ; k < s . Length ; k ++ ) { String s1 = " " , s2 = " " , s3 = " " , s4 = " " ; try { s1 = s . Substring ( 0 , i ) ; s2 = s . Substring ( i , j - i ) ; s3 = s . Substring ( j , k - j ) ; s4 = s . Substring ( k , s . Length - k ) ; } catch ( Exception e ) { } if ( strcheck ( s1 , s2 ) && strcheck ( s1 , s3 ) && strcheck ( s1 , s4 ) && strcheck ( s2 , s3 ) && strcheck ( s2 , s4 ) && strcheck ( s3 , s4 ) ) return true ; } } } return false ; } public static void Main ( String [ ] args ) { String str = " aaabb " ; if ( check ( str ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static String multiply ( String num1 , String num2 ) { int len1 = num1 . Length ; int len2 = num2 . Length ; if ( len1 == 0 len2 == 0 ) return "0" ; int [ ] result = new int [ len1 + len2 ] ; int i_n1 = 0 ; int i_n2 = 0 ; int i ; for ( i = len1 - 1 ; i >= 0 ; i -- ) { int carry = 0 ; int n1 = num1 [ i ] - '0' ; i_n2 = 0 ; for ( int j = len2 - 1 ; j >= 0 ; j -- ) { int n2 = num2 [ j ] - '0' ; int sum = n1 * n2 + result [ i_n1 + i_n2 ] + carry ; carry = sum / 10 ; result [ i_n1 + i_n2 ] = sum % 10 ; i_n2 ++ ; } if ( carry > 0 ) result [ i_n1 + i_n2 ] += carry ; i_n1 ++ ; } i = result . Length - 1 ; while ( i >= 0 && result [ i ] == 0 ) i -- ; if ( i == - 1 ) return "0" ; String s = " " ; while ( i >= 0 ) s += ( result [ i -- ] ) ; return s ; } public static void Main ( String [ ] args ) { String str1 = "1235421415454545454545454544" ; String str2 = "1714546546546545454544548544544545" ; if ( ( str1 [ 0 ] == ' - ' str2 [ 0 ] == ' - ' ) && ( str1 [ 0 ] != ' - ' str2 [ 0 ] != ' - ' ) ) Console . Write ( " - " ) ; if ( str1 [ 0 ] == ' - ' && str2 [ 0 ] != ' - ' ) { str1 = str1 . Substring ( 1 ) ; } else if ( str1 [ 0 ] != ' - ' && str2 [ 0 ] == ' - ' ) { str2 = str2 . Substring ( 1 ) ; } else if ( str1 [ 0 ] == ' - ' && str2 [ 0 ] == ' - ' ) { str1 = str1 . Substring ( 1 ) ; str2 = str2 . Substring ( 1 ) ; } Console . WriteLine ( multiply ( str1 , str2 ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, i_n1, i_n2, j, s
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int findIndex ( string str ) { int len = str . Length ; int [ ] open = new int [ len + 1 ] ; int [ ] close = new int [ len + 1 ] ; int index = - 1 ; open [ 0 ] = 0 ; close [ len ] = 0 ; if ( str [ 0 ] == ' ( ' ) open [ 1 ] = 1 ; if ( str [ len - 1 ] == ' ) ' ) close [ len - 1 ] = 1 ; for ( int i = 1 ; i < len ; i ++ ) { if ( str [ i ] == ' ( ' ) open [ i + 1 ] = open [ i ] + 1 ; else open [ i + 1 ] = open [ i ] ; } for ( int i = len - 2 ; i >= 0 ; i -- ) { if ( str [ i ] == ' ) ' ) close [ i ] = close [ i + 1 ] + 1 ; else close [ i ] = close [ i + 1 ] ; } if ( open [ len ] == 0 ) return len ; if ( close [ 0 ] == 0 ) return 0 ; for ( int i = 0 ; i <= len ; i ++ ) if ( open [ i ] == close [ i ] ) index = i ; return index ; } public static void Main ( ) { string str = " ( ( ) ) ) ( ( ) ( ) ( ) ) ) ) " ; Console . Write ( findIndex ( str ) ) ; } }

Index/key variables: i, len
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String decimalToBinary ( double num , int k_prec ) { String binary = " " ; int Integral = ( int ) num ; double fractional = num - Integral ; while ( Integral > 0 ) { int rem = Integral % 2 ; binary += ( ( char ) ( rem + '0' ) ) ; Integral /= 2 ; } binary = reverse ( binary ) ; binary += ( ' . ' ) ; while ( k_prec -- > 0 ) { fractional *= 2 ; int fract_bit = ( int ) fractional ; if ( fract_bit == 1 ) { fractional -= fract_bit ; binary += ( char ) ( 1 + '0' ) ; } else { binary += ( char ) ( 0 + '0' ) ; } } return binary ; } static String reverse ( String input ) { char [ ] temparray = input . ToCharArray ( ) ; int left , right = 0 ; right = temparray . Length - 1 ; for ( left = 0 ; left < right ; left ++ , right -- ) { char temp = temparray [ left ] ; temparray [ left ] = temparray [ right ] ; temparray [ right ] = temp ; } return String . Join ( " " , temparray ) ; } public static void Main ( String [ ] args ) { double n = 4.47 ; int k = 3 ; Console . WriteLine ( decimalToBinary ( n , k ) ) ; n = 6.986 ; k = 5 ; Console . WriteLine ( decimalToBinary ( n , k ) ) ; } }

Index/key variables: left, right
Accumulator variables: Integral, binary, fractional, k_prec, left, right
Iterator variables: left
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isSmaller ( string str1 , string str2 ) { int n1 = str1 . Length , n2 = str2 . Length ; if ( n1 < n2 ) return true ; if ( n2 < n1 ) return false ; for ( int i = 0 ; i < n1 ; i ++ ) { if ( str1 [ i ] < str2 [ i ] ) return true ; else if ( str1 [ i ] > str2 [ i ] ) return false ; } return false ; } static string findDiff ( string str1 , string str2 ) { if ( isSmaller ( str1 , str2 ) ) { string t = str1 ; str1 = str2 ; str2 = t ; } String str = " " ; int n1 = str1 . Length , n2 = str2 . Length ; int diff = n1 - n2 ; int carry = 0 ; for ( int i = n2 - 1 ; i >= 0 ; i -- ) { int sub = ( ( ( int ) str1 [ i + diff ] - ( int ) '0' ) - ( ( int ) str2 [ i ] - ( int ) '0' ) - carry ) ; if ( sub < 0 ) { sub = sub + 10 ; carry = 1 ; } else carry = 0 ; str += sub . ToString ( ) ; } for ( int i = n1 - n2 - 1 ; i >= 0 ; i -- ) { if ( str1 [ i ] == '0' && carry > 0 ) { str += "9" ; continue ; } int sub = ( ( ( int ) str1 [ i ] - ( int ) '0' ) - carry ) ; str += sub . ToString ( ) ; carry = 0 ; } char [ ] aa = str . ToCharArray ( ) ; Array . Reverse ( aa ) ; return new string ( aa ) ; } public static void Main ( ) { String str1 = "88" ; String str2 = "1079" ; Console . WriteLine ( findDiff ( str1 , str2 ) ) ; } }

Index/key variables: i
Accumulator variables: i, str
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool unique ( String s ) { Array . Sort ( s . ToCharArray ( ) ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == s [ i + 1 ] ) { return false ; } } return true ; } public static void Main ( String [ ] args ) { if ( unique ( " abcdd " ) == true ) { Console . WriteLine ( " String ▁ is ▁ Unique " ) ; } else { Console . WriteLine ( " String ▁ is ▁ not ▁ Unique " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX_CHAR = 26 ; static bool areKAnagrams ( String str1 , String str2 , int k ) { int n = str1 . Length ; if ( str2 . Length != n ) return false ; int [ ] hash_str1 = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < n ; i ++ ) hash_str1 [ str1 [ i ] - ' a ' ] ++ ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( hash_str1 [ str2 [ i ] - ' a ' ] > 0 ) hash_str1 [ str2 [ i ] - ' a ' ] -- ; else count ++ ; if ( count > k ) return false ; } return true ; } static void Main ( ) { String str1 = " fodr " ; String str2 = " gork " ; int k = 2 ; if ( areKAnagrams ( str1 , str2 , k ) == true ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: MAX_CHAR, i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static char getDigit ( int N , int d ) { string str = Convert . ToString ( N ) ; return str [ d - 1 ] ; } static char getNthChar ( int N ) { int sum = 0 , nine = 9 ; int dist = 0 , len ; for ( len = 1 ; ; len ++ ) { sum += nine * len ; dist += nine ; if ( sum >= N ) { sum -= nine * len ; dist -= nine ; N -= sum ; break ; } nine *= 10 ; } int diff = ( int ) ( Math . Ceiling ( ( double ) ( N ) / ( double ) ( len ) ) ) ; int d = N % len ; if ( d == 0 ) d = len ; return getDigit ( dist + diff , d ) ; } static void Main ( ) { int N = 251 ; Console . WriteLine ( getNthChar ( N ) ) ; } }

Accumulator variables: N, dist, len, nine, sum
Iterator variables: len
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool ispalindrome ( String s ) { int l = s . Length ; for ( int i = 0 , j = l - 1 ; i <= j ; i ++ , j -- ) { if ( s [ i ] != s [ j ] ) { return false ; } } return true ; } public static void Main ( ) { String s = " BABABAA " ; int cnt = 0 ; int flag = 0 ; while ( s . Length > 0 ) { if ( ispalindrome ( s ) ) { flag = 1 ; break ; } else { cnt ++ ; s = s . Substring ( 0 , s . Length - 1 ) ; s . erase ( s . begin ( ) + s . length ( ) - 1 ) ; } } if ( flag == 1 ) { Console . WriteLine ( cnt ) ; } } }

Index/key variables: i, j
Accumulator variables: cnt, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findCount ( string str ) { int result = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) if ( i == ( str [ i ] - ' a ' ) || i == ( str [ i ] - ' A ' ) ) result ++ ; return result ; } public static void Main ( ) { string str = " AbgdeF " ; Console . Write ( findCount ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPalindrome ( string str , int low , int high ) { while ( low < high ) { if ( str [ low ] != str [ high ] ) return false ; low ++ ; high -- ; } return true ; } static int possiblePalinByRemovingOneChar ( string str ) { int low = 0 , high = str . Length - 1 ; while ( low < high ) { if ( str [ low ] == str [ high ] ) { low ++ ; high -- ; } else { if ( isPalindrome ( str , low + 1 , high ) ) return low ; if ( isPalindrome ( str , low , high - 1 ) ) return high ; return - 1 ; } } return - 2 ; } public static void Main ( String [ ] args ) { string str = " abecbea " ; int idx = possiblePalinByRemovingOneChar ( str ) ; if ( idx == - 1 ) Console . Write ( " Not ▁ Possible " ) ; else if ( idx == - 2 ) Console . Write ( " Possible ▁ without ▁ " + " removing ▁ any ▁ character " ) ; else Console . Write ( " Possible ▁ by ▁ removing " + " ▁ character ▁ at ▁ index ▁ " + idx ) ; } }

Index/key variables: high, low
Accumulator variables: high, low
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int ALPHABET_SIZE = 26 ; public class TrieNode { public TrieNode [ ] children = new TrieNode [ ALPHABET_SIZE ] ; public bool isLeaf ; public List < String > word ; public TrieNode ( ) { isLeaf = false ; for ( int i = 0 ; i < ALPHABET_SIZE ; i ++ ) children [ i ] = null ; word = new List < String > ( ) ; } } static TrieNode root ; static void insert ( String word ) { int index ; TrieNode pCrawl = root ; for ( int level = 0 ; level < word . Length ; level ++ ) { if ( char . IsLower ( word [ level ] ) ) continue ; index = word [ level ] - ' A ' ; if ( pCrawl . children [ index ] == null ) pCrawl . children [ index ] = new TrieNode ( ) ; pCrawl = pCrawl . children [ index ] ; } pCrawl . isLeaf = true ; ( pCrawl . word ) . Add ( word ) ; } static void printAllWords ( TrieNode root ) { if ( root . isLeaf ) { foreach ( String str in root . word ) Console . WriteLine ( str ) ; } for ( int i = 0 ; i < ALPHABET_SIZE ; i ++ ) { TrieNode child = root . children [ i ] ; if ( child != null ) printAllWords ( child ) ; } } static bool search ( String pattern ) { int index ; TrieNode pCrawl = root ; for ( int level = 0 ; level < pattern . Length ; level ++ ) { index = pattern [ level ] - ' A ' ; if ( pCrawl . children [ index ] == null ) return false ; pCrawl = pCrawl . children [ index ] ; } printAllWords ( pCrawl ) ; return true ; } static void findAllWords ( List < String > dict , String pattern ) { root = new TrieNode ( ) ; foreach ( String word in dict ) insert ( word ) ; if ( ! search ( pattern ) ) Console . WriteLine ( " No ▁ match ▁ found " ) ; } public static void Main ( String [ ] args ) { List < String > dict = new List < String > { " Hi " , " Hello " , " HelloWorld " , " HiTech " , " HiGeek " , " HiTechWorld " , " HiTechCity " , " HiTechLab " } ; String pattern = " HT " ; findAllWords ( dict , pattern ) ; } }

Index/key variables: ALPHABET_SIZE, i, index, level
Accumulator variables: i, level
Iterator variables: i, level, str, word
Boolean variables: isLeaf
Class/struct names: GFG, TrieNode
C# program:
using System ; class GFG { public static void print ( char [ ] str , int index ) { if ( index == str . Length ) { Console . WriteLine ( str ) ; return ; } if ( str [ index ] == ' ? ' ) { str [ index ] = '0' ; print ( str , index + 1 ) ; str [ index ] = '1' ; print ( str , index + 1 ) ; str [ index ] = ' ? ' ; } else print ( str , index + 1 ) ; } public static void Main ( ) { string input = "1 ? ? 0?101" ; char [ ] str = input . ToCharArray ( ) ; print ( str , 0 ) ; } }

Index/key variables: index
Class/struct names: GFG
C# program:
class GFG { static int countOccurrences ( int x , int d ) { int count = 0 ; while ( x > 0 ) { if ( x % 10 == d ) count ++ ; x = x / 10 ; } return count ; } static int maxOccurring ( int x ) { if ( x < 0 ) x = - x ; int result = 0 ; int max_count = 1 ; for ( int d = 0 ; d <= 9 ; d ++ ) { int count = countOccurrences ( x , d ) ; if ( count >= max_count ) { max_count = count ; result = d ; } } return result ; } static void Main ( ) { int x = 1223355 ; System . Console . WriteLine ( " Max ▁ occurring ▁ digit ▁ is ▁ " + maxOccurring ( x ) ) ; } }

Accumulator variables: count, d
Iterator variables: d
Class/struct names: GFG
C# program:
using System ; class GFG { static String removeRecurringDigits ( char [ ] num ) { int len = num . Length ; String s = " " ; for ( int i = 0 ; i < len ; i ++ ) { s += String . Join ( " " , num [ i ] ) ; while ( i + 1 < len && num [ i ] == num [ i + 1 ] ) { i ++ ; } } return s ; } public static void Main ( ) { char [ ] num = "1299888833" . ToCharArray ( ) ; Console . Write ( " Modified ▁ number ▁ is ▁ " + removeRecurringDigits ( num ) ) ; } }

Index/key variables: i
Accumulator variables: i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxSubarrayXOR ( int [ ] arr , int n ) { int ans = int . MinValue ; for ( int i = 0 ; i < n ; i ++ ) { int curr_xor = 0 ; for ( int j = i ; j < n ; j ++ ) { curr_xor = curr_xor ^ arr [ j ] ; ans = Math . Max ( ans , curr_xor ) ; } } return ans ; } public static void Main ( ) { int [ ] arr = { 8 , 1 , 2 , 12 } ; int n = arr . Length ; Console . WriteLine ( " Max ▁ subarray ▁ XOR ▁ is ▁ " + maxSubarrayXOR ( arr , n ) ) ; } }

Index/key variables: j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int myAtoiRecursive ( string str , int n ) { if ( n == 1 ) { return str [ 0 ] - '0' ; } return ( 10 * myAtoiRecursive ( str , n - 1 ) + str [ n - 1 ] - '0' ) ; } public static void Main ( ) { string str = "112" ; int n = str . Length ; Console . Write ( myAtoiRecursive ( str , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void printPattern ( string str , int len ) { for ( int i = 0 ; i < len ; i ++ ) { for ( int j = 0 ; j < len ; j ++ ) { if ( ( i == j ) || ( i + j == len - 1 ) ) Console . Write ( str [ j ] ) ; else Console . Write ( " ▁ " ) ; } Console . WriteLine ( ) ; } } static public void Main ( ) { String str = " geeksforgeeks " ; int len = str . Length ; printPattern ( str , len ) ; } }

Index/key variables: j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int MAX_CHARS = 26 ; static bool isValid ( int [ ] count , int k ) { int val = 0 ; for ( int i = 0 ; i < MAX_CHARS ; i ++ ) { if ( count [ i ] > 0 ) { val ++ ; } } return ( k >= val ) ; } static void kUniques ( string s , int k ) { int u = 0 ; int n = s . Length ; int [ ] count = new int [ MAX_CHARS ] ; Array . Fill ( count , 0 ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( count [ s [ i ] - ' a ' ] == 0 ) { u ++ ; } count [ s [ i ] - ' a ' ] ++ ; } if ( u < k ) { Console . Write ( " Not ▁ enough ▁ unique ▁ characters " ) ; return ; } int curr_start = 0 , curr_end = 0 ; int max_window_size = 1 ; int max_window_start = 0 ; Array . Fill ( count , 0 ) ; count [ s [ 0 ] - ' a ' ] ++ ; for ( int i = 1 ; i < n ; i ++ ) { count [ s [ i ] - ' a ' ] ++ ; curr_end ++ ; while ( ! isValid ( count , k ) ) { count [ s [ curr_start ] - ' a ' ] -- ; curr_start ++ ; } if ( curr_end - curr_start + 1 > max_window_size ) { max_window_size = curr_end - curr_start + 1 ; max_window_start = curr_start ; } } Console . WriteLine ( " Max ▁ substring ▁ is ▁ : ▁ " + s . Substring ( max_window_start , max_window_size ) + " ▁ with ▁ length ▁ " + max_window_size ) ; } static public void Main ( ) { string s = " aabacbebebe " ; int k = 3 ; kUniques ( s , k ) ; } }

Index/key variables: MAX_CHARS, curr_start, i
Accumulator variables: curr_end, curr_start, i, u, val
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX_CHAR = 26 ; static int runCustomerSimulation ( int n , char [ ] seq ) { char [ ] seen = new char [ MAX_CHAR ] ; int res = 0 ; int occupied = 0 ; for ( int i = 0 ; i < seq . Length ; i ++ ) { int ind = seq [ i ] - ' A ' ; if ( seen [ ind ] == 0 ) { seen [ ind ] = ( char ) 1 ; if ( occupied < n ) { occupied ++ ; seen [ ind ] = ( char ) 2 ; } else res ++ ; } else { if ( seen [ ind ] == 2 ) occupied -- ; seen [ ind ] = ( char ) 0 ; } } return res ; } public static void Main ( String [ ] args ) { Console . WriteLine ( runCustomerSimulation ( 2 , " ABBAJJKZKZ " . ToCharArray ( ) ) ) ; Console . WriteLine ( runCustomerSimulation ( 3 , " GACCBDDBAGEE " . ToCharArray ( ) ) ) ; Console . WriteLine ( runCustomerSimulation ( 3 , " GACCBGDDBAEE " . ToCharArray ( ) ) ) ; Console . WriteLine ( runCustomerSimulation ( 1 , " ABCBCA " . ToCharArray ( ) ) ) ; Console . WriteLine ( runCustomerSimulation ( 1 , " ABCBCADEED " . ToCharArray ( ) ) ) ; } }

Index/key variables: MAX_CHAR, i, ind
Accumulator variables: i, occupied, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool canFormPalindrome ( string a ) { int bitvector = 0 , mask = 0 ; for ( int i = 0 ; i < a . Length ; i ++ ) { int x = a [ i ] - ' a ' ; mask = 1 << x ; bitvector = bitvector ^ mask ; } return ( bitvector & ( bitvector - 1 ) ) == 0 ; } static public void Main ( ) { if ( canFormPalindrome ( " geeksforgeeks " ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int NO_OF_CHARS = 256 ; static bool areAnagram ( String str1 , String str2 ) { int [ ] count = new int [ NO_OF_CHARS ] ; int i ; for ( i = 0 ; i < str1 . Length && i < str2 . Length ; i ++ ) { count [ str1 [ i ] ] ++ ; count [ str2 [ i ] ] -- ; } if ( str1 . Length != str2 . Length ) return false ; for ( i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( count [ i ] != 0 ) return false ; return true ; } static void findAllAnagrams ( String [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( areAnagram ( arr [ i ] , arr [ j ] ) ) Console . WriteLine ( arr [ i ] + " ▁ is ▁ anagram ▁ of ▁ " + arr [ j ] ) ; } public static void Main ( ) { String [ ] arr = { " geeksquiz " , " geeksforgeeks " , " abcd " , " forgeeksgeeks " , " zuiqkeegs " } ; int n = arr . Length ; findAllAnagrams ( arr , n ) ; } }

Index/key variables: NO_OF_CHARS, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static int isPalindrome ( int n ) { int rev = 0 ; for ( int i = n ; i > 0 ; i /= 10 ) { rev = rev * 10 + i % 10 ; } return ( n == rev ) ? 1 : 0 ; } public static void countPal ( int min , int max ) { for ( int i = min ; i <= max ; i ++ ) { if ( isPalindrome ( i ) == 1 ) { Console . Write ( i + " ▁ " ) ; } } } public static void Main ( string [ ] args ) { countPal ( 100 , 2000 ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG