dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static long productAscii ( String str ) { long prod = 1 ; for ( int i = 0 ; i < str . Length ; i ++ ) { prod *= str [ i ] ; } return prod ; } static public void Main ( ) { String str = " GfG " ; Console . Write ( productAscii ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, prod
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( String s ) { int n = s . Length ; int [ ] Presum = new int [ n ] ; char [ ] s1 = s . ToCharArray ( ) ; Presum [ 0 ] = s1 [ 0 ] - '0' ; for ( int i = 1 ; i < n ; i ++ ) { Presum [ i ] = Presum [ i - 1 ] + ( s1 [ i ] - '0' ) ; } for ( int i = 1 ; i <= n - 1 ; i ++ ) { int sum = Presum [ i - 1 ] ; int presum = 0 ; int it = i ; int flag = 0 ; while ( it < n ) { presum += s1 [ it ] - '0' ; if ( presum == sum ) { presum = 0 ; flag = 1 ; } else if ( presum > sum ) { break ; } it ++ ; } if ( presum == 0 && it == n && flag == 1 ) { return true ; } } return false ; } public static void Main ( String [ ] args ) { String s = "73452" ; if ( check ( s ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, it, n
Accumulator variables: i, it, presum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void balancedString ( String str ) { int count = 0 , i ; int n = str . Length ; for ( i = 0 ; i < n ; i ++ ) { if ( str [ i ] == ' ( ' ) { Console . Write ( str [ i ] ) ; count ++ ; } else if ( str [ i ] == ' ) ' && count != 0 ) { Console . Write ( str [ i ] ) ; count -- ; } else if ( str [ i ] != ' ) ' ) Console . Write ( str [ i ] ) ; } if ( count != 0 ) for ( i = 0 ; i < count ; i ++ ) Console . Write ( " ) " ) ; } public static void Main ( ) { String str = " gau ) ra ) v ( ku ( mar ( rajput ) ) " ; balancedString ( str ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = Int32 . MaxValue ; static int minOperation ( string s , int i , int j , int count ) { if ( ( i >= s . Length && j < 0 ) || ( i == j ) ) return MAX ; if ( s [ i ] == s [ j ] ) return count ; if ( i >= s . Length ) return minOperation ( s , i , j - 1 , count + 1 ) ; else if ( j < 0 ) return minOperation ( s , i + 1 , j , count + 1 ) ; else return Math . Min ( minOperation ( s , i , j - 1 , count + 1 ) , minOperation ( s , i + 1 , j , count + 1 ) ) ; } public static void Main ( ) { string s = " bacdefghipalop " ; int ans = minOperation ( s , 0 , s . Length - 1 , 0 ) ; if ( ans == MAX ) Console . Write ( - 1 ) ; else Console . Write ( ans ) ; } }

Index/key variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int countStrings ( String s ) { int sum = 1 ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( i % 2 == 0 && s [ i ] == ' $ ' ) sum *= 21 ; else if ( s [ i ] == ' $ ' ) sum *= 5 ; } return sum ; } public static void Main ( ) { String str = " s $ $ e $ " ; Console . WriteLine ( countStrings ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static string removeDuplicatesFromString ( string string1 ) { int counter = 0 ; char [ ] str = string1 . ToCharArray ( ) ; int i = 0 ; int size = str . Length ; int x ; int length = 0 ; while ( i < size ) { x = str [ i ] - 97 ; if ( ( counter & ( 1 << x ) ) == 0 ) { str [ length ] = ( char ) ( ' a ' + x ) ; counter = counter | ( 1 << x ) ; length ++ ; } i ++ ; } return ( new string ( str ) ) . Substring ( 0 , length ) ; } static void Main ( ) { string str = " geeksforgeeks " ; Console . WriteLine ( removeDuplicatesFromString ( str ) ) ; } }

Index/key variables: i, length
Accumulator variables: i, length
Class/struct names: GFG
C# program:
using System ; class GFG { static char [ ] removeDuplicatesFromString ( String str ) { int [ ] table = new int [ 256 ] ; char [ ] chars = str . ToCharArray ( ) ; int endIndex = 0 ; for ( int i = 0 ; i < chars . Length ; i ++ ) { if ( table [ chars [ i ] ] == 0 ) { table [ chars [ i ] ] = - 1 ; chars [ endIndex ++ ] = chars [ i ] ; } } char [ ] newStr = new char [ endIndex ] ; Array . Copy ( chars , newStr , endIndex ) ; return newStr ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; Console . WriteLine ( removeDuplicatesFromString ( str ) ) ; } }

Index/key variables: endIndex, i
Accumulator variables: endIndex, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int firstPos ( string str , int start , int end ) { int firstChar = - 1 ; for ( int i = start ; i <= end ; i ++ ) { if ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) { firstChar = i ; break ; } } return firstChar ; } static int lastPos ( string str , int start , int end ) { int lastChar = - 1 ; for ( int i = start ; i >= end ; i -- ) { if ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) { lastChar = i ; break ; } } return lastChar ; } static bool isPalindrome ( string str ) { int firstChar = 0 , lastChar = str . Length - 1 ; bool ch = true ; for ( int i = 0 ; i < str . Length ; i ++ ) { firstChar = firstPos ( str , firstChar , lastChar ) ; lastChar = lastPos ( str , lastChar , firstChar ) ; if ( lastChar < 0 firstChar < 0 ) break ; if ( str [ firstChar ] == str [ lastChar ] ) { firstChar ++ ; lastChar -- ; continue ; } ch = false ; break ; } return ch ; } public static void Main ( ) { string str = " m ▁ a ▁ 343 ▁ la ▁ y ▁ a ▁ l ▁ am " ; if ( isPalindrome ( str ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: firstChar, i, lastChar
Accumulator variables: firstChar, i, lastChar
Iterator variables: i
Boolean variables: ch
Class/struct names: GFG
C# program:
using System ; class GFG { static int find ( String s ) { int max = 0 , i , j = 0 , countk = 0 , countr = 0 ; int [ , ] table = new int [ s . Length , 2 ] ; for ( i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == ' R ' ) countr ++ ; else table [ ( j ++ ) , 0 ] = countr ; } j -- ; for ( i = s . Length - 1 ; i >= 0 ; i -- ) { if ( s [ i ] == ' K ' ) { countk ++ ; table [ j -- , 1 ] = countk ; } if ( Math . Min ( table [ j + 1 , 0 ] , table [ j + 1 , 1 ] ) > max ) max = Math . Min ( table [ j + 1 , 0 ] , table [ j + 1 , 1 ] ) ; } return max ; } static public void Main ( String [ ] srgs ) { String s = " RKRRRKKRRKKKKRR " ; int n = find ( s ) ; Console . WriteLine ( n ) ; } }

Index/key variables: i
Accumulator variables: countk, countr, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public readonly int MAX_CHAR = 26 ; public static void frequency ( int [ , ] fre , string [ ] s , int n ) { for ( int i = 0 ; i < n ; i ++ ) { string str = s [ i ] ; for ( int j = 0 ; j < str . Length ; j ++ ) { fre [ i , str [ j ] - ' a ' ] ++ ; } } } public static void LongestSequence ( int [ , ] fre , int n ) { for ( int i = 24 ; i >= 0 ; i -- ) { int mi = fre [ 0 , i ] ; for ( int j = 1 ; j < n ; j ++ ) { mi = Math . Min ( fre [ j , i ] , mi ) ; } while ( mi -- != 0 ) { Console . Write ( ( char ) ( ' a ' + i ) ) ; } } } public static void Main ( string [ ] args ) { string [ ] s = new string [ ] { " loo " , " lol " , " olive " } ; int n = s . Length ; int [ , ] fre = new int [ n , 26 ] ; frequency ( fre , s , n ) ; LongestSequence ( fre , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, mi
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GfG { static bool arePermutation ( String str1 , String str2 ) { int n1 = str1 . Length ; int n2 = str2 . Length ; if ( n1 != n2 ) return false ; char [ ] ch1 = str1 . ToCharArray ( ) ; char [ ] ch2 = str2 . ToCharArray ( ) ; Array . Sort ( ch1 ) ; Array . Sort ( ch2 ) ; for ( int i = 0 ; i < n1 ; i ++ ) if ( ch1 [ i ] != ch2 [ i ] ) return false ; return true ; } public static void Main ( String [ ] args ) { String str1 = " test " ; String str2 = " ttew " ; if ( arePermutation ( str1 , str2 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
static bool arePermutation ( char [ ] str1 , char [ ] str2 ) { int [ ] count = new int [ NO_OF_CHARS ] ; int i ; for ( i = 0 ; str1 [ i ] && str2 [ i ] ; i ++ ) { count [ str1 [ i ] ] ++ ; count [ str2 [ i ] ] -- ; } if ( str1 [ i ] str2 [ i ] ) return false ; for ( i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( count [ i ] != 0 ) return false ; return true ; }

Index/key variables: NO_OF_CHARS, i
Accumulator variables: i
Iterator variables: i
C# program:
using System ; class GFG { public static int powerOfJump ( String s ) { int count = 1 ; int max_so_far = int . MinValue ; char ch = s [ s . Length - 1 ] ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == ch ) { if ( count > max_so_far ) { max_so_far = count ; } count = 1 ; } else count ++ ; } return max_so_far ; } public static void Main ( ) { String st = "1010101" ; Console . WriteLine ( powerOfJump ( st ) ) ; } }

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 int findLongestSub ( String bin ) { int n = bin . Length , i ; int sum = 0 ; Dictionary < int , int > prevSum = new Dictionary < int , int > ( ) ; int maxlen = 0 ; int currlen ; for ( i = 0 ; i < n ; i ++ ) { if ( bin [ i ] == '1' ) sum ++ ; else sum -- ; if ( sum > 0 ) { maxlen = i + 1 ; } else if ( sum <= 0 ) { if ( prevSum . ContainsKey ( sum - 1 ) ) { currlen = i - ( prevSum [ sum - 1 ] == 0 ? 1 : prevSum [ sum - 1 ] ) ; maxlen = Math . Max ( maxlen , currlen ) ; } } if ( ! prevSum . ContainsKey ( sum ) ) prevSum . Add ( sum , i ) ; } return maxlen ; } public static void Main ( String [ ] args ) { String bin = "1010" ; Console . WriteLine ( findLongestSub ( bin ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static int averageValue ( String s ) { int sum_char = 0 ; for ( int i = 0 ; i < s . Length ; i ++ ) { sum_char += ( int ) s [ i ] ; } return sum_char / s . Length ; } public static void Main ( ) { String s = " GeeksforGeeks " ; Console . Write ( averageValue ( s ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum_char
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool check ( String s , int l ) { int [ ] freq = new int [ 26 ] ; for ( int i = 0 ; i < l ; i ++ ) { freq [ s [ i ] - ' a ' ] ++ ; } for ( int i = 0 ; i < 26 ; i ++ ) { if ( freq [ i ] >= 2 ) return true ; } return false ; } public static void Main ( String [ ] args ) { String s = " geeksforgeeks " ; int l = s . Length ; if ( check ( s , l ) ) 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 { public static void predictWinner ( string score , int n ) { int [ ] count = new int [ 2 ] ; int i ; for ( i = 0 ; i < score . Length ; i ++ ) { count [ score [ i ] - '0' ] ++ ; if ( count [ 0 ] == n && count [ 1 ] < n - 1 ) { Console . Write ( " GEEKS ▁ lost " ) ; return ; } if ( count [ 1 ] == n && count [ 0 ] < n - 1 ) { Console . Write ( " GEEKS ▁ won " ) ; return ; } if ( count [ 0 ] == n - 1 && count [ 1 ] == n - 1 ) { count [ 0 ] = 0 ; count [ 1 ] = 0 ; break ; } } for ( i ++ ; i < score . Length ; i ++ ) { count [ score [ i ] - '0' ] ++ ; if ( Math . Abs ( count [ 0 ] - count [ 1 ] ) == 2 ) { if ( count [ 0 ] > count [ 1 ] ) { Console . Write ( " GEEKS ▁ lost " ) ; } else { Console . Write ( " GEEKS ▁ won " ) ; } return ; } } } public static void Main ( string [ ] args ) { string score = "1001010101111011101111" ; int n = 15 ; predictWinner ( score , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPalindrome ( String str , int l , int r ) { while ( l < r ) { if ( str [ l ] != str [ r ] ) return false ; l ++ ; r -- ; } return true ; } static int CyclicShifts ( String str ) { int n = str . Length ; int left = 0 ; int right = n - 1 ; str = str + str ; int cnt = 0 ; while ( right < 2 * n - 1 ) { if ( isPalindrome ( str , left , right ) ) break ; cnt ++ ; left ++ ; right ++ ; } return cnt ; } public static void Main ( String [ ] args ) { String str = " bccbbaab " ; Console . WriteLine ( CyclicShifts ( str ) ) ; } }

Index/key variables: l, r
Accumulator variables: cnt, l, left, r, right
Class/struct names: GFG
C# program:
using System ; public class GFG { static String printString ( int n , String str ) { String str2 = " " ; int extraChar = n % 26 ; if ( extraChar >= 1 ) { for ( int i = 26 - ( extraChar + 1 ) ; i <= 25 ; i ++ ) { str2 += str [ i ] ; } } int countOfStr = n / 26 ; for ( int i = 1 ; i <= countOfStr ; i ++ ) { for ( int j = 0 ; j < 26 ; j ++ ) { str2 += str [ j ] ; } } return str2 ; } public static void Main ( ) { int n = 30 ; String str = " zyxwvutsrqponmlkjihgfedcba " ; Console . Write ( printString ( n , str ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, str2
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static String commonPrefixUtil ( String str1 , String str2 ) { string result = " " ; int n1 = str1 . Length , n2 = str2 . Length ; for ( int i = 0 , j = 0 ; i <= n1 - 1 && j <= n2 - 1 ; i ++ , j ++ ) { if ( str1 [ i ] != str2 [ j ] ) break ; result += ( str1 [ i ] ) ; } return ( result ) ; } static void commonPrefix ( String [ ] arr , int n ) { Array . Sort ( arr ) ; Console . Write ( commonPrefixUtil ( arr [ 0 ] , arr [ n - 1 ] ) ) ; } public static void Main ( ) { String [ ] arr = { " geeksforgeeks " , " geeks " , " geek " , " geezer " } ; int n = arr . Length ; commonPrefix ( arr , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static String multiply ( String num1 , String num2 ) { int n1 = num1 . Length ; int n2 = num2 . Length ; if ( n1 == 0 n2 == 0 ) return "0" ; int [ ] result = new int [ n1 + n2 ] ; int i_n1 = 0 ; int i_n2 = 0 ; int i = 0 ; for ( i = n1 - 1 ; i >= 0 ; i -- ) { int carry = 0 ; int n_1 = num1 [ i ] - '0' ; i_n2 = 0 ; for ( int j = n2 - 1 ; j >= 0 ; j -- ) { int n_2 = num2 [ j ] - '0' ; int sum = n_1 * n_2 + 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 -- ] ) . ToString ( ) ; return s ; } public static void Main ( String [ ] args ) { String str1 = "454545454545454545" ; Console . WriteLine ( multiply ( str1 , str1 ) ) ; } }

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 { public static void countDigits ( string st , int n ) { if ( n > 0 ) { int cnt = 1 , i ; string st2 = " " ; for ( i = 1 ; i < st . Length ; i ++ ) { if ( st [ ( i ) ] == st [ ( i - 1 ) ] ) cnt ++ ; else { st2 += ( ( char ) 0 + ( char ) cnt ) ; st2 += st [ ( i - 1 ) ] ; cnt = 1 ; } } st2 += ( ( char ) 0 + ( char ) cnt ) ; st2 += st [ ( i - 1 ) ] ; countDigits ( st2 , -- n ) ; } else Console . Write ( st ) ; } public static void Main ( ) { string num = "123" ; int n = 3 ; countDigits ( num , n ) ; } }

Accumulator variables: cnt, i, st2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static Boolean match_words ( String [ ] dictionary , String [ ] sentence , int n , int m ) { Dictionary < String , int > mp = new Dictionary < String , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( dictionary [ i ] ) ) { mp [ dictionary [ i ] ] = mp [ dictionary [ i ] ] + 1 ; } else { mp . Add ( dictionary [ i ] , 1 ) ; } } for ( int i = 0 ; i < m ; i ++ ) { if ( mp . ContainsKey ( sentence [ i ] ) && mp [ sentence [ i ] ] > 0 ) mp [ sentence [ i ] ] = mp [ sentence [ i ] ] - 1 ; else return false ; } return true ; } public static void Main ( String [ ] args ) { String [ ] dictionary = { " find " , " a " , " geeks " , " all " , " for " , " on " , " geeks " , " answers " , " inter " } ; int n = dictionary . Length ; String [ ] sentence = { " find " , " all " , " answers " , " on " , " geeks " , " for " , " geeks " , " geeks " } ; int m = sentence . Length ; if ( match_words ( dictionary , sentence , n , m ) ) 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 ; using System . Collections . Generic ; class GFG { static void printNum ( String s ) { int i = 0 , val = 0 ; Dictionary < int , int > hm = new Dictionary < int , int > ( ) ; val = ( s [ 0 ] - '0' ) * 100 + ( s [ 1 ] - '0' ) * 10 + ( s [ 2 ] - '0' ) ; hm . Add ( val , 1 ) ; for ( i = 3 ; i < s . Length ; i ++ ) { val = ( val % 100 ) * 10 + s [ i ] - '0' ; if ( hm . ContainsKey ( val ) ) { hm [ val ] = hm [ val ] + 1 ; } else { hm . Add ( val , 1 ) ; } } foreach ( KeyValuePair < int , int > en in hm ) { int key = en . Key ; int value = en . Value ; if ( value > 1 ) Console . WriteLine ( key + " ▁ - ▁ " + value + " ▁ times " ) ; } } public static void Main ( String [ ] args ) { String input = "123412345123456" ; printNum ( input ) ; } }

Index/key variables: i, val
Accumulator variables: i
Iterator variables: en, i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSubstrig ( String str1 , String str2 ) { int n1 = str1 . Length ; int n2 = str2 . Length ; if ( n1 == 0 n1 < n2 ) return 0 ; if ( str1 . Substring ( 0 , n2 ) . Equals ( str2 ) ) return countSubstrig ( str1 . Substring ( n2 - 1 ) , str2 ) + 1 ; return countSubstrig ( str1 . Substring ( n2 - 1 ) , str2 ) ; } public static void Main ( ) { string str1 = " geeksforgeeks " , str2 = " geeks " ; Console . Write ( countSubstrig ( str1 , str2 ) ) ; Console . Write ( " STRNEWLINE " ) ; str1 = " hikakashi " ; str2 = " hi " ; Console . Write ( countSubstrig ( str1 , str2 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool hasAllcodes ( string s , int k ) { HashSet < string > us = new HashSet < string > ( ) ; for ( int i = 0 ; i + k <= s . Length ; i ++ ) { us . Add ( s . Substring ( i , k ) ) ; } return us . Count == 1 << k ; } static void Main ( ) { string s = "00110110" ; int k = 2 ; if ( hasAllcodes ( s , k ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String addBinaryUtil ( String a , String b ) { String result = " " ; int s = 0 ; int i = a . Length - 1 , j = b . Length - 1 ; while ( i >= 0 j >= 0 s == 1 ) { s += ( ( i >= 0 ) ? a [ i ] - '0' : 0 ) ; s += ( ( j >= 0 ) ? b [ j ] - '0' : 0 ) ; result = s % 2 + result ; s /= 2 ; i -- ; j -- ; } return result ; } static String addBinary ( String [ ] arr , int n ) { String result = " " ; for ( int i = 0 ; i < n ; i ++ ) { result = addBinaryUtil ( result , arr [ i ] ) ; } return result ; } public static void Main ( String [ ] args ) { String [ ] arr = { "1" , "10" , "11" } ; int n = arr . Length ; Console . WriteLine ( addBinary ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void reverse ( char [ ] str , int start , int end ) { char temp ; while ( start <= end ) { temp = str [ start ] ; str [ start ] = str [ end ] ; str [ end ] = temp ; start ++ ; end -- ; } } static void reverseletter ( char [ ] str , int start , int end ) { int wstart , wend ; for ( wstart = wend = start ; wend < end ; wend ++ ) { if ( str [ wend ] == ' ▁ ' ) { continue ; } while ( wend <= end && str [ wend ] != ' ▁ ' ) { wend ++ ; } wend -- ; reverse ( str , wstart , wend ) ; } } public static void Main ( String [ ] args ) { char [ ] str = " Ashish ▁ Yadav ▁ Abhishek ▁ Rajput ▁ Sunil ▁ Pundir " . ToCharArray ( ) ; reverseletter ( str , 0 , str . Length - 1 ) ; Console . Write ( " { 0 } " , String . Join ( " " , str ) ) ; } }

Index/key variables: end, start, wend
Accumulator variables: end, start, wend
Iterator variables: wstart
Class/struct names: GFG
C# program:
using System ; class GFG { static void minimumFlip ( String s , int x , int y ) { s = s + s ; bool isOpposite = false ; if ( x > y ) { swap ( x , y ) ; isOpposite = true ; } int valClockwise = 0 ; char cur = s [ x ] ; for ( int i = x ; i <= y ; i ++ ) { if ( s [ i ] != cur ) { cur = s [ i ] ; valClockwise ++ ; } } int valAnticlockwise = 0 ; cur = s [ y ] ; x += s . Length ; for ( int i = y ; i < x ; i ++ ) { if ( s [ i ] != cur ) { cur = s [ i ] ; valAnticlockwise ++ ; } } if ( valClockwise <= valAnticlockwise ) { if ( ! isOpposite ) { Console . WriteLine ( " Clockwise ▁ " + valClockwise ) ; } else { Console . WriteLine ( " Anti - clockwise ▁ " + valAnticlockwise ) ; } } else if ( ! isOpposite ) { Console . WriteLine ( " Anti - clockwise ▁ " + valAnticlockwise ) ; } else { Console . WriteLine ( " Clockwise ▁ " + valClockwise ) ; } } static void swap ( int a , int b ) { int c = a ; a = b ; b = c ; } public static void Main ( String [ ] args ) { int x = 0 , y = 8 ; String s = "000110" ; minimumFlip ( s , x , y ) ; } }

Index/key variables: i, x, y
Accumulator variables: i, valAnticlockwise, valClockwise, x
Iterator variables: i
Boolean variables: isOpposite
Class/struct names: GFG
C# program:
using System ; class GFG { static int prefix ( String k , int n ) { int a = 0 , b = 0 , count = 0 ; int i = 0 ; int len = k . Length ; for ( i = 0 ; i < len ; i ++ ) { if ( k [ i ] == ' a ' ) a ++ ; if ( k [ i ] == ' b ' ) b ++ ; if ( a > b ) { count ++ ; } } if ( count == 0 n == 1 ) { Console . WriteLine ( count ) ; return 0 ; } if ( count == len a - b == 0 ) { Console . WriteLine ( count * n ) ; return 0 ; } int n2 = n - 1 , count2 = 0 ; while ( n2 != 0 ) { for ( i = 0 ; i < len ; i ++ ) { if ( k [ i ] == ' a ' ) a ++ ; if ( k [ i ] == ' b ' ) b ++ ; if ( a > b ) { count2 ++ ; } } count += count2 ; n2 -- ; if ( count2 == 0 ) break ; if ( count2 == len ) { count += ( n2 * count2 ) ; break ; } count2 = 0 ; } return count ; } public static void Main ( ) { string S = " aba " ; int N = 2 ; Console . WriteLine ( prefix ( S , N ) ) ; S = " baa " ; N = 3 ; Console . WriteLine ( prefix ( S , N ) ) ; } }

Index/key variables: i
Accumulator variables: a, b, count, count2, i, n2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int N = 20 ; static int countPair ( String [ ] str , int n ) { int [ ] cnt = new int [ 1 << 10 ] ; for ( int i = 0 ; i < n ; i ++ ) { int mask = 0 ; for ( int j = 0 ; j < str [ i ] . Length ; ++ j ) mask |= ( 1 << ( str [ i ] [ j ] - '0' ) ) ; cnt [ mask ] ++ ; } int ans = 0 ; for ( int m1 = 0 ; m1 <= 1023 ; m1 ++ ) for ( int m2 = 0 ; m2 <= 1023 ; m2 ++ ) if ( ( m1 m2 ) == 1023 ) { ans += ( ( m1 == m2 ) ? ( cnt [ m1 ] * ( cnt [ m1 ] - 1 ) ) : ( cnt [ m1 ] * cnt [ m2 ] ) ) ; } return ans / 2 ; } public static void Main ( String [ ] args ) { int n = 5 ; String [ ] str = { "129300455" , "5559948277" , "012334556" , "56789" , "123456879" } ; Console . Write ( countPair ( str , n ) + " STRNEWLINE " ) ; } }

Index/key variables: i, j, m1, m2, mask
Accumulator variables: ans, i, m1, m2, mask
Iterator variables: i, j, m1, m2
Class/struct names: GFG