dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static String solution ( string s ) { List < char > vowel = new List < char > ( ) ; List < char > consonant = new List < char > ( ) ; foreach ( char i in s . ToCharArray ( ) ) { if ( i == ' a ' i == ' e ' i == ' i ' i == ' o ' i == ' u ' ) { vowel . Add ( i ) ; } else { consonant . Add ( i ) ; } } int Nc , Nv ; Nv = vowel . Count ; Nc = consonant . Count ; int M = Nc / ( Nv - 1 ) ; string ans = " " ; int consotnant_till = 0 ; foreach ( char i in vowel ) { ans += i ; int temp = 0 ; for ( int j = consotnant_till ; j < Math . Min ( Nc , consotnant_till + M ) ; j ++ ) { ans += consonant [ j ] ; temp ++ ; } consotnant_till += temp ; } return ans ; } static public void Main ( ) { String str = " aaaabbbcc " ; Console . WriteLine ( solution ( str ) ) ; } }

Index/key variables: j
Accumulator variables: ans, consotnant_till, j, temp
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void smallestlexicographicstring ( char [ ] s , int k ) { int n = s . Length ; if ( k >= n ) { for ( int i = 0 ; i < n ; i ++ ) { s [ i ] = ' a ' ; } Console . Write ( s ) ; return ; } for ( int i = 0 ; i < n ; i ++ ) { if ( k == 0 ) { break ; } if ( s [ i ] == ' a ' ) continue ; for ( int j = i + 1 ; j < n ; j ++ ) { if ( s [ j ] > s [ i ] ) { s [ j ] = s [ i ] ; break ; } else if ( j == n - 1 ) s [ j ] = s [ i ] ; } s [ i ] = ' a ' ; k -- ; } Console . Write ( s ) ; } static void Main ( ) { char [ ] s = ( " geeksforgeeks " ) . ToCharArray ( ) ; int k = 6 ; smallestlexicographicstring ( s , k ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, k
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void canReduceString ( String S , int N ) { int count_1 = 0 ; int count_2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( S [ i ] == ' ( ' ) { count_1 ++ ; } else { count_2 ++ ; } } if ( count_1 == 0 count_2 == 0 ) { Console . Write ( " - 1" + " STRNEWLINE " ) ; } else if ( count_1 == count_2 ) { Console . Write ( "0" + " STRNEWLINE " ) ; } else if ( N % 2 != 0 ) { Console . Write ( " - 1" ) ; } else { Console . Write ( Math . Abs ( count_1 - count_2 ) / 2 ) ; } } public static void Main ( String [ ] args ) { String S = " ) ) ) ( ( ( " ; int N = S . Length ; canReduceString ( S , N ) ; } }

Index/key variables: i
Accumulator variables: count_1, count_2, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void isAcceptedDFA ( String s , int N ) { int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( s [ i ] == ' a ' ) count ++ ; } if ( count == N && count != 0 ) { Console . Write ( " Accepted " ) ; } else { Console . Write ( " Not ▁ Accepted " ) ; } } public static void Main ( String [ ] args ) { String S = " aaaaa " ; isAcceptedDFA ( S , S . Length ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void maximum_pallindromic ( int [ ] arr ) { int res = 0 ; int c1 = 0 , c2 = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { res += arr [ i ] / 3 ; arr [ i ] = arr [ i ] % 3 ; if ( arr [ i ] == 1 ) c1 ++ ; else if ( arr [ i ] == 2 ) c2 ++ ; } res += Math . Min ( c1 , c2 ) ; int t = Math . Min ( c1 , c2 ) ; c1 -= t ; c2 -= t ; res += 2 * ( c2 / 3 ) ; c2 %= 3 ; res += c2 / 2 ; Console . Write ( res ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; maximum_pallindromic ( arr ) ; } }

Index/key variables: i
Accumulator variables: c1, c2, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void find_Winner ( String [ ] arr , int N ) { List < char > [ ] Q = new List < char > [ N ] ; for ( int i = 0 ; i < Q . Length ; i ++ ) Q [ i ] = new List < char > ( ) ; int M = arr . Length ; for ( int i = 0 ; i < M ; i ++ ) { int len = arr [ i ] . Length ; for ( int j = 0 ; j < len ; j ++ ) { Q [ i ] . Add ( arr [ i ] [ j ] ) ; } } int player = 0 ; while ( Q [ player ] . Count > 0 ) { int nextPlayer = Q [ player ] [ 0 ] - '0' - 1 ; Q [ player ] . RemoveAt ( 0 ) ; player = nextPlayer ; } Console . Write ( " Player ▁ " + ( player + 1 ) ) ; } public static void Main ( String [ ] args ) { int N = 3 ; String [ ] arr = { "323" , "2" , "2" } ; find_Winner ( arr , N ) ; } }

Index/key variables: N, i, j, player
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static int longestSubstring ( string s ) { int [ ] dp = new int [ 1024 ] ; for ( int i = 0 ; i < 1024 ; ++ i ) { dp [ i ] = s . Length ; } int res = 0 , mask = 0 ; dp [ 0 ] = - 1 ; for ( int i = 0 ; i < s . Length ; i ++ ) { mask = mask ^ ( 1 << ( s [ i ] - '0' ) ) ; res = Math . Max ( res , i - dp [ mask ] ) ; for ( int j = 0 ; j < 10 ; j ++ ) { res = Math . Max ( res , i - dp [ mask ^ ( 1 << j ) ] ) ; } dp [ mask ] = Math . Min ( dp [ mask ] , i ) ; } return res ; } public static void Main ( string [ ] args ) { string s = "3242415" ; Console . WriteLine ( longestSubstring ( s ) ) ; } }

