dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { public static int minElements ( int [ ] arr , int N , int K ) { int count = 0 ; long requiredNum = 1 ; int i = 0 ; while ( requiredNum <= K ) { if ( i < N && requiredNum >= arr [ i ] ) { requiredNum += arr [ i ] ; i ++ ; } else { count ++ ; requiredNum += requiredNum ; } } return count ; } public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 3 } ; int K = 6 ; int N = arr . Length ; Console . Write ( minElements ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, requiredNum
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maximumCount ( int [ ] arr , int N ) { int odd = 0 ; int even = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 2 != 0 ) odd ++ ; else even ++ ; } if ( odd != 0 && even != 0 ) return N - 2 ; else return N - 1 ; } public static void Main ( ) { int [ ] arr = { 9 , 13 , 15 , 3 , 16 , 9 , 13 , 18 } ; int N = arr . Length ; Console . Write ( maximumCount ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: even, i, odd
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minPossibleValue ( int N , int K , int X ) { for ( int i = 1 ; i <= N ; i ++ ) { if ( X <= K ) { X = X * 2 ; } else { X = X + K ; } } return X ; } public static void Main ( ) { int N = 7 , K = 4 , X = 1 ; Console . WriteLine ( minPossibleValue ( N , K , X ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void findMissingValue ( int [ ] arr , int N ) { int minE = Int32 . MaxValue , maxE = Int32 . MinValue ; for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( arr [ i ] == - 1 && arr [ i + 1 ] != - 1 ) { minE = Math . Min ( minE , arr [ i + 1 ] ) ; maxE = Math . Max ( maxE , arr [ i + 1 ] ) ; } if ( arr [ i ] != - 1 && arr [ i + 1 ] == - 1 ) { minE = Math . Min ( minE , arr [ i ] ) ; maxE = Math . Max ( maxE , arr [ i ] ) ; } } if ( minE == Int32 . MaxValue && maxE == Int32 . MinValue ) { Console . WriteLine ( "0" ) ; } else { Console . WriteLine ( ( minE + maxE ) / 2 ) ; } } public static void Main ( ) { int [ ] arr = { 1 , - 1 , - 1 , - 1 , 5 } ; int N = arr . Length ; findMissingValue ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findLastElement ( int N , int [ ] A ) { int l = A . Length ; int j = 0 ; while ( N > l * ( int ) ( Math . Pow ( 2 , j ) ) ) { N = N - l * ( int ) Math . Pow ( 2 , j ) ; j += 1 ; } int k = 1 ; int r = ( int ) Math . Pow ( 2 , j ) ; for ( int i = 1 ; i < l ; i ++ ) { if ( N > r * i ) k += 1 ; } for ( int i = 0 ; i < l ; i ++ ) { if ( i + 1 == k ) { Console . WriteLine ( A [ i ] ) ; return ; } } } public static void Main ( String [ ] args ) { int K = 7 ; int [ ] A = { 1 , 2 , 3 } ; findLastElement ( K , A ) ; } }

Index/key variables: i
Accumulator variables: i, j, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static int findMaxD ( int [ ] arr , int N , int K ) { for ( int i = 0 ; i < N ; i ++ ) { arr [ i ] = Math . Abs ( arr [ i ] - K ) ; } int D = arr [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) { D = gcd ( D , arr [ i ] ) ; } return D ; } public static void Main ( ) { int [ ] arr = { 1 , 7 , 11 } ; int N = arr . Length ; int K = 3 ; Console . Write ( findMaxD ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxOperations ( String S , int N ) { int X = 0 ; int Y = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( S [ i ] == '0' ) break ; Y ++ ; } for ( int i = N - 1 ; i >= 0 ; i -- ) { if ( S [ i ] == '1' ) break ; X ++ ; } if ( N == X + Y ) return 0 ; return N - ( X + Y ) - 1 ; } static void Main ( ) { String S = "001111" ; int N = S . Length ; Console . WriteLine ( maxOperations ( S , N ) ) ; } }

Index/key variables: i
Accumulator variables: X, Y, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maximumSum ( string S , int N , int K ) { int sum = 0 ; int [ ] freq = new int [ 256 ] ; Array . Clear ( freq , 0 , 256 ) ; for ( int i = 0 ; i < N ; i ++ ) { freq [ ( int ) S [ i ] ] ++ ; } Array . Sort ( freq ) ; Array . Reverse ( freq ) ; for ( int i = 0 ; i < 256 ; i ++ ) { if ( K > freq [ i ] ) { sum += freq [ i ] * freq [ i ] ; K -= freq [ i ] ; } else { sum += freq [ i ] * K ; break ; } } return sum ; } public static void Main ( ) { string S = " GEEKSFORGEEKS " ; int K = 10 ; int N = S . Length ; Console . Write ( maximumSum ( S , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: K, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int [ , , ] dp = new int [ 100 , 10 , 10 ] ; static int countOfNumbers ( int digit , int prev1 , int prev2 , int n ) { if ( digit == n + 1 ) { return 1 ; } int val = dp [ digit , prev1 , prev2 ] ; if ( val != - 1 ) { return val ; } val = 0 ; if ( digit == 1 ) { for ( int i = ( n == 1 ? 0 : 1 ) ; i <= 9 ; ++ i ) { val += countOfNumbers ( digit + 1 , i , prev1 , n ) ; } } else if ( digit == 2 ) { for ( int i = 0 ; i <= 9 ; ++ i ) { val += countOfNumbers ( digit + 1 , i , prev1 , n ) ; } } else { int diff = Math . Abs ( prev2 - prev1 ) ; for ( int i = 0 ; i <= 9 ; ++ i ) { if ( Math . Abs ( prev1 - i ) <= diff ) { val += countOfNumbers ( digit + 1 , i , prev1 , n ) ; } } } return val ; } static void countNumbersUtil ( int N ) { for ( int i = 0 ; i < 100 ; i ++ ) { for ( int j = 0 ; j < 10 ; j ++ ) { for ( int k = 0 ; k < 10 ; k ++ ) { dp [ i , j , k ] = - 1 ; } } } Console . WriteLine ( countOfNumbers ( 1 , 0 , 0 , N ) ) ; } static public void Main ( ) { int N = 3 ; countNumbersUtil ( N ) ; } }

Accumulator variables: i, j, k, val
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class MyClass { static void possibleNumbers ( HashSet < int > numbers , int N , int M , int A , int B ) { if ( M == 0 ) { numbers . Add ( N ) ; return ; } possibleNumbers ( numbers , N + A , M - 1 , A , B ) ; possibleNumbers ( numbers , N + B , M - 1 , A , B ) ; } public static void Main ( String [ ] args ) { int N = 5 , M = 3 , A = 4 , B = 6 ; HashSet < int > numbers = new HashSet < int > ( ) ; possibleNumbers ( numbers , N , M , A , B ) ; foreach ( int i in numbers ) Console . Write ( i + " ▁ " ) ; } }

Iterator variables: i
Class/struct names: MyClass
C# program:
using System ; class GFG { static void maxSum ( int [ ] arr , int n ) { int sum = 0 ; int max_neg = Int32 . MaxValue ; int tempsum = 0 ; int small = Int32 . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; small = Math . Min ( small , arr [ i ] ) ; if ( arr [ i ] > 0 ) { tempsum = 0 ; } else { tempsum += arr [ i ] ; } max_neg = Math . Min ( max_neg , tempsum ) ; } if ( max_neg == 0 ) { max_neg = small ; } Console . Write ( sum - max_neg ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { - 2 , - 3 , 4 , - 1 , - 2 , 1 , 5 , - 3 } ; int n = arr . Length ; maxSum ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i, sum, tempsum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string largestString ( string s , int k ) { for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] != ' z ' && k > 0 ) { s = s . Replace ( s [ i ] , ' z ' ) ; k -- ; } } return s ; } public static void Main ( ) { string s = " dbza " ; int k = 1 ; Console . Write ( largestString ( s , k ) ) ; } }

Index/key variables: i
Accumulator variables: i, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void RemoveOneChar ( string A , string B , int N , int M ) { int X = 0 ; int Y = N - 1 ; for ( int i = 0 ; i < M ; i ++ ) { if ( A [ X ] != B [ i ] ) break ; X ++ ; } for ( int i = M - 1 ; i >= 0 ; i -- ) { if ( A [ Y ] != B [ i ] ) break ; Y -- ; } if ( N - M == 1 && Y < X ) { Console . WriteLine ( X - Y + 1 ) ; for ( int i = Y ; i <= X ; i ++ ) Console . Write ( i + 1 + " ▁ " ) ; Console . WriteLine ( ) ; } else Console . WriteLine ( - 1 ) ; } static public void Main ( ) { string A = " abaac " ; string B = " abac " ; int N = A . Length ; int M = B . Length ; RemoveOneChar ( A , B , N , M ) ; } }

Index/key variables: X, Y, i
Accumulator variables: X, Y, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void minimumOperation ( string a , string b ) { int n = a . Length ; int i = 0 ; int minoperation = 0 ; while ( i < n ) { if ( a [ i ] == b [ i ] ) { i = i + 1 ; continue ; } else if ( a [ i ] == b [ i + 1 ] && a [ i + 1 ] == b [ i ] && i < n - 1 ) { minoperation ++ ; i = i + 2 ; } else if ( a [ i ] != b [ i ] ) { minoperation ++ ; i = i + 1 ; } else { ++ i ; } } Console . WriteLine ( minoperation ) ; } public static void Main ( ) { string a = "10010010" , b = "00001000" ; minimumOperation ( a , b ) ; } }

Index/key variables: i
Accumulator variables: minoperation
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void findMinOperations ( int [ ] arr , int N , int K ) { int operations = - 1 ; for ( int i = 0 ; i < K ; i ++ ) { Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; for ( int j = i ; j < N ; j += K ) { if ( freq . ContainsKey ( arr [ j ] ) ) freq [ arr [ j ] ] ++ ; else freq . Add ( arr [ j ] , 1 ) ; } int max1 = - 1 , num = 0 ; foreach ( KeyValuePair < int , int > entry in freq ) { if ( entry . Key > max1 ) { max1 = entry . Value ; num = entry . Key ; } } foreach ( KeyValuePair < int , int > entry in freq ) { if ( entry . Key != num ) operations += entry . Value ; } } Console . Write ( operations ) ; } public static void Main ( ) { int [ ] arr = { 3 , 4 , 3 , 5 , 6 } ; int K = 2 ; int N = arr . Length ; findMinOperations ( arr , N , K ) ; } }

Index/key variables: j
Accumulator variables: i, j, operations
Iterator variables: entry, i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static void countOfPairs ( int x , int y ) { int count = 0 ; for ( int k = 1 ; k * k <= x ; ++ k ) { count += Math . Max ( 0 , Math . Min ( y , x / k - 1 ) - k ) ; } Console . Write ( count ) ; } static public void Main ( ) { int x = 4 ; int y = 5 ; countOfPairs ( x , y ) ; } }

