dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void flipBitsOfAandB ( int A , int B ) { for ( int i = 0 ; i < 32 ; i ++ ) { if ( ( ( A & ( 1 << i ) ) & ( B & ( 1 << i ) ) ) != 0 ) { A = A ^ ( 1 << i ) ; B = B ^ ( 1 << i ) ; } } Console . Write ( A + " ▁ " + B ) ; } public static void Main ( string [ ] args ) { int A = 7 , B = 4 ; flipBitsOfAandB ( A , B ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findDistinctSums ( int N ) { return ( 2 * N - 1 ) ; } public static void Main ( ) { int N = 3 ; Console . Write ( findDistinctSums ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int countSubstrings ( string str ) { int [ ] freq = new int [ 3 ] ; int count = 0 ; int i = 0 ; for ( int j = 0 ; j < str . Length ; j ++ ) { freq [ str [ j ] - '0' ] ++ ; while ( freq [ 0 ] > 0 && freq [ 1 ] > 0 && freq [ 2 ] > 0 ) { freq [ str [ i ++ ] - '0' ] -- ; } count += i ; } return count ; } public static void Main ( String [ ] args ) { string str = "00021" ; Console . Write ( countSubstrings ( str ) ) ; } }

Index/key variables: j
Accumulator variables: count, i, j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int minFlips ( string str ) { int count = 0 ; if ( str . Length <= 2 ) { return 0 ; } for ( int i = 0 ; i < str . Length - 2 ; ) { if ( str [ i ] == str [ i + 1 ] && str [ i + 2 ] == str [ i + 1 ] ) { i = i + 3 ; count ++ ; } else { i ++ ; } } return count ; } public static void Main ( string [ ] args ) { string S = "0011101" ; 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 string convertToHex ( int num ) { string temp = " " ; while ( num != 0 ) { int rem = num % 16 ; char c ; if ( rem < 10 ) { c = ( char ) ( rem + 48 ) ; } else { c = ( char ) ( rem + 87 ) ; } temp = temp + c ; num = num / 16 ; } return temp ; } static string encryptString ( string S , int N ) { string ans = " " ; for ( int i = 0 ; i < N ; i ++ ) { char ch = S [ i ] ; int count = 0 ; string hex ; while ( i < N && S [ i ] == ch ) { count ++ ; i ++ ; } i -- ; hex = convertToHex ( count ) ; ans = ans + ch ; ans = ans + hex ; } char [ ] Ans = ans . ToCharArray ( ) ; Array . Reverse ( Ans ) ; ans = new string ( Ans ) ; return ans ; } static void Main ( ) { string S = " abc " ; int N = S . Length ; Console . WriteLine ( encryptString ( S , N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int binomialCoeff ( int n , int k ) { int res = 1 ; if ( k > n - k ) k = n - k ; for ( int i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } static int countOfString ( int N ) { int Stotal = ( int ) Math . Pow ( 2 , N ) ; int Sequal = 0 ; if ( N % 2 == 0 ) Sequal = binomialCoeff ( N , N / 2 ) ; int S1 = ( Stotal - Sequal ) / 2 ; return S1 ; } public static void Main ( String [ ] args ) { int N = 3 ; Console . Write ( countOfString ( N ) ) ; } }

Accumulator variables: res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String removeCharRecursive ( String str , char X ) { if ( str . Length == 0 ) { return " " ; } if ( str [ 0 ] == X ) { return removeCharRecursive ( str . Substring ( 1 ) , X ) ; } return str [ 0 ] + removeCharRecursive ( str . Substring ( 1 ) , X ) ; } public static void Main ( String [ ] args ) { String str = " geeksforgeeks " ; char X = ' e ' ; str = removeCharRecursive ( str , X ) ; Console . WriteLine ( str ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isValid ( char a1 , char a2 , string str , int flag ) { char v1 , v2 ; if ( flag == 0 ) { v1 = str [ 4 ] ; v2 = str [ 3 ] ; } else { v1 = str [ 1 ] ; v2 = str [ 0 ] ; } if ( v1 != a1 && v1 != ' ? ' ) { return false ; } if ( v2 != a2 && v2 != ' ? ' ) { return false ; } return true ; } static bool inRange ( int hh , int mm , int L , int R ) { int a = Math . Abs ( hh - mm ) ; if ( a < L a > R ) { return false ; } return true ; } static void displayTime ( int hh , int mm ) { if ( hh > 10 ) { Console . Write ( hh + " : " ) ; } else if ( hh < 10 ) { Console . Write ( "0" + hh + " : " ) ; } if ( mm > 10 ) { Console . Write ( mm ) ; } else if ( mm < 10 ) { Console . Write ( "0" + mm ) ; } } static void maximumTimeWithDifferenceInRange ( string str , int L , int R ) { int i = 0 , j = 0 ; int h1 , h2 , m1 , m2 ; for ( i = 23 ; i >= 0 ; i -- ) { h1 = i % 10 ; h2 = i / 10 ; if ( ! isValid ( ( char ) h1 , ( char ) h2 , str , 1 ) ) { continue ; } for ( j = 59 ; j >= 0 ; j -- ) { m1 = j % 10 ; m2 = j / 10 ; if ( ! isValid ( ( char ) m1 , ( char ) m2 , str , 0 ) ) { continue ; } if ( inRange ( i , j , L , R ) ) { displayTime ( i , j ) ; return ; } } } if ( inRange ( i , j , L , R ) ) { displayTime ( i , j ) ; } else { Console . WriteLine ( " - 1" ) ; } } static public void Main ( ) { string timeValue = " ? ? : ? ? " ; int L = 20 , R = 39 ; maximumTimeWithDifferenceInRange ( timeValue , L , R ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool check ( String s , int n ) { Stack < int > st = new Stack < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( st . Count != 0 && st . Peek ( ) == s [ i ] ) st . Pop ( ) ; else st . Push ( s [ i ] ) ; } if ( st . Count == 0 ) { return true ; } else { return false ; } } public static void Main ( String [ ] args ) { String str = " aanncddc " ; int n = str . Length ; if ( check ( str , n ) ) { Console . Write ( " Yes " + " STRNEWLINE " ) ; } else { Console . Write ( " No " + " STRNEWLINE " ) ; } } }

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 findNumOfValidWords ( List < String > w , List < String > p ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; List < int > res = new List < int > ( ) ; foreach ( String s in w ) { int val = 0 ; foreach ( char c in s . ToCharArray ( ) ) { val = val | ( 1 << ( c - ' a ' ) ) ; } if ( m . ContainsKey ( val ) ) m [ val ] = m [ val ] + 1 ; else m . Add ( val , 1 ) ; } foreach ( String s in p ) { int val = 0 ; foreach ( char c in s . ToCharArray ( ) ) { val = val | ( 1 << ( c - ' a ' ) ) ; } int temp = val ; int first = s [ 0 ] - ' a ' ; int count = 0 ; while ( temp != 0 ) { if ( ( ( temp >> first ) & 1 ) == 1 ) { if ( m . ContainsKey ( temp ) ) { count += m [ temp ] ; } } temp = ( temp - 1 ) & val ; } res . Add ( count ) ; } foreach ( int it in res ) { Console . WriteLine ( it ) ; } } public static void Main ( String [ ] args ) { List < String > arr1 = new List < String > ( ) ; arr1 . Add ( " aaaa " ) ; arr1 . Add ( " asas " ) ; arr1 . Add ( " able " ) ; arr1 . Add ( " ability " ) ; arr1 . Add ( " actt " ) ; arr1 . Add ( " actor " ) ; arr1 . Add ( " access " ) ; List < String > arr2 = new List < String > ( ) ; arr2 . Add ( " aboveyz " ) ; arr2 . Add ( " abrodyz " ) ; arr2 . Add ( " absolute " ) ; arr2 . Add ( " absoryz " ) ; arr2 . Add ( " actresz " ) ; arr2 . Add ( " gaswxyz " ) ; findNumOfValidWords ( arr1 , arr2 ) ; } }

Index/key variables: temp, val
Accumulator variables: count
Iterator variables: c, it, s
Class/struct names: GFG
C# program:
using System ; class GFG { static String flip ( char [ ] s ) { for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] == '0' ) { while ( s [ i ] == '0' ) { s [ i ] = '1' ; i ++ ; } break ; } } return new String ( s ) ; } public static void Main ( String [ ] args ) { String s = "100010001" ; Console . WriteLine ( flip ( s . ToCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void getOrgString ( String s ) { Console . Write ( s [ 0 ] ) ; int i = 1 ; while ( i < s . Length ) { if ( s [ i ] >= ' A ' && s [ i ] <= ' Z ' ) Console . Write ( " ▁ " + char . ToLower ( s [ i ] ) ) ; else Console . Write ( s [ i ] ) ; i ++ ; } } public static void Main ( String [ ] args ) { String s = " ILoveGeeksForGeeks " ; getOrgString ( s ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countChar ( string str , char x ) { int count = 0 ; int n = 10 ; for ( int i = 0 ; i < str . Length ; i ++ ) if ( str [ i ] == x ) count ++ ; int repetitions = n / str . Length ; count = count * repetitions ; for ( int i = 0 ; i < n % str . Length ; i ++ ) { if ( str [ i ] == x ) count ++ ; } return count ; } public static void Main ( ) { string str = " abcac " ; Console . WriteLine ( countChar ( str , ' a ' ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void countFreq ( int [ ] arr , int n , int limit ) { int [ ] count = new int [ limit + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) count [ arr [ i ] ] ++ ; for ( int i = 0 ; i <= limit ; i ++ ) if ( count [ i ] > 0 ) Console . WriteLine ( i + " ▁ " + count [ i ] ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 5 , 6 , 6 , 5 , 6 , 1 , 2 , 3 , 10 , 10 } ; int n = arr . Length ; int limit = 10 ; countFreq ( arr , n , limit ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( string s , int m ) { int l = s . Length ; int c1 = 0 ; int c2 = 0 ; for ( int i = 0 ; i < l ; i ++ ) { if ( s [ i ] == '0' ) { c2 = 0 ; c1 ++ ; } else { c1 = 0 ; c2 ++ ; } if ( c1 == m c2 == m ) return true ; } return false ; } public static void Main ( ) { String s = "001001" ; int m = 2 ; if ( check ( s , m ) ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: i
Accumulator variables: c1, c2, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int productAtKthLevel ( string tree , int k ) { int level = - 1 ; int product = 1 ; int n = tree . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( tree [ i ] == ' ( ' ) level ++ ; else if ( tree [ i ] == ' ) ' ) level -- ; else { if ( level == k ) product *= ( tree [ i ] - '0' ) ; } } return product ; } static void Main ( ) { string tree = " ( 0(5(6 ( ) ( ) ) ( 4 ( ) (9 ( ) ( ) ) ) ) ( 7(1 ( ) ( ) ) ( 3 ( ) ( ) ) ) ) " ; int k = 2 ; Console . WriteLine ( productAtKthLevel ( tree , k ) ) ; } }

Index/key variables: i
Accumulator variables: i, level, product
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findDuplciates ( string [ ] a , int n , int m ) { bool [ , ] isPresent = new bool [ n , m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { for ( int k = 0 ; k < n ; k ++ ) { if ( a [ i ] [ j ] == a [ k ] [ j ] && i != k ) { isPresent [ i , j ] = true ; isPresent [ k , j ] = true ; } } for ( int k = 0 ; k < m ; k ++ ) { if ( a [ i ] [ j ] == a [ i ] [ k ] && j != k ) { isPresent [ i , j ] = true ; isPresent [ i , k ] = true ; } } } } for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < m ; j ++ ) if ( ! isPresent [ i , j ] ) Console . Write ( a [ i ] [ j ] ) ; } static void Main ( ) { int n = 2 , m = 2 ; string [ ] a = new string [ ] { " zx " , " xz " } ; findDuplciates ( a , n , m ) ; } }

Index/key variables: i, j, k
Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isValidISBN ( string isbn ) { int n = isbn . Length ; if ( n != 10 ) return false ; int sum = 0 ; for ( int i = 0 ; i < 9 ; i ++ ) { int digit = isbn [ i ] - '0' ; if ( 0 > digit 9 < digit ) return false ; sum += ( digit * ( 10 - i ) ) ; } char last = isbn [ 9 ] ; if ( last != ' X ' && ( last < '0' last > '9' ) ) return false ; sum += ( ( last == ' X ' ) ? 10 : ( last - '0' ) ) ; return ( sum % 11 == 0 ) ; } public static void Main ( ) { string isbn = "007462542X " ; if ( isValidISBN ( isbn ) ) Console . WriteLine ( " Valid " ) ; else Console . WriteLine ( " Invalid " ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isVowel ( char c ) { return ( c == ' a ' c == ' A ' c == ' e ' c == ' E ' c == ' i ' c == ' I ' c == ' o ' c == ' O ' c == ' u ' c == ' U ' ) ; } static String reverseVowel ( String str1 ) { int j = 0 ; char [ ] str = str1 . ToCharArray ( ) ; String vowel = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( isVowel ( str [ i ] ) ) { j ++ ; vowel += str [ i ] ; } } for ( int i = 0 ; i < str . Length ; i ++ ) { if ( isVowel ( str [ i ] ) ) { str [ i ] = vowel [ -- j ] ; } } return String . Join ( " " , str ) ; } public static void Main ( String [ ] args ) { String str = " hello ▁ world " ; Console . WriteLine ( reverseVowel ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, j, vowel
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String firstLetterWord ( String str ) { String result = " " ; bool v = true ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] == ' ▁ ' ) { v = true ; } else if ( str [ i ] != ' ▁ ' && v == true ) { result += ( str [ i ] ) ; v = false ; } } return result ; } public static void Main ( ) { String str = " geeks ▁ for ▁ geeks " ; Console . WriteLine ( firstLetterWord ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Boolean variables: v
Class/struct names: GFG
C# program:
using System ; class GFG { static int ans = 0 ; static void dfs ( int i , int j , int [ , ] grid , bool [ , ] vis , int z , int z_count ) { int n = grid . GetLength ( 0 ) , m = grid . GetLength ( 1 ) ; vis [ i , j ] = true ; if ( grid [ i , j ] == 0 ) z ++ ; if ( grid [ i , j ] == 2 ) { if ( z == z_count ) ans ++ ; vis [ i , j ] = false ; return ; } if ( i >= 1 && ! vis [ i - 1 , j ] && grid [ i - 1 , j ] != - 1 ) dfs ( i - 1 , j , grid , vis , z , z_count ) ; if ( i < n - 1 && ! vis [ i + 1 , j ] && grid [ i + 1 , j ] != - 1 ) dfs ( i + 1 , j , grid , vis , z , z_count ) ; if ( j >= 1 && ! vis [ i , j - 1 ] && grid [ i , j - 1 ] != - 1 ) dfs ( i , j - 1 , grid , vis , z , z_count ) ; if ( j < m - 1 && ! vis [ i , j + 1 ] && grid [ i , j + 1 ] != - 1 ) dfs ( i , j + 1 , grid , vis , z , z_count ) ; vis [ i , j ] = false ; } static int uniquePaths ( int [ , ] grid ) { int n = grid . GetLength ( 0 ) , m = grid . GetLength ( 1 ) ; bool [ , ] vis = new bool [ n , m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { vis [ i , j ] = false ; } } int x = 0 , y = 0 ; for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 0 ; j < m ; ++ j ) { if ( grid [ i , j ] == 0 ) z_count ++ ; else if ( grid [ i , j ] == 1 ) { x = i ; y = j ; } } } dfs ( x , y , grid , vis , 0 , z_count ) ; return ans ; } static void Main ( ) { int [ , ] grid = { { 1 , 0 , 0 , 0 } , { 0 , 0 , 0 , 0 } , { 0 , 0 , 2 , - 1 } } ; Console . WriteLine ( uniquePaths ( grid ) ) ; } }

Accumulator variables: ans, i, j, z, z_count
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int numPairs ( int [ ] a , int n ) { int ans , i , index ; ans = 0 ; for ( i = 0 ; i < n ; i ++ ) a [ i ] = Math . Abs ( a [ i ] ) ; Array . Sort ( a ) ; for ( i = 0 ; i < n ; i ++ ) { index = 2 ; ans += index - i - 1 ; } return ans ; } public static void Main ( ) { int [ ] a = new int [ ] { 3 , 6 } ; int n = a . Length ; Console . Write ( numPairs ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int areaOfSquare ( int S ) { int area = S * S ; return area ; } public static void Main ( string [ ] args ) { int S = 5 ; Console . Write ( areaOfSquare ( S ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int maxPointOfIntersection ( int x , int y ) { int k = y * ( y - 1 ) / 2 ; k = k + x * ( 2 * y + x - 1 ) ; return k ; } public static void Main ( String [ ] args ) { int x = 3 ; int y = 4 ; Console . Write ( maxPointOfIntersection ( x , y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Icosihenagonal_num ( int n ) { return ( 19 * n * n - 17 * n ) / 2 ; } public static void Main ( ) { int n = 3 ; Console . Write ( Icosihenagonal_num ( n ) + " STRNEWLINE " ) ; n = 10 ; Console . Write ( Icosihenagonal_num ( n ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double [ ] find_Centroid ( double [ , ] v ) { double [ ] ans = new double [ 2 ] ; int n = v . GetLength ( 0 ) ; double signedArea = 0 ; for ( int i = 0 ; i < n ; i ++ ) { double x0 = v [ i , 0 ] , y0 = v [ i , 1 ] ; double x1 = v [ ( i + 1 ) % n , 0 ] , y1 = v [ ( i + 1 ) % n , 1 ] ; double A = ( x0 * y1 ) - ( x1 * y0 ) ; signedArea += A ; ans [ 0 ] += ( x0 + x1 ) * A ; ans [ 1 ] += ( y0 + y1 ) * A ; } signedArea *= 0.5 ; ans [ 0 ] = ( ans [ 0 ] ) / ( 6 * signedArea ) ; ans [ 1 ] = ( ans [ 1 ] ) / ( 6 * signedArea ) ; return ans ; } public static void Main ( String [ ] args ) { double [ , ] vp = { { 1 , 2 } , { 3 , - 4 } , { 6 , - 7 } } ; double [ ] ans = find_Centroid ( vp ) ; Console . WriteLine ( ans [ 0 ] + " ▁ " + ans [ 1 ] ) ; } }

Accumulator variables: i, signedArea
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void Main ( ) { int d = 10 ; double a ; a = ( double ) ( 360 - ( 6 * d ) ) / 4 ; Console . WriteLine ( a + " , ▁ " + ( a + d ) + " , ▁ " + ( a + ( 2 * d ) ) + " , ▁ " + ( a + ( 3 * d ) ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void distance ( float a1 , float b1 , float c1 , float d1 , float a2 , float b2 , float c2 , float d2 ) { float z1 , d ; if ( a1 / a2 == b1 / b2 && b1 / b2 == c1 / c2 ) { z1 = - d1 / c1 ; d = Math . Abs ( ( c2 * z1 + d2 ) ) / ( float ) ( Math . Sqrt ( a2 * a2 + b2 * b2 + c2 * c2 ) ) ; Console . Write ( " Perpendicular ▁ distance ▁ is ▁ " + d ) ; } else Console . Write ( " Planes ▁ are ▁ not ▁ parallel " ) ; } public static void Main ( ) { float a1 = 1 ; float b1 = 2 ; float c1 = - 1 ; float d1 = 1 ; float a2 = 3 ; float b2 = 6 ; float c2 = - 3 ; float d2 = - 4 ; distance ( a1 , b1 , c1 , d1 ,

Class/struct names: GFG
C# program:
using System ; class GFG { static int factorial ( int n ) { if ( n == 0 ) return 1 ; return n * factorial ( n - 1 ) ; } static long numOfNecklace ( int N ) { long ans = factorial ( N ) / ( factorial ( N / 2 ) * factorial ( N / 2 ) ) ; ans = ans * factorial ( N / 2 - 1 ) ; ans = ans * factorial ( N / 2 - 1 ) ; ans /= 2 ; return ans ; } static public void Main ( ) { int N = 4 ; Console . Write ( numOfNecklace ( N ) ) ; } }

Accumulator variables: ans
Class/struct names: GFG
C# program:
using System ; using System . Linq ; using System . Collections . Generic ; class GFG { static string isDivisibleByDivisor ( int S , int D ) { S %= D ; List < int > hashMap = new List < int > ( ) ; ; hashMap . Add ( S ) ; for ( int i = 0 ; i <= D ; i ++ ) { S += ( S % D ) ; S %= D ; if ( hashMap . Contains ( S ) ) { if ( S == 0 ) { return " Yes " ; } return " No " ; } else hashMap . Add ( S ) ; } return " Yes " ; } static void Main ( ) { int S = 3 , D = 6 ; Console . Write ( isDivisibleByDivisor ( S , D ) ) ; } }

Accumulator variables: S, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void minimumSteps ( int x , int y ) { int cnt = 0 ; while ( x != 0 && y != 0 ) { if ( x > y ) { cnt += x / y ; x %= y ; } else { cnt += y / x ; y %= x ; } } cnt -- ; if ( x > 1 y > 1 ) cnt = - 1 ; Console . WriteLine ( cnt ) ; } public static void Main ( ) { int x = 3 , y = 1 ; minimumSteps ( x , y ) ; } }

Accumulator variables: cnt
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static int countMinReversals ( string expr ) { int len = expr . Length ; if ( len % 2 != 0 ) { return - 1 ; } Stack < char > s = new Stack < char > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = expr [ i ] ; if ( c == ' } ' && s . Count > 0 ) { if ( s . Peek ( ) == ' { ' ) { s . Pop ( ) ; } else { s . Push ( c ) ; } } else { s . Push ( c ) ; } } int red_len = s . Count ; int n = 0 ; while ( s . Count > 0 && s . Peek ( ) == ' { ' ) { s . Pop ( ) ; n ++ ; } return ( red_len / 2 + n % 2 ) ; } public static void Main ( string [ ] args ) { string expr = " } } { { " ; Console . WriteLine ( countMinReversals ( expr ) ) ; } }

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

Index/key variables: i
Accumulator variables: i, left_brace, right_brace
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void PrintMinNumberForPattern ( String arr ) { int curr_max = 0 ; int last_entry = 0 ; int j ; for ( int i = 0 ; i < arr . Length ; i ++ ) { int noOfNextD = 0 ; switch ( arr [ i ] ) { case ' I ' : j = i + 1 ; while ( j < arr . Length && arr [ j ] == ' D ' ) { noOfNextD ++ ; j ++ ; } if ( i == 0 ) { curr_max = noOfNextD + 2 ; Console . Write ( " ▁ " + ++ last_entry ) ; Console . Write ( " ▁ " + curr_max ) ; last_entry = curr_max ; } else { curr_max = curr_max + noOfNextD + 1 ; last_entry = curr_max ; Console . Write ( " ▁ " + last_entry ) ; } for ( int k = 0 ; k < noOfNextD ; k ++ ) { Console . Write ( " ▁ " + -- last_entry ) ; i ++ ; } break ; case ' D ' : if ( i == 0 ) { j = i + 1 ; while ( j < arr . Length && arr [ j ] == ' D ' ) { noOfNextD ++ ; j ++ ; } curr_max = noOfNextD + 2 ; Console . Write ( " ▁ " + curr_max + " ▁ " + ( curr_max - 1 ) ) ; last_entry = curr_max - 1 ; } else { Console . Write ( " ▁ " + ( last_entry - 1 ) ) ; last_entry -- ; } break ; } } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { PrintMinNumberForPattern ( " IDID " ) ; PrintMinNumberForPattern ( " I " ) ; PrintMinNumberForPattern ( " DD " ) ; PrintMinNumberForPattern ( " II " ) ; PrintMinNumberForPattern ( " DIDI " ) ; PrintMinNumberForPattern ( " IIDDD " ) ; PrintMinNumberForPattern ( " DDIDDIID " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, k, last_entry, noOfNextD
Iterator variables: i, k
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printLeast ( String arr ) { int min_avail = 1 , pos_of_I = 0 ; List < int > al = new List < int > ( ) ; if ( arr [ 0 ] == ' I ' ) { al . Add ( 1 ) ; al . Add ( 2 ) ; min_avail = 3 ; pos_of_I = 1 ; } else { al . Add ( 2 ) ; al . Add ( 1 ) ; min_avail = 3 ; pos_of_I = 0 ; } for ( int i = 1 ; i < arr . Length ; i ++ ) { if ( arr [ i ] == ' I ' ) { al . Add ( min_avail ) ; min_avail ++ ; pos_of_I = i + 1 ; } else { al . Add ( al [ i ] ) ; for ( int j = pos_of_I ; j <= i ; j ++ ) al [ j ] = al [ j ] + 1 ; min_avail ++ ; } } for ( int i = 0 ; i < al . Count ; i ++ ) Console . Write ( al [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { printLeast ( " IDID " ) ; printLeast ( " I " ) ; printLeast ( " DD " ) ; printLeast ( " II " ) ; printLeast ( " DIDI " ) ; printLeast ( " IIDDD " ) ; printLeast ( " DDIDDIID " ) ; } }

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