Index/key variables: i, mask
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void Validate ( string M ) { int len = M . Length ; string temp = " " ; for ( int i = 0 ; i < len ; i ++ ) { if ( Char . IsDigit ( M [ i ] ) ) temp += M [ i ] ; } int nwlen = temp . Length ; if ( nwlen != 10 ) { Console . Write ( " Invalid STRNEWLINE " ) ; return ; } string res = " " ; string x = temp . Substring ( 0 , 3 ) ; res += " ( " + x + " ) - " ; x = temp . Substring ( 3 , 3 ) ; res += " ( " + x + " ) - " ; x = temp . Substring ( 6 , 3 ) ; res += " ( " + x + " ) - " ; x = temp . Substring ( 9 , 1 ) ; res += " ( " + x + " ) " ; Console . WriteLine ( res ) ; } public static void Main ( string [ ] args ) { string M = "91 ▁ 234rt5%34*0 ▁ 3" ; Validate ( M ) ; } }

Index/key variables: i
Accumulator variables: i, res, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void hexaModK ( String N , String k ) { Dictionary < char , int > map = new Dictionary < char , int > ( ) ; for ( char i = '0' ; i <= '9' ; i ++ ) { map . Add ( i , i - '0' ) ; } map . Add ( ' A ' , 10 ) ; map . Add ( ' B ' , 11 ) ; map . Add ( ' C ' , 12 ) ; map . Add ( ' D ' , 13 ) ; map . Add ( ' E ' , 14 ) ; map . Add ( ' F ' , 15 ) ; long m = long . Parse ( k ) ; long Base = 1 ; long ans = 0 ; for ( int i = N . Length - 1 ; i >= 0 ; i -- ) { long n = map [ N [ i ] ] % m ; ans = ( ans + ( Base % m * n % m ) % m ) % m ; Base = ( Base % m * 16 % m ) % m ; } Console . WriteLine ( ans . ToString ( " X " ) ) ; } public static void Main ( String [ ] args ) { String n = "3E8" ; String k = "13" ; hexaModK ( n , 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 { static String combination = " " ; static SortedSet < String > combinations = new SortedSet < String > ( ) ; static void printSequences ( SortedSet < String > combinations ) { foreach ( String s in combinations ) { Console . Write ( s + " ▁ " ) ; } } static void generateCombinations ( String s , int n ) { for ( int i = 0 ; i < s . Length ; i ++ ) { combination += ( s [ i ] ) ; long x = Int32 . Parse ( combination ) ; if ( x <= n ) { combinations . Add ( combination ) ; generateCombinations ( s , n ) ; } combination = combination . Substring ( 0 , combination . Length - 1 ) ; } } public static void Main ( String [ ] args ) { String S = "124" ; int N = 100 ; generateCombinations ( S , N ) ; printSequences ( combinations ) ; } }

Index/key variables: i
Accumulator variables: combination, i
Iterator variables: i, s
Class/struct names: GFG
C# program:
using System ; class GFG { static int compute_hash ( string str ) { int p = 31 ; int MOD = ( int ) 1e9 + 7 ; int hash_val = 0 ; int mul = 1 ; for ( int i = 0 ; i < str . Length ; i ++ ) { char ch = str [ i ] ; hash_val = ( hash_val + ( ch - ' a ' + 1 ) * mul ) % MOD ; mul = ( mul * p ) % MOD ; } return hash_val ; } static int distinct_str ( string [ ] arr , int n ) { int [ ] hash = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { hash [ i ] = compute_hash ( arr [ i ] ) ; } Array . Sort ( hash ) ; int cntElem = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( hash [ i ] != hash [ i - 1 ] ) { cntElem ++ ; } } return cntElem ; } public static void Main ( String [ ] args ) { string [ ] arr = { " abcde " , " abcce " , " abcdf " , " abcde " } ; int N = arr . Length ; Console . WriteLine ( distinct_str ( arr , N ) ) ; } }

Index/key variables: i, n
Accumulator variables: cntElem, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void SieveOfEratosthenes ( bool [ ] prime , int n ) { for ( int i = 0 ; i <= n ; i ++ ) { prime [ i ] = true ; } prime [ 0 ] = prime [ 1 ] = false ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( prime [ i ] == true ) { for ( int j = 2 ; i * j <= n ; j ++ ) { prime [ i * j ] = false ; } } } } static void removePrimeFrequencies ( char [ ] s ) { int n = s . Length ; bool [ ] prime = new bool [ n + 1 ] ; SieveOfEratosthenes ( prime , n ) ; Dictionary < char , int > m = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( m . ContainsKey ( s [ i ] ) ) { m [ s [ i ] ] ++ ; } else { m . Add ( s [ i ] , 1 ) ; } } String new_String = " " ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( prime [ m [ s [ i ] ] ] ) continue ; new_String += s [ i ] ; } Console . Write ( new_String ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; removePrimeFrequencies ( str . ToCharArray ( ) ) ; } }

