dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class GFG { static string checkIfPossible ( int N , string [ ] arr , string T ) { int [ ] freqS = new int [ 256 ] ; int [ ] freqT = new int [ 256 ] ; foreach ( char ch in T . ToCharArray ( ) ) { freqT [ ch - ' a ' ] ++ ; } for ( int i = 0 ; i < N ; i ++ ) { foreach ( char ch in arr [ i ] . ToCharArray ( ) ) { freqS [ ch - ' a ' ] ++ ; } } for ( int i = 0 ; i < 256 ; i ++ ) { if ( freqT [ i ] == 0 && freqS [ i ] != 0 ) { return " No " ; } else if ( freqS [ i ] == 0 && freqT [ i ] != 0 ) { return " No " ; } else if ( freqT [ i ] != 0 && freqS [ i ] != ( freqT [ i ] * N ) ) { return " No " ; } } return " Yes " ; } public static void Main ( string [ ] args ) { string [ ] arr = { " abc " , " abb " , " acc " } ; string T = " abc " ; int N = arr . Length ; Console . WriteLine ( checkIfPossible ( N , arr , T ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: ch, i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int groupsOfOnes ( string S , int N ) { int count = 0 ; Stack < int > st = new Stack < int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( S [ i ] == '1' ) st . Push ( 1 ) ; else { if ( st . Count > 0 ) { count ++ ; while ( st . Count > 0 ) { st . Pop ( ) ; } } } } if ( st . Count > 0 ) count ++ ; return count ; } public static void Main ( ) { string S = "100110111" ; int N = S . Length ; Console . Write ( groupsOfOnes ( S , N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void generatePalindrome ( string S ) { Dictionary < char , int > Hash = new Dictionary < char , int > ( ) ; foreach ( char ch in S ) { if ( Hash . ContainsKey ( ch ) ) Hash [ ch ] ++ ; else Hash . Add ( ch , 1 ) ; } HashSet < string > st = new HashSet < string > ( ) ; for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { if ( Hash . ContainsKey ( i ) && Hash [ i ] == 2 ) { for ( char j = ' a ' ; j <= ' z ' ; j ++ ) { string s = " " ; if ( Hash . ContainsKey ( j ) && i != j ) { s += i ; s += j ; s += i ; st . Add ( s ) ; } } } if ( Hash . ContainsKey ( i ) && Hash [ i ] >= 3 ) { for ( char j = ' a ' ; j <= ' z ' ; j ++ ) { string s = " " ; if ( Hash . ContainsKey ( j ) ) { s += i ; s += j ; s += i ; st . Add ( s ) ; } } } } foreach ( string ans in st ) { Console . WriteLine ( ans ) ; } } public static void Main ( ) { string S = " ddabdac " ; generatePalindrome ( S ) ; } }

Index/key variables: ch, i
Accumulator variables: i, j, s
Iterator variables: ans, ch, i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static void countOccurrences ( string S , string X , string Y ) { int count = 0 ; int N = S . Length , A = X . Length ; int B = Y . Length ; int P = Math . Min ( A , Math . Min ( N , B ) ) ; for ( int i = 0 ; i < N - P + 1 ; i ++ ) { if ( S . Substring ( i , Math . Min ( N , B ) ) . Equals ( Y ) ) count ++ ; if ( S . Substring ( i , Math . Min ( N , A ) ) . Equals ( X ) ) Console . Write ( count + " ▁ " ) ; } } public static void Main ( string [ ] args ) { string S = " abcdefdefabc " ; string X = " abc " ; string Y = " def " ; countOccurrences ( S , X , Y ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void DFA ( string str , int N ) { if ( N <= 1 ) { Console . Write ( " No " ) ; return ; } int count = 0 ; if ( str [ 0 ] == ' C ' ) { count ++ ; for ( int i = 1 ; i < N ; i ++ ) { if ( str [ i ] == ' A ' str [ i ] == ' B ' ) count ++ ; else break ; } } else { Console . Write ( " No " ) ; return ; } if ( count == N ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } static public void Main ( ) { string str = " CAABBAAB " ; int N = str . Length ; DFA ( str , N ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void minMaxDigits ( string str , int N ) { int [ ] arr = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) arr [ i ] = ( str [ i ] - '0' ) % 3 ; int zero = 0 , one = 0 , two = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] == 0 ) zero ++ ; if ( arr [ i ] == 1 ) one ++ ; if ( arr [ i ] == 2 ) two ++ ; } int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { sum = ( sum + arr [ i ] ) % 3 ; } if ( sum == 0 ) { Console . Write ( 0 + " ▁ " ) ; } if ( sum == 1 ) { if ( ( one != 0 ) && ( N > 1 ) ) Console . Write ( 1 + " ▁ " ) ; else if ( two > 1 && N > 2 ) Console . Write ( 2 + " ▁ " ) ; else Console . Write ( - 1 + " ▁ " ) ; } if ( sum == 2 ) { if ( two != 0 && N > 1 ) Console . Write ( 1 + " ▁ " ) ; else if ( one > 1 && N > 2 ) Console . Write ( 2 + " ▁ " ) ; else Console . Write ( - 1 + " ▁ " ) ; } if ( zero > 0 ) Console . Write ( N - 1 + " ▁ " ) ; else if ( one > 0 && two > 0 ) Console . Write ( N - 2 + " ▁ " ) ; else if ( one > 2 two > 2 ) Console . Write ( N - 3 + " ▁ " ) ; else Console . Write ( - 1 + " ▁ " ) ; } public static void Main ( ) { string str = "12345" ; int N = str . Length ; minMaxDigits ( str , N ) ; } }

Index/key variables: N, i
Accumulator variables: i, one, two, zero
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findMinimumChanges ( int N , int K , char [ ] S ) { int ans = 0 ; for ( int i = 0 ; i < ( K + 1 ) / 2 ; i ++ ) { Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( int j = i ; j < N ; j += K ) { if ( mp . ContainsKey ( S [ j ] ) ) { mp [ S [ j ] ] ++ ; } else { mp . Add ( S [ j ] , 1 ) ; } } for ( int j = N - i - 1 ; j >= 0 ; j -= K ) { if ( K % 2 == 1 && i == K / 2 ) break ; if ( mp . ContainsKey ( S [ j ] ) ) { mp [ S [ j ] ] ++ ; } else { mp . Add ( S [ j ] , 1 ) ; } } int curr_max = int . MinValue ; foreach ( KeyValuePair < char , int > p in mp ) { curr_max = Math . Max ( curr_max , p . Value ) ; } if ( ( K % 2 == 1 ) && i == K / 2 ) ans += ( N / K - curr_max ) ; else ans += ( N / K * 2 - curr_max ) ; } return ans ; } public static void Main ( String [ ] args ) { String S = " aabbcbbcb " ; int N = S . Length ; int K = 3 ; Console . Write ( findMinimumChanges ( N , K , S . ToCharArray ( ) ) ) ; } }

Index/key variables: j
Accumulator variables: ans, i, j
Iterator variables: i, j, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static String checkString ( String s , int K ) { int n = s . Length ; Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( s [ i ] ) ) mp [ s [ i ] ] = i ; else mp . Add ( s [ i ] , i ) ; } int f = 0 ; HashSet < char > st = new HashSet < char > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { st . Add ( s [ i ] ) ; if ( st . Count > K ) { f = 1 ; break ; } if ( mp [ s [ i ] ] == i ) st . Remove ( s [ i ] ) ; } return ( f == 1 ? " Yes " : " No " ) ; } public static void Main ( String [ ] args ) { String s = " aabbcdca " ; int k = 2 ; Console . WriteLine ( checkString ( s , k ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static void distinct ( string [ ] S , int M ) { int count = 0 ; for ( int i = 0 ; i < S . Length ; i ++ ) { HashSet < char > set = new HashSet < char > ( ) ; for ( int j = 0 ; j < S [ i ] . Length ; j ++ ) { if ( ! set . Contains ( S [ i ] [ j ] ) ) set . Add ( S [ i ] [ j ] ) ; } int c = set . Count ; if ( c <= M ) count += 1 ; } Console . Write ( count ) ; } public static void Main ( string [ ] args ) { string [ ] S = { " HERBIVORES " , " AEROPLANE " , " GEEKSFORGEEKS " } ; int M = 7 ; distinct ( S , M ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string removeOddFrequencyCharacters ( string s ) { Dictionary < char , int > m = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { char p = s [ i ] ; if ( m . ContainsKey ( p ) ) { m [ p ] ++ ; } else { m [ p ] = 1 ; } } string new_string = " " ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ( m [ s [ i ] ] & 1 ) == 1 ) continue ; new_string += s [ i ] ; } return new_string ; } public static void Main ( string [ ] args ) { string str = " geeksforgeeks " ; str = removeOddFrequencyCharacters ( str ) ; Console . Write ( str ) ; } }

Index/key variables: i, p
Accumulator variables: i, new_string
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int i ; static int productAtKthLevel ( String tree , int k , int level ) { if ( tree [ i ++ ] == ' ( ' ) { if ( tree [ i ] == ' ) ' ) return 1 ; int product = 1 ; if ( level == k ) product = tree [ i ] - '0' ; ++ i ; int leftproduct = productAtKthLevel ( tree , k , level + 1 ) ; ++ i ; int rightproduct = productAtKthLevel ( tree , k , level + 1 ) ; ++ i ; return product * leftproduct * rightproduct ; } return int . MinValue ; } public static void Main ( String [ ] args ) { String tree = " ( 0(5(6 ( ) ( ) ) ( 4 ( ) " + " ( 9 ( ) ( ) ) ) ) ( 7(1 ( ) ( ) ) ( 3 ( ) ( ) ) ) ) " ; int k = 2 ; i = 0 ; Console . Write ( productAtKthLevel ( tree , k , 0 ) ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMostOccurringChar ( string [ ] str ) { int [ ] hash = new int [ 26 ] ; for ( int i = 0 ; i < str . Length ; i ++ ) { for ( int j = 0 ; j < str [ i ] . Length ; j ++ ) { hash [ str [ i ] [ j ] - 97 ] ++ ; } } int max = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { max = hash [ i ] > hash [ max ] ? i : max ; } Console . Write ( ( char ) ( max + 97 ) + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { string [ ] str = { " animal " , " zebra " , " lion " , " giraffe " } ; findMostOccurringChar ( str ) ; } }

Index/key variables: i, j, max
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isPalindrome ( float num ) { string s = num . ToString ( ) ; int low = 0 ; int high = s . Length - 1 ; while ( low < high ) { if ( s [ low ] != s [ high ] ) return false ; low ++ ; high -- ; } return true ; } public static void Main ( ) { float n = 123.321f ; if ( isPalindrome ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: high, low
Accumulator variables: high, low
Class/struct names: GFG
C# program:
using System ; class GFG { readonly static int MAX = 26 ; static int maxSubStr ( char [ ] str1 , int len1 , char [ ] str2 , int len2 ) { if ( len1 > len2 ) return 0 ; int [ ] freq1 = new int [ MAX ] ; for ( int i = 0 ; i < len1 ; i ++ ) freq1 [ i ] = 0 ; for ( int i = 0 ; i < len1 ; i ++ ) freq1 [ str1 [ i ] - ' a ' ] ++ ; int [ ] freq2 = new int [ MAX ] ; for ( int i = 0 ; i < len2 ; i ++ ) freq2 [ i ] = 0 ; for ( int i = 0 ; i < len2 ; i ++ ) freq2 [ str2 [ i ] - ' a ' ] ++ ; int minPoss = int . MaxValue ; for ( int i = 0 ; i < MAX ; i ++ ) { if ( freq1 [ i ] == 0 ) continue ; if ( freq1 [ i ] > freq2 [ i ] ) return 0 ; minPoss = Math . Min ( minPoss , freq2 [ i ] / freq1 [ i ] ) ; } return minPoss ; } public static void Main ( String [ ] args ) { String str1 = " geeks " , str2 = " gskefrgoekees " ; int len1 = str1 . Length ; int len2 = str2 . Length ; Console . WriteLine ( maxSubStr ( str1 . ToCharArray ( ) , len1 , str2 . ToCharArray ( ) , len2 ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int cntWays ( String str , int n ) { int x = n + 1 ; int ways = x * x * ( x * x - 1 ) / 12 ; return ways ; } public static void Main ( String [ ] args ) { String str = " ab " ; int n = str . Length ; Console . WriteLine ( cntWays ( str , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static HashSet < String > uSet = new HashSet < String > ( ) ; static int minCnt = int . MaxValue ; static void findSubStr ( String str , int cnt , int start ) { if ( start == str . Length ) { minCnt = Math . Min ( cnt , minCnt ) ; } for ( int len = 1 ; len <= ( str . Length - start ) ; len ++ ) { String subStr = str . Substring ( start , len ) ; if ( uSet . Contains ( subStr ) ) { findSubStr ( str , cnt + 1 , start + len ) ; } } } static void findMinSubStr ( String [ ] arr , int n , String str ) { for ( int i = 0 ; i < n ; i ++ ) uSet . Add ( arr [ i ] ) ; findSubStr ( str , 0 , 0 ) ; } public static void Main ( String [ ] args ) { String str = "123456" ; String [ ] arr = { "1" , "12345" , "2345" , "56" , "23" , "456" } ; int n = arr . Length ; findMinSubStr ( arr , n , str ) ; Console . WriteLine ( minCnt ) ; } }

Index/key variables: i
Accumulator variables: i, len
Iterator variables: i, len
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countSubStr ( String s , int n ) { int c1 = 0 , c2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i < n - 5 && " geeks " . Equals ( s . Substring ( i , 5 ) ) ) { c1 ++ ; } if ( i < n - 3 && " for " . Equals ( s . Substring ( i , 3 ) ) ) { c2 = c2 + c1 ; } } return c2 ; } public static void Main ( String [ ] args ) { String s = " geeksforgeeksisforgeeks " ; int n = s . Length ; Console . WriteLine ( countSubStr ( s , n ) ) ; } }

Accumulator variables: c1, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void Main ( ) { string String = " { [ ( ) ] } [ ] " ; char [ ] lst1 = { ' { ' , ' ( ' , ' [ ' } ; char [ ] lst2 = { ' } ' , ' ) ' , ' ] ' } ; List < char > lst = new List < char > ( ) ; Dictionary < char , char > Dict = new Dictionary < char , char > ( ) ; Dict [ ' ) ' ] = ' ( ' ; Dict [ ' } ' ] = ' { ' ; Dict [ ' ] ' ] = ' [ ' ; int a = 0 , b = 0 , c = 0 ; if ( Array . Exists ( lst2 , element => element == String [ 0 ] ) ) { Console . WriteLine ( 1 ) ; } else { int k = 0 ; for ( int i = 0 ; i < String . Length ; i ++ ) { if ( Array . Exists ( lst1 , element => element == String [ i ] ) ) { lst . Add ( String [ i ] ) ; k = i + 2 ; } else { if ( lst . Count == 0 && Array . Exists ( lst2 , element => element == String [ i ] ) ) { Console . WriteLine ( ( i + 1 ) ) ; c = 1 ; break ; } else { if ( lst . Count > 0 && Dict [ String [ i ] ] == lst [ lst . Count - 1 ] ) { lst . RemoveAt ( lst . Count - 1 ) ; } else { a = 1 ; break ; } } } } if ( lst . Count == 0 && c == 0 ) { Console . WriteLine ( 0 ) ; b = 1 ; } if ( a == 0 && b == 0 && c == 0 ) { Console . WriteLine ( k ) ; } } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 26 ; public static char [ ] encryptStr ( String str , int n , int x ) { x = x % MAX ; char [ ] arr = str . ToCharArray ( ) ; int [ ] freq = new int [ MAX ] ; for ( int i = 0 ; i < n ; i ++ ) freq [ arr [ i ] - ' a ' ] ++ ; for ( int i = 0 ; i < n ; i ++ ) { if ( freq [ arr [ i ] - ' a ' ] % 2 == 0 ) { int pos = ( arr [ i ] - ' a ' + x ) % MAX ; arr [ i ] = ( char ) ( pos + ' a ' ) ; } else { int pos = ( arr [ i ] - ' a ' - x ) ; if ( pos < 0 ) pos += MAX ; arr [ i ] = ( char ) ( pos + ' a ' ) ; } } return arr ; } public static void Main ( String [ ] args ) { String s = " abcda " ; int n = s . Length ; int x = 3 ; Console . WriteLine ( encryptStr ( s , n , x ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: i, pos
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static Boolean isPossible ( char [ ] str ) { Dictionary < char , int > freq = new Dictionary < char , int > ( ) ; int max_freq = 0 ; for ( int j = 0 ; j < ( str . Length ) ; j ++ ) { if ( freq . ContainsKey ( str [ j ] ) ) { var v = freq [ str [ j ] ] + 1 ; freq . Remove ( str [ j ] ) ; freq . Add ( str [ j ] , v ) ; if ( freq [ str [ j ] ] > max_freq ) max_freq = freq [ str [ j ] ] ; } else { freq . Add ( str [ j ] , 1 ) ; if ( freq [ str [ j ] ] > max_freq ) max_freq = freq [ str [ j ] ] ; } } if ( max_freq <= ( str . Length - max_freq + 1 ) ) return true ; return false ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; if ( isPossible ( str . ToCharArray ( ) ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: j
Accumulator variables: j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { static void printUncommon ( string str1 , string str2 ) { int a1 = 0 , a2 = 0 ; for ( int i = 0 ; i < str1 . Length ; i ++ ) { int ch = ( str1 [ i ] - ' a ' ) ; a1 = a1 | ( 1 << ch ) ; } for ( int i = 0 ; i < str2 . Length ; i ++ ) { int ch = ( str2 [ i ] - ' a ' ) ; a2 = a2 | ( 1 << ch ) ; } int ans = a1 ^ a2 ; int j = 0 ; while ( j < 26 ) { if ( ans % 2 == 1 ) { Console . Write ( ( char ) ( ' a ' + j ) ) ; } ans = ans / 2 ; j ++ ; } } public static void Main ( ) { string str1 = " geeksforgeeks " ; string str2 = " geeksquiz " ; printUncommon ( str1 , str2 ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countMinReversals ( String expr ) { int len = expr . Length ; if ( len % 2 != 0 ) return - 1 ; int ans = 0 ; int i ; int open = 0 ; int close = 0 ; for ( i = 0 ; i < len ; i ++ ) { if ( expr [ i ] == ' { ' ) open ++ ; else { if ( open == 0 ) close ++ ; else open -- ; } } ans = ( close / 2 ) + ( open / 2 ) ; close %= 2 ; open %= 2 ; if ( close != 0 ) ans += 2 ; return ans ; } public static void Main ( String [ ] args ) { String expr = " } } { { " ; Console . WriteLine ( countMinReversals ( expr ) ) ; } }

Index/key variables: i
Accumulator variables: ans, close, i, open
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GfG { static int totalPairs ( String s1 , String s2 ) { int a1 = 0 , b1 = 0 ; for ( int i = 0 ; i < s1 . Length ; i ++ ) { if ( ( int ) s1 [ i ] % 2 != 0 ) a1 ++ ; else b1 ++ ; } int a2 = 0 , b2 = 0 ; for ( int i = 0 ; i < s2 . Length ; i ++ ) { if ( ( int ) s2 [ i ] % 2 != 0 ) a2 ++ ; else b2 ++ ; } return ( ( a1 * a2 ) + ( b1 * b2 ) ) ; } public static void Main ( String [ ] args ) { String s1 = " geeks " , s2 = " for " ; Console . WriteLine ( totalPairs ( s1 , s2 ) ) ; } }

Index/key variables: i
Accumulator variables: a1, a2, b1, b2, i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { static int prefixOccurrences ( string str ) { char c = str [ 0 ] ; int countc = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] == c ) countc ++ ; } return countc ; } public static void Main ( ) { string str = " abbcdabbcd " ; Console . WriteLine ( prefixOccurrences ( str ) ) ; } }

Index/key variables: i
Accumulator variables: countc, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minOperations ( string s , string t , int n ) { int ct0 = 0 , ct1 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] == t [ i ] ) continue ; if ( s [ i ] == '0' ) ct0 ++ ; else ct1 ++ ; } return Math . Max ( ct0 , ct1 ) ; } public static void Main ( ) { string s = "010" , t = "101" ; int n = s . Length ; Console . Write ( minOperations ( s , t , n ) ) ; } }

Index/key variables: i
Accumulator variables: ct0, ct1, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static string decryptString ( string str , int n ) { int i = 0 , jump = 1 ; string decryptedStr = " " ; while ( i < n ) { decryptedStr += str [ i ] ; i += jump ; jump ++ ; } return decryptedStr ; } public static void Main ( ) { string str = " geeeeekkkksssss " ; int n = str . Length ; Console . Write ( decryptString ( str , n ) ) ; } }

Index/key variables: i
Accumulator variables: decryptedStr, i, jump
Class/struct names: GFG
C# program:
using System ; class GfG { static char bitToBeFlipped ( String s ) { char last = s [ s . Length - 1 ] ; char first = s [ 0 ] ; if ( last == first ) { if ( last == '0' ) { return '1' ; } else { return '0' ; } } else if ( last != first ) { return last ; } return last ; } public static void Main ( ) { string s = "1101011000" ; Console . WriteLine ( bitToBeFlipped ( s ) ) ; } }

Class/struct names: GfG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void SieveOfEratosthenes ( bool [ ] prime , int p_size ) { prime [ 0 ] = false ; prime [ 1 ] = false ; for ( int p = 2 ; p * p <= p_size ; p ++ ) { if ( prime [ p ] ) { for ( int i = p * 2 ; i < p_size ; i += p ) { prime [ i ] = false ; } } } } static void sumProdOfPrimeFreq ( char [ ] s ) { int i ; bool [ ] prime = new bool [ s . Length + 1 ] ; for ( i = 0 ; i < s . Length + 1 ; i ++ ) { prime [ i ] = true ; } SieveOfEratosthenes ( prime , s . Length + 1 ) ; Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( i = 0 ; i < s . Length ; i ++ ) { if ( mp . ContainsKey ( s [ i ] ) ) { var val = mp [ s [ i ] ] ; mp . Remove ( s [ i ] ) ; mp . Add ( s [ i ] , val + 1 ) ; } else { mp . Add ( s [ i ] , 1 ) ; } } int sum = 0 , product = 1 ; foreach ( KeyValuePair < char , int > it in mp ) { if ( prime [ it . Value ] ) { sum += it . Value ; product *= it . Value ; } } Console . Write ( " Sum ▁ = ▁ " + sum ) ; Console . WriteLine ( " Product = " } public static void Main ( String [ ] args ) { String s = " geeksforgeeks " ; sumProdOfPrimeFreq ( s . ToCharArray ( ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, product, sum
Iterator variables: i, it, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static Boolean multipleOrFactor ( String s1 , String s2 ) { Dictionary < char , int > m1 = new Dictionary < char , int > ( ) ; Dictionary < char , int > m2 = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s1 . Length ; i ++ ) { if ( m1 . ContainsKey ( s1 [ i ] ) ) { var x = m1 [ s1 [ i ] ] ; m1 [ s1 [ i ] ] = ++ x ; } else m1 . Add ( s1 [ i ] , 1 ) ; } for ( int i = 0 ; i < s2 . Length ; i ++ ) { if ( m2 . ContainsKey ( s2 [ i ] ) ) { var x = m2 [ s2 [ i ] ] ; m2 [ s2 [ i ] ] = ++ x ; } else m2 . Add ( s2 [ i ] , 1 ) ; } foreach ( KeyValuePair < char , int > entry in m1 ) { if ( ! m2 . ContainsKey ( entry . Key ) ) continue ; if ( m2 [ entry . Key ] != 0 && ( m2 [ entry . Key ] % entry . Value == 0 entry . Value % m2 [ entry . Key ] == 0 ) ) continue ; else return false ; } return true ; } public static void Main ( String [ ] args ) { String s1 = " geeksforgeeks " , s2 = " geeks " ; if ( multipleOrFactor ( s1 , s2 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: entry, i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void solve ( String s ) { Dictionary < char , int > m = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( m . ContainsKey ( s [ i ] ) ) { var val = m [ s [ i ] ] ; m . Remove ( s [ i ] ) ; m . Add ( s [ i ] , val + 1 ) ; } else m . Add ( s [ i ] , 1 ) ; } String new_string = " " ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( m [ s [ i ] ] % 2 == 0 ) continue ; new_string = new_string + s [ i ] ; } Console . WriteLine ( new_string ) ; } public static void Main ( String [ ] args ) { String s = " aabbbddeeecc " ; solve ( s ) ; } }

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