Accumulator variables: count
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int countPermutations ( int N ) { List < List < int > > adj = new List < List < int > > ( 105 ) ; for ( int i = 0 ; i < 105 ; i ++ ) adj . Add ( new List < int > ( ) ) ; int indeg = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 1 ; j <= N ; j ++ ) { if ( i == j ) continue ; int sum = i + j ; if ( Math . Ceiling ( Math . Sqrt ( sum ) ) == Math . Floor ( Math . Sqrt ( sum ) ) ) { adj [ i ] . Add ( j ) ; } } if ( adj [ i ] . Count == 1 ) indeg ++ ; } if ( indeg == 0 ) return N ; else if ( indeg <= 2 ) return 2 ; else return 0 ; } public static void Main ( ) { int N = 17 ; Console . WriteLine ( countPermutations ( N ) ) ; } }

Index/key variables: i
Accumulator variables: i, indeg, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static void makeList ( int N , int K ) { int [ ] list = new int [ N ] ; int left = 1 ; int right = N ; for ( int i = 0 ; i < N ; i ++ ) { if ( K % 2 == 0 ) { list [ i ] = left ; left = left + 1 ; } else { list [ i ] = right ; right = right - 1 ; } if ( K > 1 ) K -- ; } for ( int i = 0 ; i < list . Length ; i ++ ) { Console . Write ( list [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 6 ; int K = 3 ; makeList ( N , K ) ; } }

Index/key variables: N, i
Accumulator variables: K, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void getDate ( int d , string m ) { int [ ] days = { 31 , 29 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; string [ ] month = { " January " , " February " , " March " , " April " , " May " , " June " , " July " , " August " , " September " , " October " , " November " , " December " } ; int cnt = 183 ; int cur_month = 0 ; for ( int i = 0 ; i < 12 ; i ++ ) if ( m == month [ i ] ) cur_month = i ; int cur_date = d ; while ( true ) { while ( cnt > 0 && cur_date <= days [ cur_month ] ) { cnt -= 1 ; cur_date += 1 ; } if ( cnt == 0 ) break ; cur_month = ( cur_month + 1 ) % 12 ; cur_date = 1 ; } Console . WriteLine ( cur_date + " ▁ " + month [ cur_month ] ) ; } public static void Main ( ) { int D = 15 ; string M = " January " ; getDate ( D , M ) ; } }

Index/key variables: cur_month, i
Accumulator variables: cnt, cur_date, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long largestNumber ( int N ) { if ( N > 45 ) return - 1 ; int num = 0 , digit = 9 ; while ( N > 0 && digit > 0 ) { if ( digit <= N ) { num *= 10 ; num += digit ; N -= digit ; } digit -= 1 ; } return num * 10 ; } public static void Main ( ) { int N = 25 ; Console . Write ( largestNumber ( N ) ) ; } }

Accumulator variables: N, digit, num
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static int minimumSum ( int [ ] A , int N , String S ) { int mul = 0 ; for ( int i = 0 ; i < ( int ) S . Length ; i ++ ) { if ( S [ i ] == ' * ' ) mul += 1 ; } int ans = 1000000 ; for ( int i = 0 ; i < ( 1 << ( N - 1 ) ) ; i ++ ) { int cnt = 0 ; List < char > v = new List < char > ( ) ; for ( int j = 0 ; j < N - 1 ; j ++ ) { if ( ( ( 1 << j ) & ( i ) ) > 0 ) { cnt += 1 ; v . Add ( ' * ' ) ; } else { v . Add ( ' + ' ) ; } } if ( cnt == mul ) { List < int > d = new List < int > ( ) ; d . Add ( A [ 0 ] ) ; for ( int j = 0 ; j < N - 1 ; j ++ ) { if ( v [ j ] == ' * ' ) { int x = d [ d . Count - 1 ] ; d . RemoveAt ( d . Count - 1 ) ; x = x * A [ j + 1 ] ; d . Add ( x ) ; } else { d . Add ( A [ j + 1 ] ) ; } } int sum = 0 ; while ( d . Count > 0 ) { int x = d [ 0 ] ; sum += x ; d . RemoveAt ( 0 ) ; } ans = Math . Min ( ans , sum ) ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] A = { 2 , 2 , 2 , 2 } ; String S = " * * + " ; int N = A . Length ; Console . Write ( minimumSum ( A , N , S ) ) ; } }

Index/key variables: i, j
Accumulator variables: cnt, i, j, mul, sum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void sumOfMedians ( int [ ] arr , int N , int K ) { int selectMedian = ( K + 1 ) / 2 ; int totalArrays = N / K ; int minSum = 0 ; int i = selectMedian - 1 ; while ( i < N && totalArrays != 0 ) { minSum = minSum + arr [ i ] ; i = i + selectMedian ; totalArrays -- ; } Console . WriteLine ( minSum ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 } ; int N = arr . Length ; int K = 2 ; sumOfMedians ( arr , N , K ) ; } }