Index/key variables: i
Accumulator variables: i, j, new_String
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static String rearrange ( String s ) { String s1 = " " , s2 = " " , ans = " " ; char [ ] s3 = s . ToCharArray ( ) ; foreach ( char x in s3 ) { if ( x >= ' a ' && x <= ' z ' ) s1 += x ; else s2 += x ; } int n = s1 . Length ; int m = s2 . Length ; if ( Math . Abs ( n - m ) > 1 ) return " - 1" ; int i = 0 , j = 0 , k = 0 ; int flag = ( n >= m ) ? 1 : 0 ; while ( i < n && j < m ) { if ( flag != 0 ) ans += s1 [ i ++ ] ; else ans += s2 [ j ++ ] ; if ( flag == 1 ) flag = 0 ; else flag = 1 ; } return ans ; } public static void Main ( String [ ] args ) { String str = " geeks2020" ; Console . Write ( rearrange ( str ) + " STRNEWLINE " ) ; } }

Accumulator variables: ans, i, j, s1, s2
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; class GFG { static void charactersCount ( String str , int n ) { int count = 0 ; while ( n > 0 ) { char cur = str [ 0 ] ; int ind = 0 ; for ( int j = 1 ; j < n ; j ++ ) { if ( str [ j ] < cur ) { cur = str [ j ] ; ind = j ; } } str = str . Substring ( 0 , ind ) + str . Substring ( ind + 1 ) ; n -- ; count += ind + 1 ; } Console . Write ( count + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String str = " aabbc " ; int n = 5 ; charactersCount ( str , n ) ; } }

Index/key variables: j
Accumulator variables: count, j, n
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void printMiddlechar ( String str ) { int len = str . Length ; int middle = len / 2 ; Console . WriteLine ( str [ middle ] ) ; } public static void Main ( String [ ] args ) { String str = " GeeksForGeeks " ; printMiddlechar ( str ) ; } }

