dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class Solution { static bool isVowel ( char ch ) { if ( ch != ' a ' && ch != ' e ' && ch != ' i ' && ch != ' o ' && ch != ' u ' ) return false ; return true ; } static String replacingConsonants ( String s ) { for ( int i = 0 ; i < s . Length ; i ++ ) { if ( isVowel ( s [ i ] ) ) continue ; else { if ( s [ i ] > ' a ' && s [ i ] < ' e ' ) { if ( Math . Abs ( s [ i ] - ' a ' ) > Math . Abs ( s [ i ] - ' e ' ) ) s = s . Substring ( 0 , i ) + ' e ' + s . Substring ( i + 1 ) ; else s = s . Substring ( 0 , i ) + ' a ' + s . Substring ( i + 1 ) ; } else if ( s [ i ] > ' e ' && s [ i ] < ' i ' ) { if ( Math . Abs ( s [ i ] - ' e ' ) > Math . Abs ( s [ i ] - ' i ' ) ) s = s . Substring ( 0 , i ) + ' i ' + s . Substring ( i + 1 ) ; else s = s . Substring ( 0 , i ) + ' e ' + s . Substring ( i + 1 ) ; } else if ( s [ i ] > ' i ' && s [ i ] < ' o ' ) { if ( Math . Abs ( s [ i ] - ' i ' ) > Math . Abs ( s [ i ] - ' o ' ) ) s = s . Substring ( 0 , i ) + ' o ' + s . Substring ( i + 1 ) ; else s = s . Substring ( 0 , i ) + ' i ' + s . Substring ( i + 1 ) ; } else if ( s [ i ] > ' o ' && s [ i ] < ' u ' ) { if ( Math . Abs ( s [ i ] - ' o ' ) > Math . Abs ( s [ i ] - ' u ' ) ) s = s . Substring ( 0 , i ) + ' u ' + s . Substring ( i + 1 ) ; else s = s . Substring ( 0 , i ) + ' o ' + s . Substring ( i + 1 ) ; } else if ( s [ i ] > ' u ' ) s = s . Substring ( 0 , i ) + ' u ' + s . Substring ( i + 1 ) ; } } return s ; } public static void Main ( ) { String s = " geeksforgeeks " ; Console . WriteLine ( replacingConsonants ( s ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: Solution
C# program:
using System ; class GFG { static int maxLength ( string s , int n ) { int right = 0 , left = 0 ; int coun = 0 , max_length = int . MinValue ; s = s + '1' ; for ( int i = 0 ; i <= n ; i ++ ) { if ( s [ i ] == ' o ' ) coun ++ ; else { if ( coun > max_length ) { right = 0 ; left = 0 ; if ( s [ i ] == ' x ' ) right = 1 ; if ( ( ( i - coun ) > 0 ) && ( s [ i - coun - 1 ] == ' x ' ) ) left = 1 ; coun = ( int ) Math . Ceiling ( ( double ) coun / ( right + left ) ) ; max_length = Math . Max ( max_length , coun ) ; } coun = 0 ; } } return max_length ; } public static void Main ( ) { string s = " oooxoooooooooxooo " ; int n = s . Length ; Console . Write ( maxLength ( s , n ) ) ; } }

Index/key variables: i
Accumulator variables: coun, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String printLargestString ( String s , int l , int r ) { int [ ] freq = new int [ 26 ] ; l -- ; r -- ; for ( int i = Math . Min ( l , r ) ; i <= Math . Max ( l , r ) ; i ++ ) { freq [ s [ i ] - ' a ' ] ++ ; } String ans = " " ; for ( int i = 25 ; i >= 0 ; i -- ) { while ( freq [ i ] > 0 ) { ans += ( char ) ( ' a ' + i ) ; freq [ i ] -- ; } } return ans ; } public static void Main ( ) { String s = " striver " ; int l = 3 , r = 5 ; Console . Write ( printLargestString ( s , l , r ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i, l, r
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void arrange ( String s ) { int cc = 0 ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == '1' ) cc ++ ; } int [ ] a = new int [ s . Length + 1 ] ; int [ , ] qq = { { 2 , 3 } , { 5 , 5 } } ; int n = qq . GetLength ( 0 ) ; for ( int i = 0 ; i < n ; i ++ ) { int l = qq [ i , 0 ] , r = qq [ i , 1 ] ; l -- ; r -- ; a [ l ] ++ ; a [ r + 1 ] -- ; } int len_a = a . Length ; for ( int i = 1 ; i < len_a ; i ++ ) { a [ i ] += a [ i - 1 ] ; } int [ ] zz = new int [ s . Length ] ; for ( int i = 0 ; i < len_a - 1 ; i ++ ) { if ( a [ i ] > 0 ) { if ( cc > 0 ) { zz [ i ] = 1 ; cc -- ; } else break ; } if ( cc == 0 ) break ; } if ( cc > 0 ) { for ( int i = 0 ; i < s . Length ; i ++ ) { if ( zz [ i ] == 0 ) { zz [ i ] = 1 ; cc -- ; } if ( cc == 0 ) break ; } } for ( int i = 0 ; i < s . Length ; i ++ ) Console . Write ( zz [ i ] ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { String str = "11100" ; arrange ( str ) ; } }

Index/key variables: i, l
Accumulator variables: cc, i, l, r
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool areVowelsInOrder ( string s ) { int n = s . Length ; char c = ( char ) 64 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] == ' a ' s [ i ] == ' e ' s [ i ] == ' i ' s [ i ] == ' o ' s [ i ] == ' u ' ) { if ( s [ i ] < c ) { return false ; } else { c = s [ i ] ; } } } return true ; } public static void Main ( string [ ] args ) { string s = " aabbbddeecc " ; if ( areVowelsInOrder ( s ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String newString ( string s ) { int l = s . Length ; int [ ] freq = new int [ 26 ] ; for ( int i = 0 ; i < l ; i ++ ) { freq [ s [ i ] - ' a ' ] += 1 ; } string ans = " " ; for ( int i = 0 ; i < 26 ; i ++ ) { for ( int j = 0 ; j < freq [ i ] ; j ++ ) { ans += ( char ) ( 97 + i ) ; } } return ans ; } public static void Main ( ) { string s = " aabab " ; Console . Write ( newString ( s ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int Remainder ( String str , int R ) { int len = str . Length ; int Num , Rem = 0 ; for ( int i = 0 ; i < len ; i ++ ) { Num = Rem * 10 + ( str [ i ] - '0' ) ; Rem = Num % R ; } return Rem ; } public static void Main ( ) { String str = "13589234356546756" ; int R = 13 ; Console . WriteLine ( Remainder ( str , R ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void countWays ( int [ ] a , int n ) { int i , j ; long [ ] suff = new long [ n ] ; if ( a [ n - 1 ] == 2 ) suff [ n - 1 ] = 1 ; for ( i = n - 2 ; i >= 0 ; i -- ) { if ( a [ i ] == 2 ) suff [ i ] = suff [ i + 1 ] + 1 ; else suff [ i ] = suff [ i + 1 ] ; } long ss = 0 ; for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] == 1 ) ss += suff [ i ] ; } for ( i = 0 ; i < n ; i ++ ) { for ( j = i + 1 ; j < n ; j ++ ) { if ( a [ i ] == 1 && a [ j ] == 1 && suff [ j ] >= 2 ) { ss += ( suff [ j ] ) * ( suff [ j ] - 1 ) / 2 ; } } } for ( i = 0 ; i < n ; i ++ ) { for ( j = i + 1 ; j < n ; j ++ ) { if ( a [ i ] == 1 && a [ j ] == 1 && ( suff [ i ] - suff [ j ] ) >= 1 && suff [ j ] >= 1 ) { ss += ( suff [ i ] - suff [ j ] ) * suff [ j ] ; } } } Console . WriteLine ( ss ) ; } public static void Main ( ) { int [ ] a = { 1 , 2 , 1 , 1 , 2 , 2 } ; int n = 6 ; countWays ( a , n ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j, ss
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int count_carry ( string a , string b ) { int carry = 0 ; int count = 0 ; int len_a = a . Length , len_b = b . Length ; while ( len_a != 0 len_b != 0 ) { int x = 0 , y = 0 ; if ( len_a > 0 ) { x = a [ len_a - 1 ] - '0' ; len_a -- ; } if ( len_b > 0 ) { y = b [ len_b - 1 ] - '0' ; len_b -- ; } int sum = x + y + carry ; if ( sum >= 10 ) { carry = 1 ; count ++ ; } else carry = 0 ; } return count ; } public static void Main ( ) { string a = "9555" , b = "555" ; int count = count_carry ( a , b ) ; if ( count == 0 ) Console . Write ( "0 STRNEWLINE " ) ; else if ( count == 1 ) Console . Write ( "1 STRNEWLINE " ) ; else Console . Write ( count ) ; } }

Accumulator variables: count, len_a, len_b
Class/struct names: GFG
C# program:
using System ; class GFG { static void printIndex ( String str , String s ) { bool flag = false ; for ( int i = 0 ; i < str . Length - s . Length + 1 ; i ++ ) { if ( str . Substring ( i , s . Length ) . Equals ( s ) ) { Console . Write ( i + " ▁ " ) ; flag = true ; } } if ( flag == false ) { Console . WriteLine ( " NONE " ) ; } } public static void Main ( String [ ] args ) { String str1 = " GeeksforGeeks " ; String str2 = " Geeks " ; printIndex ( str1 , str2 ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static string merge ( string s1 , string s2 ) { string result = " " ; for ( int i = 0 ; i < s1 . Length < s2 . Length ; i ++ ) { if ( i < s1 . Length ) result += s1 [ i ] ; if ( i < s2 . Length ) result += s2 [ i ] ; } return result ; } static void Main ( ) { string s1 = " geeks " ; string s2 = " forgeeks " ; Console . WriteLine ( merge ( s1 , s2 ) ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static char getMaxOccurringChar ( string str ) { int [ ] freq = new int [ 26 ] ; int max = - 1 ; char result = ( char ) 0 ; int len = str . Length ; for ( int i = 0 ; i < len ; i ++ ) { if ( str [ i ] != ' ▁ ' ) { freq [ str [ i ] - ' a ' ] ++ ; } } for ( int i = 0 ; i < 26 ; i ++ ) { if ( max < freq [ i ] ) { max = freq [ i ] ; result = ( char ) ( i + ' a ' ) ; } } return result ; } public static void Main ( ) { string str = " sample ▁ program " ; Console . WriteLine ( " Maximum ▁ occurring ▁ character ▁ = ▁ " + getMaxOccurringChar ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class new_file { static bool isGreaterThanEqual ( String s1 , String s2 ) { if ( s1 . Length > s2 . Length ) return true ; if ( s1 . CompareTo ( s2 ) == 0 ) return true ; return false ; } static String multiply ( String s1 , String s2 ) { int n = s1 . Length ; int m = s2 . Length ; int i = 0 ; int [ ] result = new int [ n + m ] ; for ( i = n - 1 ; i >= 0 ; i -- ) for ( int j = m - 1 ; j >= 0 ; j -- ) result [ i + j + 1 ] += ( s1 [ i ] - '0' ) * ( s2 [ j ] - '0' ) ; int size = result . Length ; for ( i = size - 1 ; i > 0 ; i -- ) { if ( result [ i ] >= 10 ) { result [ i - 1 ] += result [ i ] / 10 ; result [ i ] = result [ i ] % 10 ; } } i = 0 ; while ( i < size && result [ i ] == 0 ) i ++ ; if ( i == size ) return "0" ; String temp = " " ; while ( i < size ) { temp += ( result [ i ] ) . ToString ( ) ; i ++ ; } return temp ; } static String removeLeadingZeores ( String s ) { int n = s . Length ; int i = 0 ; while ( i < n && s [ i ] == '0' ) i ++ ; if ( i == n ) return "0" ; String temp = " " ; while ( i < n ) { temp += s [ i ] ; i ++ ; } return temp ; } static bool isPower ( String s1 , String s2 ) { s1 = removeLeadingZeores ( s1 ) ; s2 = removeLeadingZeores ( s2 ) ; if ( s1 == "0" s2 == "0" ) return false ; if ( s1 == "1" && s2 == "1" ) return true ; if ( s1 == "1" s2 == "1" ) return true ; if ( s1 . Length > s2 . Length ) return isPower ( s2 , s1 ) ; String temp = s1 ; while ( ! isGreaterThanEqual ( s1 , s2 ) ) s1 = multiply ( s1 , temp ) ; if ( s1 . CompareTo ( s2 ) == 0 ) return true ; return false ; } public static void Main ( String [ ] args ) { String s1 = "374747" , s2 = "52627712618930723" ; if ( isPower ( s1 , s2 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; s1 = "4099" ; s2 = "2" ; if ( isPower ( s1 , s2 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, temp
Iterator variables: i, j
Class/struct names: new_file
C# program:
using System ; public class GFG { static int matchClosing ( char [ ] X , int start , int end , char open , char close ) { int c = 1 ; int i = start + 1 ; while ( i <= end ) { if ( X [ i ] == open ) { c ++ ; } else if ( X [ i ] == close ) { c -- ; } if ( c == 0 ) { return i ; } i ++ ; } return i ; } static int matchingOpening ( char [ ] X , int start , int end , char open , char close ) { int c = - 1 ; int i = end - 1 ; while ( i >= start ) { if ( X [ i ] == open ) { c ++ ; } else if ( X [ i ] == close ) { c -- ; } if ( c == 0 ) { return i ; } i -- ; } return - 1 ; } static bool isBalanced ( char [ ] X , int n ) { int i , j = 0 , k , x , start , end ; for ( i = 0 ; i < n ; i ++ ) { if ( X [ i ] == ' ( ' ) { j = matchClosing ( X , i , n - 1 , ' ( ' , ' ) ' ) ; } else if ( X [ i ] == ' { ' ) { j = matchClosing ( X , i , n - 1 , ' { ' , ' } ' ) ; } else if ( X [ i ] == ' [ ' ) { j = matchClosing ( X , i , n - 1 , ' [ ' , ' ] ' ) ; } else { if ( X [ i ] == ' ) ' ) { j = matchingOpening ( X , 0 , i , ' ( ' , ' ) ' ) ; } else if ( X [ i ] == ' } ' ) { j = matchingOpening ( X , 0 , i , ' { ' , ' } ' ) ; } else if ( X [ i ] == ' ] ' ) { j = matchingOpening ( X , 0 , i , ' [ ' , ' ] ' ) ; } if ( j < 0 j >= i ) { return false ; } continue ; } if ( j >= n j < 0 ) { return false ; } start = i ; end = j ; for ( k = start + 1 ; k < end ; k ++ ) { if ( X [ k ] == ' ( ' ) { x = matchClosing ( X , k , end , ' ( ' , ' ) ' ) ; if ( ! ( k < x && x < end ) ) { return false ; } } else if ( X [ k ] == ' ) ' ) { x = matchingOpening ( X , start , k , ' ( ' , ' ) ' ) ; if ( ! ( start < x && x < k ) ) { return false ; } } if ( X [ k ] == ' { ' ) { x = matchClosing ( X , k , end , ' { ' , ' } ' ) ; if ( ! ( k < x && x < end ) ) { return false ; } } else if ( X [ k ] == ' } ' ) { x = matchingOpening ( X , start , k , ' { ' , ' } ' ) ; if ( ! ( start < x && x < k ) ) { return false ; } } if ( X [ k ] == ' [ ' ) { x = matchClosing ( X , k , end , ' [ ' , ' ] ' ) ; if ( ! ( k < x && x < end ) ) { return false ; } } else if ( X [ k ] == ' ] ' ) { x = matchingOpening ( X , start , k , ' [ ' , ' ] ' ) ; if ( ! ( start < x && x < k ) ) { return false ; } } } } return true ; } public static void Main ( ) { char [ ] X = " [ ( ) ] ( ) " . ToCharArray ( ) ; int n = 6 ; if ( isBalanced ( X , n ) ) Console . Write ( " Yes STRNEWLINE " ) ; else Console . Write ( " No STRNEWLINE " ) ; char [ ] Y = " [ [ ( ) ] ] ) " . ToCharArray ( ) ; n = 7 ; if ( isBalanced ( Y , n ) ) Console . Write ( " Yes STRNEWLINE " ) ; else Console . Write ( " No STRNEWLINE " ) ; } }

Index/key variables: i, k
Accumulator variables: c, i, k
Iterator variables: i, k
Class/struct names: GFG
C# program:
using System ; class GFG { static string possibleToSort ( int [ ] arr , int n , string str ) { int max_element = - 1 ; for ( int i = 0 ; i < str . Length ; i ++ ) { max_element = Math . Max ( max_element , arr [ i ] ) ; if ( str [ i ] == '0' ) { if ( max_element > i + 1 ) return " No " ; } } return " Yes " ; } static public void Main ( ) { int [ ] arr = { 1 , 2 , 5 , 3 , 4 , 6 } ; int n = arr . Length ; string str = "01110" ; Console . WriteLine ( possibleToSort ( arr , n , str ) ) ; } }

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 void findSubstring ( String str , int power ) { Dictionary < int , int > map = new Dictionary < int , int > ( ) ; int curr_power = 0 ; int len = str . Length ; for ( int i = 0 ; i < len ; i ++ ) { curr_power = curr_power + ( str [ i ] - ' a ' + 1 ) ; if ( curr_power == power ) { Console . WriteLine ( " Substring ▁ from ▁ index ▁ 0" + " ▁ to ▁ " + i + " ▁ has ▁ power ▁ " + power ) ; return ; } if ( map . ContainsKey ( curr_power - power ) ) { Console . WriteLine ( " Substring ▁ from ▁ index ▁ " + ( map [ curr_power - power ] + 1 ) + " ▁ to ▁ " + i + " ▁ has ▁ power ▁ " + power ) ; return ; } if ( ! map . ContainsKey ( curr_power ) ) map . Add ( curr_power , i ) ; else map [ curr_power ] = i ; } Console . WriteLine ( " No ▁ substring ▁ with ▁ " + " given ▁ power ▁ exists " ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; int power = 36 ; findSubstring ( str , power ) ; } }

Index/key variables: curr_power, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isPrimeString ( string str ) { int len = str . Length , n = 0 ; for ( int i = 0 ; i < len ; i ++ ) { n += ( int ) str [ i ] ; } if ( n <= 1 ) { return false ; } if ( n <= 3 ) { return true ; } if ( n % 2 == 0 n % 3 == 0 ) { return false ; } for ( int i = 5 ; i * i <= n ; i = i + 6 ) { if ( n % i == 0 || n % ( i + 2 ) == 0 ) { return false ; } } return true ; } public static void Main ( string [ ] args ) { string str = " geekRam " ; if ( isPrimeString ( str ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Index/key variables: i
Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countWays ( string s ) { int [ ] count = new int [ 26 ] ; for ( int i = 0 ; i < s . Length ; i ++ ) count [ s [ i ] - ' a ' ] ++ ; count [ s [ 0 ] - ' a ' ] = 1 ; int ans = 1 ; for ( int i = 0 ; i < 26 ; ++ i ) if ( count [ i ] != 0 ) ans *= count [ i ] ; return ans ; } public static void Main ( ) { string s = " acbbcc " ; Console . WriteLine ( countWays ( s ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void lexoString ( char [ ] s , int k ) { int n = s . Length ; List < char > v = new List < char > ( ) ; Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ! mp . ContainsKey ( s [ i ] ) ) { mp . Add ( s [ i ] , 1 ) ; v . Add ( s [ i ] ) ; } } v . Sort ( ) ; if ( k > n ) { Console . Write ( String . Join ( " " , s ) ) ; for ( int i = n ; i < k ; i ++ ) { Console . Write ( v [ 0 ] ) ; } } for ( int i = k - 1 ; i >= 0 ; i -- ) { if ( s [ i ] != v [ v . Count - 1 ] ) { for ( int j = 0 ; j < i ; j ++ ) { Console . Write ( s [ j ] ) ; } for ( int j = 0 ; j < v . Count ; j ++ ) { if ( v [ j ] > s [ i ] ) { Console . Write ( v [ j ] ) ; break ; } } for ( int j = i + 1 ; j < k ; j ++ ) { Console . Write ( v [ 0 ] ) ; } return ; } } Console . Write ( " No ▁ lexicographically ▁ greater ▁ " + " string ▁ of ▁ length ▁ " + k + " ▁ possible ▁ here . " ) ; } public static void Main ( String [ ] arr ) { String s = " gi " ; int k = 3 ; lexoString ( s . ToCharArray ( ) , k ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 256 ; static long fact ( int n ) { long res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int countPalinPermutations ( string str ) { int n = str . Length ; int [ ] freq = new int [ MAX ] ; for ( int i = 0 ; i < n ; i ++ ) freq [ str [ i ] ] ++ ; long res = fact ( n / 2 ) ; bool oddFreq = false ; for ( int i = 0 ; i < MAX ; i ++ ) { int half = freq [ i ] / 2 ; if ( freq [ i ] % 2 != 0 ) { if ( oddFreq == true ) return 0 ; oddFreq = true ; } res = res / fact ( half ) ; } return ( int ) res ; } public static void Main ( ) { string str = " gffg " ; Console . WriteLine ( countPalinPermutations ( str ) ) ; } }

Index/key variables: MAX, i
Accumulator variables: i
Iterator variables: i
Boolean variables: oddFreq
Class/struct names: GFG
C# program:
using System ; class GFG { static Boolean isVowel ( char ch ) { return ( ch == ' a ' ch == ' e ' ch == ' i ' ch == ' o ' ch == ' u ' ) ; } static Boolean isCons ( char ch ) { return ( ch != ' a ' && ch != ' e ' && ch != ' i ' && ch != ' o ' && ch != ' u ' ) ; } static int countSpecial ( char [ ] str ) { int len = str . Length ; if ( len == 0 ) return 0 ; int [ ] co = new int [ len + 1 ] ; int [ ] vo = new int [ len + 1 ] ; if ( isCons ( str [ len - 1 ] ) == true ) co [ len - 1 ] = 1 ; else vo [ len - 1 ] = 1 ; for ( int i = len - 2 ; i >= 0 ; i -- ) { if ( isCons ( str [ i ] ) == true ) { co [ i ] = co [ i + 1 ] + 1 ; vo [ i ] = vo [ i + 1 ] ; } else { co [ i ] = co [ i + 1 ] ; vo [ i ] = vo [ i + 1 ] + 1 ; } } long ans = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( isVowel ( str [ i ] ) ) ans = ans + co [ i + 1 ] ; else ans = ans + vo [ i + 1 ] ; } return ( int ) ans ; } public static void Main ( String [ ] args ) { String str = " adceba " ; Console . WriteLine ( countSpecial ( str . ToCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkPalindrome ( string str ) { int n = str . Length ; int count = 0 ; for ( int i = 0 ; i < n / 2 ; ++ i ) if ( str [ i ] != str [ n - i - 1 ] ) ++ count ; return ( count <= 1 ) ; } public static void Main ( ) { string str = " abccaa " ; if ( checkPalindrome ( str ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int evenDecimalValue ( string str , int n ) { int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( str [ i ] == '0' ) { result += ( n - i ) ; } } return result ; } public static void Main ( ) { string str = "10010" ; int n = 5 ; Console . WriteLine ( evenDecimalValue ( str , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSubstr ( string s ) { int n = s . Length ; int [ ] auxArr = new int [ n ] ; if ( s [ 0 ] == '1' ) auxArr [ 0 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( s [ i ] == '1' ) auxArr [ i ] = auxArr [ i - 1 ] + 1 ; else auxArr [ i ] = auxArr [ i - 1 ] ; } int count = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) if ( s [ i ] == '1' ) count += auxArr [ i ] ; return count ; } public static void Main ( ) { string s = "1101" ; Console . WriteLine ( countSubstr ( s ) ) ; } }

Index/key variables: i, n
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 256 ; static bool canMakeStr2 ( string str1 , string str2 ) { int [ ] count = new int [ MAX ] ; for ( int i = 0 ; i < str1 . Length ; i ++ ) count [ str1 [ i ] ] ++ ; for ( int i = 0 ; i < str2 . Length ; i ++ ) { if ( count [ str2 [ i ] ] == 0 ) return false ; count [ str2 [ i ] ] -- ; } return true ; } static public void Main ( ) { string str1 = " geekforgeeks " ; string str2 = " for " ; if ( canMakeStr2 ( str1 , str2 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: MAX, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void finalPosition ( String move ) { int l = move . Length ; int countUp = 0 , countDown = 0 ; int countLeft = 0 , countRight = 0 ; for ( int i = 0 ; i < l ; i ++ ) { if ( move [ i ] == ' U ' ) countUp ++ ; else if ( move [ i ] == ' D ' ) countDown ++ ; else if ( move [ i ] == ' L ' ) countLeft ++ ; else if ( move [ i ] == ' R ' ) countRight ++ ; } Console . WriteLine ( " Final ▁ Position : ▁ ( " + ( countRight - countLeft ) + " , ▁ " + ( countUp - countDown ) + " ) " ) ; } public static void Main ( ) { String move = " UDDLLRUUUDUURUDDUULLDRRRR " ; finalPosition ( move ) ; } }

Index/key variables: i
Accumulator variables: countDown, countLeft, countRight, countUp, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxbalancedprefix ( string str , int n ) { int sum = 0 ; int maxi = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( str [ i ] == ' ( ' ) sum += 1 ; else sum -= 1 ; if ( sum < 0 ) break ; if ( sum == 0 ) maxi = i + 1 ; } return maxi ; } public static void Main ( ) { string str = " ( ( ( ) ( ) ) ( ) ) ( ( " ; int n = str . Length ; Console . WriteLine ( maxbalancedprefix ( str , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int cost ( String str ) { int len = str . Length ; int res = 0 ; for ( int i = 0 , j = len - 1 ; i < j ; i ++ , j -- ) if ( str [ i ] != str [ j ] ) res += Math . Min ( str [ i ] , str [ j ] ) - ' a ' + 1 ; return res ; } public static void Main ( ) { string str = " abcdef " ; Console . WriteLine ( cost ( str ) ) ; } }

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