Index/key variables: i
Accumulator variables: totalArrays
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void solve ( int S , int K , int N ) { if ( K > N ) { Console . WriteLine ( " - 1" ) ; return ; } int max_sum = 0 , min_sum = 0 ; for ( int i = 1 ; i <= K ; i ++ ) { min_sum += i ; max_sum += N - i + 1 ; } if ( S < min_sum S > max_sum ) { Console . WriteLine ( " - 1" ) ; return ; } int s1 = 0 ; List < int > nums = new List < int > ( ) ; for ( int i = 1 ; i <= N ; i ++ ) { if ( s1 > S ) break ; s1 += i ; nums . Add ( i ) ; } List < int > answer = new List < int > ( ) ; int s2 = 0 ; for ( int i = 0 ; i < K - 1 ; i ++ ) { answer . Add ( nums [ i ] ) ; s2 += nums [ i ] ; } answer . Add ( S - s2 ) ; int Max = N ; for ( int i = answer . Count - 1 ; i >= 0 ; i -- ) { if ( answer [ i ] > Max ) { int extra = answer [ i ] - Max ; if ( i - 1 >= 0 ) answer [ i - 1 ] += extra ; answer [ i ] = Max ; Max -- ; } else break ; } foreach ( int x in answer ) Console . Write ( x + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( ) { int S = 15 , K = 4 , N = 8 ; solve ( S , K , N ) ; } }

Index/key variables: i
Accumulator variables: Max, i, max_sum, min_sum, s1, s2
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void minSizeArr ( int [ ] A , int N , int K ) { int leftTaken = N , rightTaken = N ; int leftSum = 0 , rightSum = 0 ; for ( int left = - 1 ; left < N ; left ++ ) { if ( left != - 1 ) leftSum += A [ left ] ; rightSum = 0 ; for ( int right = N - 1 ; right > left ; right -- ) { rightSum += A [ right ] ; if ( leftSum + rightSum == K ) { if ( leftTaken + rightTaken > ( left + 1 ) + ( N - right ) ) { leftTaken = left + 1 ; rightTaken = N - right ; } break ; } if ( leftSum + rightSum > K ) break ; } } if ( leftTaken + rightTaken <= N ) { for ( int i = 0 ; i < leftTaken ; i ++ ) Console . Write ( A [ i ] + " ▁ " ) ; for ( int i = 0 ; i < rightTaken ; i ++ ) Console . Write ( A [ N - i - 1 ] + " ▁ " ) ; } else Console . Write ( - 1 ) ; } public static void Main ( ) { int N = 7 ; int [ ] A = { 3 , 2 , 1 , 1 , 1 , 1 , 3 } ; int K = 10 ; minSizeArr ( A , N , K ) ; } }