Index/key variables: middle
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; using System . Text ; class GFG { static bool check ( string s ) { HashSet < char > a = new HashSet < char > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( a . Contains ( s [ i ] ) ) { return false ; } a . Add ( s [ i ] ) ; } return true ; } static ArrayList helper ( ArrayList arr , int ind ) { if ( ind == arr . Count ) return new ArrayList ( ) { " " } ; ArrayList tmp = helper ( arr , ind + 1 ) ; ArrayList ret = new ArrayList ( tmp ) ; for ( int i = 0 ; i < tmp . Count ; i ++ ) { string test = ( string ) tmp [ i ] + ( string ) arr [ ind ] ; if ( check ( test ) ) ret . Add ( test ) ; } return ret ; } static int maxLength ( ArrayList arr ) { ArrayList tmp = helper ( arr , 0 ) ; int len = 0 ; for ( int i = 0 ; i < tmp . Count ; i ++ ) { len = len > ( ( string ) tmp [ i ] ) . Length ? len : ( ( string ) tmp [ i ] ) . Length ; } return len ; } public static void Main ( string [ ] args ) { ArrayList s = new ArrayList ( ) ; s . Add ( " abcdefgh " ) ; Console . Write ( maxLength ( s ) ) ; } }

Index/key variables: i, ind
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static void Range_sum_query ( String S , List < pair > Query ) { int N = S . Length ; int [ ] A = new int [ N ] ; A [ 0 ] = S [ 0 ] - ' a ' + 1 ; for ( int i = 1 ; i < N ; i ++ ) { A [ i ] = S [ i ] - ' a ' + 1 ; A [ i ] = A [ i ] + A [ i - 1 ] ; } for ( int i = 0 ; i < Query . Count ; i ++ ) { if ( Query [ i ] . first == 1 ) { Console . Write ( A [ ( Query [ i ] . second ) - 1 ] + " STRNEWLINE " ) ; } else { Console . Write ( A [ ( Query [ i ] . second ) - 1 ] - A [ ( Query [ i ] . first ) - 2 ] + " STRNEWLINE " ) ; } } } public static void Main ( String [ ] args ) { String S = " abcd " ; List < pair > Query = new List < pair > ( ) ; Query . Add ( new pair ( 2 , 4 ) ) ; Query . Add ( new pair ( 1 , 3 ) ) ; Range_sum_query ( S , Query ) ; } }

Index/key variables: N, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static void swap_ ( char [ ] a , int l , int i ) { char temp ; temp = a [ l ] ; a [ l ] = a [ i ] ; a [ i ] = temp ; } static void permute ( char [ ] str , int l , int r , int n ) { int i ; if ( l == r ) { int j = Int32 . Parse ( new string ( str ) ) ; if ( j % n == 0 ) Console . Write ( new string ( str ) + " STRNEWLINE " ) ; return ; } for ( i = l ; i < r ; i ++ ) { swap_ ( str , l , i ) ; permute ( str , l + 1 , r , n ) ; swap_ ( str , l , i ) ; } } public static void Main ( string [ ] args ) { string str = "125" ; int n = 5 ; int len = str . Length ; if ( len > 0 ) permute ( str . ToCharArray ( ) , 0 , len , n ) ; } }

Index/key variables: i, l
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String decimalToBinary ( int N ) { String ans = " " ; while ( N > 0 ) { if ( N % 2 == 1 ) { ans = '1' + ans ; } else { ans = '0' + ans ; } N /= 2 ; } return ans ; } static String checkBinaryString ( String str , int N ) { int [ ] map = new int [ N + 10 ] ; int cnt = 0 ; for ( int i = N ; i > 0 ; i -- ) { if ( map [ i ] == 0 ) { int t = i ; String s = decimalToBinary ( t ) ; if ( str . Contains ( s ) ) { while ( t > 0 && map [ t ] == 0 ) { map [ t ] = 1 ; cnt ++ ; t >>= 1 ; } } } } for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] == '0' ) { cnt ++ ; break ; } } if ( cnt == N + 1 ) return " True " ; else return " False " ; } public static void Main ( String [ ] args ) { String str = "0110" ; int N = 3 ; Console . Write ( checkBinaryString ( str , N ) ) ; } }

