dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static int countMinSteps ( int [ ] arr , int N ) { int val = 0 ; int mx = Int32 . MinValue ; for ( int i = 0 ; i < N ; i ++ ) { int curr = arr [ i ] ; mx = Math . Max ( mx , curr ) ; val = Math . Max ( val , mx - curr ) ; } int res = 0 ; while ( ( 1 << res ) - 1 < val ) { ++ res ; } return res ; } public static void Main ( ) { int [ ] arr = { 1 , 7 , 6 , 5 } ; int N = arr . Length ; Console . Write ( countMinSteps ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int func2 ( int L , int R , int K ) { if ( R - L >= 2 ) return 1 ; return Math . Min ( L , L ^ R ) ; } static int func3 ( int L , int R , int K ) { if ( ( R ^ L ) > L && ( R ^ L ) < R ) return 0 ; return func2 ( L , R , K ) ; } static int func4 ( int L , int R , int K ) { if ( R - L >= 4 ) return 0 ; int minval = L ^ ( L + 1 ) ^ ( L + 2 ) ^ ( L + 3 ) ; return Math . Min ( minval , func3 ( L , R , K ) ) ; } static int minimumXor ( int L , int R , int K ) { if ( K > 4 ) return 0 ; else if ( K == 4 ) return func4 ( L , R , K ) ; else if ( K == 3 ) return func3 ( L , R , K ) ; else if ( K == 2 ) return func2 ( L , R , K ) ; else return L ; } static void Main ( ) { int L = 1 , R = 3 , K = 3 ; Console . Write ( minimumXor ( L , R , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int setBits ( long n ) { int count = 0 ; while ( n > 0 ) { n = n & ( n - 1 ) ; count ++ ; } return count ; } static void findNthTerm ( int N ) { int x = setBits ( N ^ ( N - 1 ) ) ; Console . WriteLine ( x ) ; } public static void Main ( string [ ] args ) { int N = 8 ; findNthTerm ( N ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void findEquation ( int A , int B , int C ) { Console . Write ( " ( " + C + " ) " + " x ^ 2 ▁ + ( " + B + " ) x ▁ + ▁ ( " + A + " ) ▁ = ▁ 0" ) ; } public static void Main ( ) { int A = 1 , B = - 5 , C = 6 ; findEquation ( A , B , C ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int findMinMoves ( int [ ] arr , int N ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) sum += arr [ i ] ; if ( sum % N != 0 ) return - 1 ; int avg = sum / N ; int total = 0 ; int needCount = 0 ; for ( int i = 0 ; i < N ; i ++ ) { needCount += ( arr [ i ] - avg ) ; total = Math . Max ( Math . Max ( Math . Abs ( needCount ) , arr [ i ] - avg ) , total ) ; } return total ; } public static void Main ( ) { int [ ] arr = { 1 , 0 , 5 } ; int N = arr . Length ; Console . Write ( findMinMoves ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, needCount, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void find ( int N , List < List < int > > Arr ) { int amount = 0 ; List < int > mid_odd = new List < int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { int siz = Arr [ i ] . Count ; for ( int j = 0 ; j < siz / 2 ; j ++ ) amount = amount + Arr [ i ] [ j ] ; if ( siz % 2 == 1 ) mid_odd . Add ( Arr [ i ] [ siz / 2 ] ) ; } mid_odd . Sort ( ) ; for ( int i = 0 ; i < mid_odd . Count ; i ++ ) if ( i % 2 == 0 ) amount = amount + mid_odd [ i ] ; Console . WriteLine ( amount ) ; } static void Main ( ) { int N = 2 ; List < List < int > > Arr = new List < List < int > > ( ) ; Arr . Add ( new List < int > ( ) ) ; Arr [ 0 ] . Add ( 5 ) ; Arr [ 0 ] . Add ( 2 ) ; Arr [ 0 ] . Add ( 3 ) ; Arr [ 0 ] . Add ( 4 ) ; Arr . Add ( new List < int > ( ) ) ; Arr [ 1 ] . Add ( 1 ) ; Arr [ 1 ] . Add ( 6 ) ; find ( N , Arr ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static String checkPattern ( int [ ] arr , int m , int k , int n ) { int count = 1 , t = 0 ; for ( int i = 0 ; i < n - m ; i ++ ) { if ( arr [ i ] == arr [ i + m ] ) { t ++ ; if ( t == m ) { t = 0 ; count ++ ; if ( count == k ) { return " Yes " ; } } } else { t = 0 ; count = 1 ; } } return " No " ; } public static void Main ( String [ ] args ) { int [ ] arr = { 6 , 1 , 3 , 3 , 3 , 3 } ; int M = 1 , K = 3 ; int N = arr . Length ; Console . Write ( checkPattern ( arr , M , K , N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, t
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Text . RegularExpressions ; public class GFG { static void moveAllDigitAtBeginning ( String str ) { String moveAllDigit = Regex . Replace ( str , " \\ D + " , " " ) + Regex . Replace ( str , " \\ d " , " " ) ; Console . WriteLine ( moveAllDigit ) ; } public static void Main ( String [ ] args ) { String str = " GeeksforGeeks1234" ; moveAllDigitAtBeginning ( str ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static void getZarr ( string str , int [ ] Z ) { int n = str . Length ; int k ; int L = 0 ; int R = 0 ; for ( int i = 1 ; i < n ; ++ i ) { if ( i > R ) { L = R = i ; while ( R < n && str [ R - L ] == str [ R ] ) { R ++ ; } Z [ i ] = R - L ; R -- ; } else { k = i - L ; if ( Z [ k ] < R - i + 1 ) { Z [ i ] = Z [ k ] ; } else { L = i ; while ( R < n && str [ R - L ] == str [ R ] ) { R ++ ; } Z [ i ] = R - L ; R -- ; } } } } static string goodStr ( string str , string word ) { string concat = word + " $ " + str ; int l = concat . Length ; int [ ] Z = new int [ l ] ; getZarr ( concat , Z ) ; string res = " " ; int pSize = word . Length ; for ( int i = 0 ; i < l ; ++ i ) { if ( i + pSize < l - 1 && Z [ i + pSize + 1 ] == pSize ) { i += pSize - 1 ; } else if ( i < str . Length ) { res += str [ i ] ; } } return res ; } static public void Main ( ) { string str = " Z - kmalgorithmkmiskmkmkmhelpfulkminkmsearching " ; string word = " km " ; Console . WriteLine ( goodStr ( str , word ) ) ; } }

Index/key variables: R, i, k, l
Accumulator variables: R, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findOccurrences ( String S , String T ) { int n1 = S . Length ; int n2 = T . Length ; int ans = 0 ; int last = 0 ; for ( int i = 0 ; i <= n1 - n2 ; i ++ ) { bool chk = true ; for ( int j = 0 ; j < n2 ; j ++ ) { if ( T [ j ] != S [ i + j ] ) { chk = false ; break ; } } if ( chk ) { ans += ( i + 1 - last ) * ( n1 - ( i + n2 - 1 ) ) ; last = i + 1 ; } } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { String S = " dabc " , T = " ab " ; findOccurrences ( S , T ) ; } }

Index/key variables: j
Accumulator variables: ans, i, j
Iterator variables: i, j
Boolean variables: chk
Class/struct names: GFG
C# program:
using System ; class GFG { static void LargestArray ( int N , int low , int high ) { int high_index = N - ( high - low + 1 ) ; if ( high_index > ( N - 1 ) / 2 ) { Console . Write ( " Not ▁ Possible " ) ; return ; } if ( high_index <= 0 ) high_index = 1 ; int [ ] A = new int [ N ] ; int temp = high ; for ( int i = high_index ; i >= 0 ; i -- ) { A [ i ] = temp -- ; } high -= 1 ; for ( int i = high_index + 1 ; i < N ; i ++ ) A [ i ] = high -- ; for ( int i = 0 ; i < N ; i ++ ) { Console . Write ( A [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 5 , low = 2 , high = 6 ; LargestArray ( N , low , high ) ; } }

Index/key variables: N, i
Accumulator variables: high, i, temp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printDiagonalTraversal ( int [ , ] nums ) { int max_size = nums . GetLength ( 0 ) ; List < List < int > > v = new List < List < int > > ( ) ; for ( int i = 0 ; i < 2 * max_size - 1 ; i ++ ) { v . Add ( new List < int > ( ) ) ; } for ( int i = 0 ; i < nums . GetLength ( 0 ) ; i ++ ) { for ( int j = 0 ; j < nums . GetLength ( 0 ) ; j ++ ) { v [ i + j ] . Add ( nums [ i , j ] ) ; } } for ( int i = 0 ; i < v . Count ; i ++ ) { for ( int j = v [ i ] . Count - 1 ; j >= 0 ; j -- ) { Console . Write ( v [ i ] [ j ] + " ▁ " ) ; } } } static void Main ( ) { int [ , ] arr = { { 1 , 2 , 3 } , { 4 , 5 , 6 } , { 7 , 8 , 9 } } ; printDiagonalTraversal ( arr ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void isValid ( string s ) { int n = ( int ) Math . Sqrt ( s . Length ) ; char check = s [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { int x = i , y = i ; while ( x >= 0 && y < n ) { if ( s [ ( n * x ) + y ] != check || s [ ( n * y ) + x ] != check ) { Console . Write ( " No " ) ; return ; } x -- ; y ++ ; } } Console . Write ( " Yes " ) ; } public static void Main ( ) { string str = " abacdaeaafaghaia " ; isValid ( str ) ; } }

Accumulator variables: i, x, y
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 10 ; static int [ ] pref = new int [ N ] ; static int [ ] power = new int [ N ] ; static int toDigit ( char ch ) { return ( ch - '0' ) ; } static void powerOf10 ( ) { power [ 0 ] = 1 ; for ( int i = 1 ; i < N ; i ++ ) power [ i ] = power [ i - 1 ] * 10 ; } static void precomputePrefix ( char [ ] str , int n ) { pref [ 0 ] = str [ 0 ] - '0' ; for ( int i = 1 ; i < n ; i ++ ) pref [ i ] = pref [ i - 1 ] + toDigit ( str [ i ] ) ; } static int triangularNumber ( int i ) { int res = i * ( i + 1 ) / 2 ; return res ; } static int sumOfSubStrings ( String str ) { int n = str . Length ; powerOf10 ( ) ; precomputePrefix ( str . ToCharArray ( ) , n ) ; int ans = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { ans += ( pref [ n - i - 2 ] * ( i + 1 ) + toDigit ( str [ n - i - 1 ] ) * triangularNumber ( n - i - 1 ) ) * power [ i ] ; } return ans ; } public static void Main ( String [ ] args ) { String str = "1234" ; Console . Write ( sumOfSubStrings ( str ) ) ; } }

Index/key variables: N, i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int OddLengthSum ( int [ ] arr ) { int sum = 0 ; int l = arr . Length ; for ( int i = 0 ; i < l ; i ++ ) { for ( int j = i ; j < l ; j += 2 ) { for ( int k = i ; k <= j ; k ++ ) { sum += arr [ k ] ; } } } return sum ; } public static void Main ( ) { int [ ] arr = { 1 , 5 , 3 , 1 , 2 } ; Console . Write ( OddLengthSum ( arr ) ) ; } }

Index/key variables: k
Accumulator variables: i, j, k, sum
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int OddLengthSum ( int [ ] arr ) { int sum = 0 ; int l = arr . Length ; for ( int i = 0 ; i < l ; i ++ ) { sum += ( ( ( i + 1 ) * ( l - i ) + 1 ) / 2 ) * arr [ i ] ; } return sum ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 5 , 3 , 1 , 2 } ; Console . Write ( OddLengthSum ( arr ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int phi ( int n ) { int result = 1 ; for ( int p = 2 ; p < n ; p ++ ) { if ( __gcd ( p , n ) == 1 ) { result ++ ; } } return result ; } static bool sameEulerTotient ( int n ) { return phi ( n ) == phi ( 2 * n ) ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } public static void Main ( String [ ] args ) { int N = 13 ; if ( sameEulerTotient ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: p, result
Iterator variables: p
Class/struct names: GFG
C# program:
using System ; class GFG { static int sameEulerTotient ( int N ) { return ( N & 1 ) ; } public static void Main ( String [ ] args ) { int N = 13 ; if ( sameEulerTotient ( N ) == 1 ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void solve ( int [ ] arr , int N ) { Dictionary < int , int > M = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { M . Add ( i , arr [ i ] ) ; } Array . Sort ( arr ) ; Dictionary < int , int > Count = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { Count . Add ( arr [ i ] , ( int ) Math . Pow ( 2 , N - i - 1 ) ) ; } foreach ( KeyValuePair < int , int > m in M ) { Console . Write ( Count [ m . Value ] ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 2 , 1 } ; int N = arr . Length ; solve ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, m
Class/struct names: GFG
C# program:
using System ; using System . Text ; class GFG { static bool checkOdd ( char ch ) { return ( ( ch - '0' ) & 1 ) != 0 ? true : false ; } static String Insert_dash ( String num_str ) { StringBuilder result_str = new StringBuilder ( num_str ) ; for ( int x = 0 ; x < num_str . Length - 1 ; x ++ ) { if ( checkOdd ( num_str [ x ] ) && checkOdd ( num_str [ x + 1 ] ) ) { result_str . Insert ( x + 1 , " - " ) ; num_str = result_str . ToString ( ) ; x ++ ; } } return result_str . ToString ( ) ; } public static void Main ( String [ ] args ) { String str = "1745389" ; Console . WriteLine ( Insert_dash ( str ) ) ; } }

Index/key variables: x
Accumulator variables: x
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; class GFG { static int N = 3 , M = 3 ; static bool checkReverseBitonic ( int [ ] arr , int n ) { int i , j , f = 0 ; for ( i = 1 ; i < n ; i ++ ) { if ( arr [ i ] < arr [ i - 1 ] ) continue ; if ( arr [ i ] == arr [ i - 1 ] ) return false ; else { f = 1 ; break ; } } if ( i == n ) return true ; for ( j = i + 1 ; j < n ; j ++ ) { if ( arr [ j ] > arr [ j - 1 ] ) continue ; if ( arr [ i ] == arr [ i - 1 ] ) return false ; else { if ( f == 1 ) return false ; } } return true ; } static void check ( int [ , ] arr ) { for ( int i = 0 ; i < N ; i ++ ) { if ( ! checkReverseBitonic ( GetRow ( arr , i ) , M ) ) { Console . Write ( " No " + " STRNEWLINE " ) ; return ; } } for ( int i = 0 ; i < N ; i ++ ) { int [ ] temp = new int [ N ] ; for ( int j = 0 ; j < N ; j ++ ) { temp [ j ] = arr [ j , i ] ; } if ( ! checkReverseBitonic ( temp , N ) ) { Console . Write ( " No " + " STRNEWLINE " ) ; return ; } } Console . Write ( " Yes " ) ; } public static int [ ] GetRow ( int [ , ] matrix , int row ) { var rowLength = matrix . GetLength ( 1 ) ; var rowVector = new int [ rowLength ] ; for ( var i = 0 ; i < rowLength ; i ++ ) rowVector [ i ] = matrix [ row , i ] ; return rowVector ; } public static void Main ( String [ ] args ) { int [ , ] m = { { 2 , 3 , 4 } , { 1 , 2 , 3 } , { 4 , 5 , 6 } } ; check ( m ) ; } }

Index/key variables: N, i, j, rowLength
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int SpiralElement ( int x , int y ) { int r ; if ( x < y ) { if ( y % 2 == 1 ) { r = y * y ; return ( r - x + 1 ) ; } else { r = ( y - 1 ) * ( y - 1 ) ; return ( r + x ) ; } } else { if ( x % 2 == 0 ) { r = x * x ; return ( r - y + 1 ) ; } else { r = ( x - 1 ) * ( x - 1 ) ; return ( r + y ) ; } } } static public void Main ( ) { int x = 2 , y = 3 ; Console . WriteLine ( SpiralElement ( x , y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void string_modify ( char [ ] s ) { char [ ] alphabets = new char [ 26 ] ; int flag = 0 , hold_i = 0 ; char hold_l = ( char ) 0 ; int i ; for ( i = 0 ; i < 26 ; i ++ ) { alphabets [ i ] = ( char ) ( i + ' a ' ) ; } HashSet < int > difference = new HashSet < int > ( ) ; String reconstruct = " " ; for ( i = 1 ; i < s . Length ; i ++ ) { difference . Add ( s [ i ] - s [ i - 1 ] ) ; } if ( difference . Count == 1 ) { Console . Write ( " No ▁ modifications ▁ required " ) ; return ; } foreach ( int it in difference ) { int index = s [ 0 ] - ' a ' ; reconstruct = " " ; flag = 0 ; for ( i = 0 ; i < s . Length && flag <= 1 ; i ++ ) { reconstruct += alphabets [ index ] ; index += it ; if ( index < 0 ) { index += 26 ; } index %= 26 ; if ( reconstruct [ i ] != s [ i ] ) { flag ++ ; hold_i = i ; hold_l = s [ i ] ; } } if ( flag == 1 ) { s [ hold_i ] = reconstruct [ hold_i ] ; break ; } } if ( flag < 1 ) { hold_i = 0 ; hold_l = s [ 0 ] ; int temp = ( s [ 1 ] - ' a ' - ( s [ 2 ] - s [ 1 ] ) ) % 26 ; if ( temp < 0 ) { temp += 26 ; } s [ 0 ] = alphabets [ temp ] ; } Console . Write ( hold_i + " ▁ - > ▁ " + hold_l + " STRNEWLINE " + String . Join ( " " , s ) + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { String s = " aeimqux " ; string_modify ( s . ToCharArray ( ) ) ; } }

Index/key variables: hold_i, i, index, temp
Accumulator variables: flag, i, index, reconstruct, temp
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static void evenSubMatrix ( int N ) { int even = 1 ; int odd = 2 ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { if ( ( i + j ) % 2 == 0 ) { Console . Write ( even + " ▁ " ) ; even += 2 ; } else { Console . Write ( odd + " ▁ " ) ; odd += 2 ; } } Console . WriteLine ( ) ; } } public static void Main ( String [ ] args ) { int N = 4 ; evenSubMatrix ( N ) ; } }

Accumulator variables: even, i, j, odd
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Text . RegularExpressions ; class GFG { public static void removeLeadingZeros ( string str ) { string regex = " ^ 0 + ( ? ! $ ) " ; str = Regex . Replace ( str , regex , " " ) ; Console . WriteLine ( str ) ; } public static void Main ( string [ ] args ) { string str = "0001234" ; removeLeadingZeros ( str ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void maximum_inversion ( int n , int k ) { int answer = 0 ; k = Math . Min ( k , n / 2 ) ; int left = 1 ; int right = n ; while ( k != 0 ) { k -- ; answer += 2 * ( right - left ) - 1 ; left ++ ; right -- ; } Console . WriteLine ( answer ) ; } public static void Main ( String [ ] s ) { int N = 5 ; int K = 3 ; maximum_inversion ( N , K ) ; N = 4 ; K = 1 ; maximum_inversion ( N , K ) ; } }

Accumulator variables: answer, k, left, right
Class/struct names: GFG
C# program:
using System ; class GFG { static int getFirstSetBitPos ( int n ) { return ( int ) ( Math . Log ( n & - n ) / Math . Log ( 2 ) ) ; } static int oddFirst ( int a , int b ) { int steps_a = getFirstSetBitPos ( a ) ; int steps_b = getFirstSetBitPos ( b ) ; if ( steps_a == steps_b ) { return - 1 ; } else if ( steps_a > steps_b ) { return b ; } else { return a ; } } public static void Main ( ) { int a = 10 ; int b = 8 ; Console . Write ( oddFirst ( a , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool helper ( String s , int pos ) { int len = s . Length ; if ( pos >= len ) return true ; if ( ! char . IsDigit ( s [ pos ] ) ) return false ; int num = 0 ; for ( int i = pos ; i < len ; i ++ ) { num = num * 10 + s [ pos ] - '0' ; if ( i + 1 + num > len ) return false ; if ( helper ( s , i + 1 + num ) ) return true ; } return false ; } public static void Main ( String [ ] args ) { String s = "123abc4db1c " ; if ( helper ( s , 0 ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: pos
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static long [ ] N_bonacci = new long [ 100 ] ; static void N_bonacci_nums ( long n , long k ) { N_bonacci [ 0 ] = 1 ; for ( int i = 1 ; i <= 50 ; ++ i ) { for ( int j = i - 1 ; j >= i - k && j >= 0 ; -- j ) N_bonacci [ i ] += N_bonacci [ j ] ; } List < long > ans = new List < long > ( ) ; for ( int i = 50 ; i >= 0 ; -- i ) if ( n - N_bonacci [ i ] >= 0 ) { ans . Add ( N_bonacci [ i ] ) ; n -= N_bonacci [ i ] ; } if ( ans . Count == 1 ) ans . Add ( 0 ) ; Console . WriteLine ( ans . Count ) ; for ( int i = 0 ; i < ans . Count ; ++ i ) Console . Write ( ans [ i ] + " , ▁ " ) ; } static void Main ( ) { long n = 21 , k = 5 ; N_bonacci_nums ( n , k ) ; } }

Index/key variables: i, j
Accumulator variables: n
Iterator variables: i, j
Class/struct names: GFG
C# program:
import java . . * ; class GFG { static void solve ( int n , int k ) { int x1 , d ; d = k * ( k + 1 ) ; if ( ( 2 * n ) % d != 0 ) { System . out . print ( " - 1" ) ; return ; } x1 = 2 * n / d ; for ( int i = 1 ; i <= k ; i ++ ) { System . out . print ( x1 * i + " ▁ " ) ; } System . out . println ( ) ; } public static void main ( String [ ] args ) { int n = 10 , k = 4 ; solve ( n , k ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int checkBitonic ( char [ ] s ) { int i , j ; for ( i = 1 ; i < s . Length ; i ++ ) { if ( s [ i ] > s [ i - 1 ] ) continue ; if ( s [ i ] <= s [ i - 1 ] ) break ; } if ( i == s . Length - 1 ) return 1 ; for ( j = i + 1 ; j < s . Length ; j ++ ) { if ( s [ j ] < s [ j - 1 ] ) continue ; if ( s [ j ] >= s [ j - 1 ] ) break ; } i = j ; if ( i != s . Length ) return 0 ; return 1 ; } public static void Main ( String [ ] args ) { String s = " abcdfgcba " ; Console . Write ( ( checkBitonic ( s . ToCharArray ( ) ) == 1 ) ? " YES " : " NO " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void solve ( int N ) { if ( N % 2 == 0 ) { Console . Write ( N / 2 + " ▁ " + N + " STRNEWLINE " ) ; } else { Console . Write ( ( N - 1 ) / 2 + " ▁ " + ( N - 1 ) + " STRNEWLINE " ) ; } } public static void Main ( String [ ] args ) { int N = 10 ; solve ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static void findArray ( int [ ] a , int n , int P ) { int mi = a . Min ( ) ; int ctr = 0 ; mi = Math . Max ( 0 , mi - 1 ) ; int i ; for ( i = 0 ; i < n ; i ++ ) { a [ i ] -= mi ; ctr += mi ; } i = P - 1 ; int start = - 1 ; while ( true ) { if ( a [ i ] == 0 ) { start = i ; break ; } a [ i ] -= 1 ; ctr += 1 ; i = ( i - 1 + n ) % n ; } a [ start ] = ctr ; for ( i = 0 ; i < n ; i ++ ) { Console . Write ( a [ i ] + " , ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 5 ; int P = 2 ; int [ ] arr = { 3 , 2 , 0 , 2 , 7 } ; findArray ( arr , N , P ) ; } }

Index/key variables: i, start
Accumulator variables: ctr, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void makeArray ( int [ ] a , int n ) { for ( int i = 1 ; i <= n ; i ++ ) Console . Write ( i * n + " ▁ " ) ; } public static void Main ( ) { int N = 6 ; int [ ] arr = new int [ N ] ; makeArray ( arr , N ) ; } }

Index/key variables: N
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int printOddFactorNumber ( int n , int m ) { for ( int i = n ; i <= m ; i ++ ) { if ( ( i > 0 ) && ( ( i & ( i - 1 ) ) != 0 ) ) Console . Write ( i + " ▁ " ) ; } return 0 ; } public static void Main ( ) { int N = 2 , M = 10 ; printOddFactorNumber ( N , M ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printSeries ( int n ) { int k = 2 ; for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( k * ( 2 * k - 1 ) + " ▁ " ) ; k += 2 ; } Console . WriteLine ( ) ; } public static void Main ( ) { int N = 12 ; printSeries ( N ) ; } }

Accumulator variables: i, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int k1 = 2 ; static int k2 = 2 ; static int gap = 5 ; static int printPattern ( int i , int j , int n ) { if ( j >= n ) { k1 = 2 ; k2 = 2 ; k1 -- ; k2 ++ ; if ( i == 2 ) { k1 = 0 ; k2 = n - 1 ; } return 0 ; } if ( i >= 3 ) { return 1 ; } if ( j > k2 ) { k1 += gap ; k2 += gap ; } if ( j >= k1 && j <= k2 i == 2 ) { Console . Write ( " * " ) ; } else { Console . Write ( " ▁ " ) ; } if ( printPattern ( i , j + 1 , n ) == 1 ) { return 1 ; } Console . WriteLine ( ) ; return printPattern ( i + 1 , 0 , n ) ; } static void Main ( ) { int N = 3 ; printPattern ( 0 , 0 , N * 5 ) ; } }

Accumulator variables: k1, k2
Class/struct names: GFG