Index/key variables: i, left, right
Accumulator variables: i, left, leftSum, right, rightSum
Iterator variables: i, left, right
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void minSizeArr ( int [ ] A , int N , int K ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) sum += A [ i ] ; if ( K > sum ) { Console . WriteLine ( - 1 ) ; return ; } if ( K == sum ) { for ( int i = 0 ; i < N ; i ++ ) { Console . Write ( A [ i ] + " ▁ " ) ; } return ; } int tar = sum - K ; Dictionary < int , int > um = new Dictionary < int , int > ( ) ; um [ 0 ] = - 1 ; int left = 0 , right = 0 ; int cur = 0 , maxi = - 1 ; for ( int i = 0 ; i < N ; i ++ ) { cur += A [ i ] ; if ( um . ContainsKey ( cur - tar ) && i - um [ cur - tar ] > maxi ) { maxi = i - um [ cur - tar ] ; right = i ; left = um [ cur - tar ] ; } if ( ! um . ContainsKey ( cur ) ) um [ cur ] = i ; } if ( maxi == - 1 ) Console . Write ( - 1 ) ; else { for ( int i = 0 ; i <= left ; i ++ ) Console . Write ( A [ i ] + " ▁ " ) ; for ( int i = 0 ; i < right ; i ++ ) Console . Write ( A [ N - i - 1 ] + " ▁ " ) ; } } static public void Main ( ) { int N = 7 ; int [ ] A = { 3 , 2 , 1 , 1 , 1 , 1 , 3 } ; int K = 10 ; minSizeArr ( A , N , K ) ; } }