Index/key variables: i, t
Accumulator variables: N, cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { private static String largestAnagramGrp ( String [ ] arr ) { int [ ] prime = { 2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 , 41 , 43 , 47 , 53 , 59 , 61 , 67 , 71 , 73 , 79 , 83 , 89 , 97 , 101 } ; int max = - 1 ; long maxpdt = - 1 ; Dictionary < long , String > W = new Dictionary < long , String > ( ) ; Dictionary < long , int > P = new Dictionary < long , int > ( ) ; foreach ( String temp in arr ) { char [ ] c = temp . ToCharArray ( ) ; long pdt = 1 ; foreach ( char t in c ) { pdt *= prime [ t - ' a ' ] ; } if ( P . ContainsKey ( pdt ) ) { P [ pdt ] = P [ pdt ] + 1 ; } else { W . Add ( pdt , temp ) ; P . Add ( pdt , 1 ) ; } } foreach ( KeyValuePair < long , int > e in P ) { if ( max < e . Value ) { max = e . Value ; maxpdt = e . Key ; } } return W [ maxpdt ] ; } public static void Main ( String [ ] args ) { String S = " please ▁ be ▁ silent ▁ and ▁ listen " + " ▁ to ▁ what ▁ the ▁ professor ▁ says ▁ " ; String [ ] arr = S . Split ( ' ▁ ' ) ; Console . WriteLine ( largestAnagramGrp ( arr ) ) ; } }

Index/key variables: maxpdt, pdt
Accumulator variables: pdt
Iterator variables: e, t, temp
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static String print_next_vovel_String ( char [ ] str ) { Dictionary < char , int > m = new Dictionary < char , int > ( ) ; m . Add ( ' a ' , 0 ) ; m . Add ( ' e ' , 1 ) ; m . Add ( ' i ' , 2 ) ; m . Add ( ' o ' , 3 ) ; m . Add ( ' u ' , 4 ) ; char [ ] arr = { ' a ' , ' e ' , ' i ' , ' o ' , ' u ' } ; int N = str . Length ; for ( int i = 0 ; i < N ; i ++ ) { char c = str [ i ] ; if ( c == ' a ' c == ' e ' c == ' i ' c == ' o ' c == ' u ' ) { int index = m + 1 ; int newindex = index % 5 ; str [ i ] = arr [ newindex ] ; } } return String . Join ( " " , str ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; Console . Write ( print_next_vovel_String ( str . ToCharArray ( ) ) ) ; } }

Index/key variables: i, newindex
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPalindrome ( String str ) { int len = str . Length ; for ( int i = 0 ; i < len ; i ++ ) { if ( str [ i ] != str [ len - i - 1 ] ) return false ; } return true ; } static bool isCompressablePalindrome ( String str ) { int len = str . Length ; String compressed = " " ; compressed = String . Join ( " " , str [ 0 ] ) ; for ( int i = 1 ; i < len ; i ++ ) { if ( str [ i ] != str [ i - 1 ] ) compressed += str [ i ] ; } return isPalindrome ( compressed ) ; } public static void Main ( String [ ] args ) { String str = " abbcbbbaaa " ; if ( isCompressablePalindrome ( str ) ) Console . Write ( " Yes STRNEWLINE " ) ; else Console . Write ( " No STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: compressed, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isvowel ( char x ) { return ( x == ' a ' x == ' e ' x == ' i ' x == ' o ' x == ' u ' ) ; } static int CountTotal ( string str ) { int ans = 0 ; int n = str . Length ; char [ ] s = str . ToCharArray ( ) ; int cnt = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isvowel ( s [ i ] ) ) cnt += 1 ; else { ans += ( cnt * ( cnt + 1 ) / 2 ) ; cnt = 0 ; } } if ( cnt != 0 ) ans += ( cnt * ( cnt + 1 ) / 2 ) ; return ans ; } static public void Main ( string [ ] args ) { string s = " geeksforgeeks " ; Console . Write ( CountTotal ( s ) ) ; } }

Index/key variables: i
Accumulator variables: ans, cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int totCount ; static int firstCount ; static void getTotCount ( int num ) { totCount = 1 ; firstCount = 1 ; int temp = 1 ; while ( ( num & temp ) == 0 ) { temp = temp << 1 ; totCount += 1 ; } firstCount = totCount ; temp = num >> totCount ; while ( temp != 0 ) { totCount += 1 ; temp = temp >> 1 ; } } static int flipBitsFromRightMostSetBit ( int num ) { getTotCount ( num ) ; int num1 = num ^ ( ( 1 << totCount ) - 1 ) ; num1 = num1 ^ ( ( 1 << firstCount ) - 1 ) ; return num1 ; } public static void Main ( string [ ] args ) { int n = 120 ; Console . Write ( flipBitsFromRightMostSetBit ( n ) ) ; } }

Accumulator variables: totCount
Class/struct names: GFG
C# program:
using System ; public class GFG { public static bool isVowel ( char x ) { return ( x == ' a ' x == ' e ' x == ' i ' x == ' o ' x == ' u ' ) ; } public static int findMaxLen ( string s ) { int maxLen = 0 ; int cur ; if ( isVowel ( s [ 0 ] ) ) maxLen = 1 ; cur = maxLen ; for ( int i = 1 ; i < s . Length ; i ++ ) { if ( isVowel ( s [ i ] ) ) { if ( s [ i ] != s [ i - 1 ] ) cur += 1 ; else cur = 1 ; } else { cur = 0 ; } maxLen = Math . Max ( cur , maxLen ) ; } return maxLen ; } public static void Main ( string [ ] args ) { string Str = " aeoibsddaeiouudb " ; Console . WriteLine ( findMaxLen ( Str ) ) ; } }

Index/key variables: i
Accumulator variables: cur, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long power ( long Base , long pow ) { long res = 1 ; while ( pow > 0 ) { if ( ( pow & 1 ) == 1 ) res = ( res * Base ) ; Base = ( Base * Base ) ; pow >>= 1 ; } return res ; } static long countNonPalindromicString ( long n , long m ) { long total = power ( n , m ) ; long palindrome = power ( n , m / 2 + m % 2 ) ; long count = total - palindrome ; return count ; } public static void Main ( String [ ] args ) { int n = 3 , m = 5 ; Console . WriteLine ( countNonPalindromicString ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] freq = new int [ 26 ] ; static bool checkPalindrome ( ) { int oddCnt = 0 ; foreach ( int x in freq ) { if ( x % 2 == 1 ) oddCnt ++ ; } return oddCnt <= 1 ; } static int countPalindromePermutation ( char [ ] s , int k ) { int i = 0 ; for ( i = 0 ; i < k ; i ++ ) { freq [ s [ i ] - 97 ] ++ ; } int ans = 0 ; if ( checkPalindrome ( ) ) { ans ++ ; } int j = k ; i = 0 ; while ( j < s . Length ) { freq [ s [ i ++ ] - 97 ] -- ; freq [ s [ j ++ ] - 97 ] ++ ; if ( checkPalindrome ( ) ) { ans ++ ; } } return ans ; } public static void Main ( String [ ] args ) { String str = " abbaca " ; int K = 3 ; Console . Write ( countPalindromePermutation ( str . ToCharArray ( ) , K ) + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: ans, i, j, oddCnt
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { public static int minFlips ( String target ) { char curr = '1' ; int count = 0 ; for ( int i = 0 ; i < target . Length ; i ++ ) { if ( target [ i ] == curr ) { count ++ ; curr = ( char ) ( 48 + ( curr + 1 ) % 2 ) ; } } return count ; } public static void Main ( String [ ] args ) { String S = "011000" ; Console . WriteLine ( minFlips ( S ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkSuffix ( int A , int B ) { int digit_B = ( int ) ( Math . Log10 ( B ) + 1 ) ; A -= B ; return ( A % ( int ) ( Math . Pow ( 10 , digit_B ) ) > 0 ) ; } public static void Main ( ) { int A = 12345 , B = 45 ; bool result = checkSuffix ( A , B ) ; if ( ! result ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Accumulator variables: A
Class/struct names: GFG
C# program:
using System ; class GFG { static int count_min_length ( string s ) { int [ ] hash = new int [ 26 ] ; int ans = int . MaxValue ; for ( int i = 0 ; i < 26 ; i ++ ) hash [ i ] = - 1 ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( hash [ s [ i ] - ' a ' ] == - 1 ) hash [ s [ i ] - ' a ' ] = i ; else { if ( hash [ s [ i ] - ' a ' ] == i - 1 hash [ s [ i ] - ' a ' ] == i - 2 ) return 0 ; ans = Math . Min ( ans , i - hash [ s [ i ] - ' a ' ] - 1 ) ; hash [ s [ i ] - ' a ' ] = i ; } } if ( ans == int . MaxValue ) return - 1 ; return ans ; } public static void Main ( string [ ] args ) { string str = " abcdeba " ; Console . WriteLine ( count_min_length ( str ) ) ; } }

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