Index/key variables: cur, i
Accumulator variables: cur, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void minModulo ( int L , int R , int N ) { if ( R - L < N ) { int ans = Int32 . MaxValue ; for ( int i = L ; i <= R ; i ++ ) for ( int j = L ; j <= R ; j ++ ) if ( i != j ) ans = Math . Min ( ans , ( i * j ) % N ) ; Console . WriteLine ( ans ) ; } else { Console . WriteLine ( 0 ) ; } } public static void Main ( string [ ] args ) { int L = 6 , R = 10 , N = 2019 ; minModulo ( L , R , N ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countNumbers ( int N ) { int count = 0 ; for ( int i = 1 ; i * i <= N ; i ++ ) { if ( N % i == 0 ) { count ++ ; if ( N / i != i ) { count ++ ; } } } return count ; } public static void Main ( string [ ] args ) { int N = 10 ; Console . WriteLine ( countNumbers ( N ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static int maximumSize ( int [ ] a , int k ) { int low = 1 ; int high = a . Max ( ) ; int ans = - 1 ; while ( low <= high ) { int mid = low + ( high - low ) / 2 ; int count = 0 ; for ( int c = 0 ; c < a . Length ; c ++ ) { count += a / mid ; } if ( count >= k ) { ans = mid ; low = mid + 1 ; } else { high = mid - 1 ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 9 } ; int K = 6 ; Console . WriteLine ( maximumSize ( arr , K ) ) ; } }

Accumulator variables: c, count
Iterator variables: c
Class/struct names: GFG
C# program:
using System ; class GFG { static void findEquation ( int A , int B , int C , int K ) { Console . Write ( A + " ▁ " + K * B + " ▁ " + K * K * C ) ; } public static void Main ( ) { int A = 1 , B = 2 , C = 1 , K = 2 ; findEquation ( A , B , C , K ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int minOperations ( int [ ] arr , int n ) { int oddcount = 0 , evencount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 1 ) oddcount ++ ; else evencount ++ ; } return Math . Min ( oddcount , evencount ) ; } public static void Main ( ) { int [ ] arr = { 2 , 4 , 3 , 1 , 8 } ; int N = ( arr . Length ) ; Console . WriteLine ( minOperations ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: evencount, i, oddcount
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long gcd ( long a , long b ) { if ( b == 0 ) return a ; return gcd ( b , a % b ) ; } static void countDistinctNumbers ( long A , long B , long C ) { long g = gcd ( A , B ) ; long count = C / g ; Console . Write ( count ) ; } static void Main ( ) { long A = 2 , B = 3 , C = 5 ; countDistinctNumbers ( A , B , C ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { public static void printLastElement ( int [ ] arr , int N ) { bool leftTurn = true ; int remainElements = N ; int step = 1 ; int head = 1 ; while ( remainElements > 1 ) { if ( leftTurn ) { head = head + step ; } else { if ( remainElements % 2 == 1 ) head = head + step ; } remainElements = remainElements / 2 ; step = step * 2 ; leftTurn = ! leftTurn ; } Console . Write ( arr [ head - 1 ] ) ; } static public void Main ( ) { int [ ] arr = { 2 , 3 , 5 , 6 } ; int N = arr . Length ; printLastElement ( arr , N ) ; } }

Boolean variables: leftTurn
Class/struct names: GFG
C# program:
using System ; class GFG { static void max_min ( int N , int C , int K ) { int maximum , minimum ; if ( N == 1 ) { maximum = minimum = C ; } else if ( K >= C ) { maximum = C ; minimum = 0 ; } else { maximum = K ; minimum = 0 ; int remain_candy = C - K ; maximum += remain_candy / N ; minimum = remain_candy / N ; if ( remain_candy % N == N - 1 ) { minimum ++ ; } } Console . WriteLine ( " Maximum ▁ = ▁ " + maximum ) ; Console . WriteLine ( " Minimum ▁ = ▁ " + minimum ) ; } static void Main ( ) { int N = 4 ; int C = 12 ; int K = 3 ; max_min ( N , C , K ) ; } }

Accumulator variables: maximum, minimum
Class/struct names: GFG
C# program:
using System ; class GFG { static void shortestSubarray ( int [ ] A , int N ) { int i ; int left_index ; for ( i = 0 ; i < N - 1 ; i ++ ) { if ( A [ i ] + 1 != A [ i + 1 ] ) break ; } left_index = i ; int right_index ; for ( i = N - 1 ; i >= 1 ; i -- ) { if ( A [ i ] != A [ i - 1 ] + 1 ) break ; } right_index = i ; int updated_right ; int minLength = Math . Min ( N - left_index - 1 , right_index ) ; if ( A [ right_index ] <= A [ left_index ] + 1 ) { updated_right = right_index + A [ left_index ] - A [ right_index ] + 1 ; if ( updated_right < N ) minLength = Math . Min ( minLength , updated_right - left_index - 1 ) ; } Console . WriteLine ( minLength ) ; } static public void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 7 , 4 , 3 , 5 } ; int N = arr . Length ; shortestSubarray ( arr , N ) ; } }

Index/key variables: i, left_index, right_index
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static string freqCheck ( string S , int N ) { int [ ] hash = new int [ 26 ] ; for ( int i = 0 ; i < N ; i ++ ) { hash [ S [ i ] - ' a ' ] ++ ; } for ( int i = 0 ; i < 26 ; i ++ ) { if ( hash [ i ] > 2 ) { return " Yes " ; } } return " No " ; } static public void Main ( ) { string S = " geekseekforgeeks " ; int N = S . Length ; Console . WriteLine ( freqCheck ( S , N ) ) ; } }

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