dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static void countPairs ( int [ ] A , int n ) { long count = ( n * ( n - 1 ) ) / 2 ; Dictionary < long , long > ump = new Dictionary < long , long > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ump . ContainsKey ( A [ i ] ) ) { ump [ A [ i ] ] ++ ; } else { ump [ A [ i ] ] = 1 ; } } foreach ( KeyValuePair < long , long > it in ump ) { long c = it . Value ; count = count - ( c * ( c - 1 ) ) / 2 ; } Console . WriteLine ( count ) ; } static void Main ( ) { int [ ] A = { 1 , 4 , 7 } ; int N = A . Length ; countPairs ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static string check ( int current_row , int current_col , int destination_row , int destination_col ) { if ( current_row == destination_row ) return " POSSIBLE " ; else if ( current_col == destination_col ) return " POSSIBLE " ; else return " NOT ▁ POSSIBLE " ; } public static void Main ( ) { int current_row = 8 ; int current_col = 8 ; int destination_row = 8 ; int destination_col = 4 ; string output = check ( current_row , current_col , destination_row , destination_col ) ; Console . WriteLine ( output ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int isDiv ( int N , int X , int M , int res ) { if ( X == 0 ) { if ( N % M == 0 ) { res = N ; return res ; } return res ; } for ( int i = 0 ; i < 9 ; i ++ ) { int temp = isDiv ( N * 10 + i , X - 1 , M , res ) ; if ( temp != - 1 ) { return temp ; } } return res ; } public static void Main ( ) { int N = 4 , M = 50 , X = 2 ; int res = - 1 ; res = isDiv ( N , X , M , res ) ; Console . WriteLine ( res ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void minimumMoves ( int [ ] arr , int N ) { int sum = 0 ; int maxelement = - 1 ; if ( N == 2 ) { Console . Write ( "0" ) ; return ; } for ( int i = 0 ; i < N ; i ++ ) { sum += arr [ i ] ; maxelement = Math . Max ( maxelement , arr [ i ] ) ; } int k = ( sum + N - 2 ) / ( N - 1 ) ; k = Math . Max ( maxelement , k ) ; int ans = k * ( N - 1 ) - sum ; Console . WriteLine ( ans ) ; } static void Main ( ) { int [ ] arr = { 2 , 3 , 7 } ; int N = arr . Length ; minimumMoves ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void printSubsequence ( int N ) { Console . Write ( " { ▁ " ) ; for ( int i = 1 ; i < N - 1 ; i ++ ) { Console . Write ( i + " , ▁ " ) ; } Console . WriteLine ( N - 1 + " ▁ } " ) ; Console . Write ( " { ▁ " + N + " ▁ } " ) ; } public static void Main ( string [ ] args ) { int N = 8 ; printSubsequence ( N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void array_divisbleby_k ( int N , int K ) { bool flag = false ; int d1 = 0 , d2 = 0 ; for ( int i = 2 ; i * i <= K ; i ++ ) { if ( K % i == 0 ) { flag = true ; d1 = i ; d2 = K / i ; break ; } } if ( flag ) { for ( int i = 0 ; i < N ; i ++ ) { if ( i % 2 == 1 ) { Console . Write ( d2 + " ▁ " ) ; } else { Console . Write ( d1 + " ▁ " ) ; } } } else { Console . Write ( - 1 ) ; } } public static void Main ( string [ ] args ) { int N = 5 , K = 21 ; array_divisbleby_k ( N , K ) ; } }

Accumulator variables: i
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void addEdge ( List < int > [ ] adj , int u , int v ) { adj [ u ] . Add ( v ) ; adj [ v ] . Add ( u ) ; } static int cnt = 0 ; static bool [ ] visited ; static void DFS ( int u , List < int > [ ] adj , int [ ] fre , String S ) { visited [ u ] = true ; cnt ++ ; fre [ S [ u ] - ' a ' ] ++ ; for ( int i = 0 ; i < adj [ u ] . Count ; i ++ ) { if ( ! visited [ adj [ u ] [ i ] ] ) { DFS ( adj [ u ] [ i ] , adj , fre , S ) ; } } } static void minimumOperations ( String S , int m ) { int V = 100 ; List < int > [ ] adj = new List < int > [ V ] ; int total = 0 , N = S . Length ; for ( int i = 0 ; i < adj . Length ; i ++ ) adj [ i ] = new List < int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { addEdge ( adj , i , N - i - 1 ) ; addEdge ( adj , N - i - 1 , i ) ; } for ( int i = 0 ; i < N - m ; i ++ ) { addEdge ( adj , i , i + m ) ; addEdge ( adj , i + m , i ) ; } visited = new bool [ V ] ; for ( int i = 0 ; i < N ; i ++ ) { if ( ! visited [ i ] ) { int [ ] fre = new int [ 26 ] ; cnt = 0 ; int maxx = - 1 ; DFS ( i , adj , fre , S ) ; for ( int j = 0 ; j < 26 ; j ++ ) maxx = Math . Max ( maxx , fre [ j ] ) ; total += cnt - maxx ; } } Console . Write ( total ) ; } public static void Main ( String [ ] args ) { String S = " abaaba " ; int K = 2 ; minimumOperations ( S , K ) ; } }

Index/key variables: V, i, j, u, v
Accumulator variables: cnt, i, j, total
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void print ( char [ , ] arr , int n , int m ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { char a = arr [ i , j ] ; if ( ( i + j ) % 2 == 0 && a == ' F ' ) { arr [ i , j ] = '1' ; } else if ( a == ' F ' ) { arr [ i , j ] = '2' ; } } } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { Console . Write ( arr [ i , j ] ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int n = 4 , m = 4 ; char [ , ] arr = { { ' F ' , ' F ' , ' F ' , ' F ' } , { ' F ' , ' O ' , ' F ' , ' F ' } , { ' F ' , ' F ' , ' O ' , ' F ' } , { ' F ' , ' F ' , ' F ' , ' F ' } } ; print ( arr , n , m ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static string removeDuplicateLetters ( string s ) { int [ ] cnt = new int [ 26 ] ; int [ ] vis = new int [ 26 ] ; int n = s . Length ; for ( int i = 0 ; i < n ; i ++ ) cnt [ s [ i ] - ' a ' ] ++ ; String res = " " ; for ( int i = 0 ; i < n ; i ++ ) { cnt [ s [ i ] - ' a ' ] -- ; if ( vis [ s [ i ] - ' a ' ] == 0 ) { int size = res . Length ; while ( size > 0 && res [ size - 1 ] > s [ i ] && cnt [ res [ size - 1 ] - ' a ' ] > 0 ) { vis [ res [ size - 1 ] - ' a ' ] = 0 ; res = res . Substring ( 0 , size - 1 ) ; size -- ; } res += s [ i ] ; vis [ s [ i ] - ' a ' ] = 1 ; } } return res ; } public static void Main ( ) { string S = " acbc " ; Console . WriteLine ( removeDuplicateLetters ( S ) ) ; } }

Index/key variables: i
Accumulator variables: i, res, size
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static void countPairs ( int [ ] arr , int N ) { int countPowerof2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( Convert . ToString ( arr [ i ] , 2 ) ) . Count ( f => ( f == '1' ) ) == 1 ) countPowerof2 ++ ; } int desiredPairs = ( countPowerof2 * ( countPowerof2 - 1 ) ) / 2 ; Console . WriteLine ( desiredPairs + " ▁ " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 4 , 7 , 2 } ; int N = arr . Length ; countPairs ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: countPowerof2, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAXN = 1000000 ; static int [ ] is_prime ; static int [ ] count_of_primes ; static void sieve ( ) { is_prime = new int [ MAXN ] ; count_of_primes = new int [ MAXN ] ; Array . Fill ( is_prime , 0 ) ; Array . Fill ( count_of_primes , 0 ) ; for ( int i = 3 ; i < MAXN ; i += 2 ) { is_prime [ i ] = 1 ; } for ( int i = 3 ; i * i < MAXN ; i += 2 ) { if ( is_prime [ i ] == 1 ) { for ( int j = i * i ; j < MAXN ; j += i ) { is_prime [ j ] = 0 ; } } } is_prime [ 2 ] = 1 ; for ( int i = 1 ; i < MAXN ; i ++ ) count_of_primes [ i ] = count_of_primes [ i - 1 ] + is_prime [ i ] ; } static long power ( long x , long y , long p ) { long result = 1 ; while ( y > 0 ) { if ( ( y & 1 ) == 1 ) result = ( result * x ) % p ; x = ( x * x ) % p ; y >>= 1 ; } return result ; } static void numberOfWays ( int N ) { long count = count_of_primes [ N ] - 1 ; long mod = 1000000007 ; long answer = power ( 2 , count , mod ) ; if ( N == 1 ) answer = 0 ; long ans = answer ; Console . Write ( ans ) ; } public static void Main ( ) { sieve ( ) ; int N = 7 ; numberOfWays ( N ) ; } }

Index/key variables: MAXN, N, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void maxSumOfSquares ( int N , int S ) { int res = 0 ; if ( S < N S > 9 * N ) { Console . WriteLine ( - 1 ) ; return ; } S = S - N ; int c = 0 ; while ( S > 0 ) { c ++ ; if ( S / 8 > 0 ) { res += 9 * 9 ; S -= 8 ; } else { res += ( S + 1 ) * ( S + 1 ) ; break ; } } res = res + ( N - c ) ; Console . WriteLine ( res ) ; } public static void Main ( String [ ] args ) { int N = 3 ; int S = 12 ; maxSumOfSquares ( N , S ) ; } }

Accumulator variables: S, c, res
Class/struct names: GFG
C# program:
using System ; class GFG { static int clearLastBit ( int N , int K ) { int mask = ( - 1 << K + 1 ) ; return N = N & mask ; } public static void Main ( String [ ] args ) { int N = 730 , K = 3 ; Console . Write ( clearLastBit ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPossible ( int r , int b , int g ) { r = r % 3 ; b = b % 3 ; g = g % 3 ; if ( r == b b == g g == r ) { return true ; } else { return false ; } } public static void Main ( String [ ] args ) { int R = 1 , B = 3 , G = 6 ; if ( isPossible ( R , B , G ) ) { Console . Write ( " Yes " + " STRNEWLINE " ) ; } else { Console . Write ( " No " + " STRNEWLINE " ) ; } } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int calculate_steps ( int [ ] arr , int n , int minimum ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int val = arr [ i ] ; if ( arr [ i ] > minimum ) { arr [ i ] = arr [ i ] - minimum ; count += arr [ i ] / 5 ; arr [ i ] = arr [ i ] % 5 ; count += arr [ i ] / 2 ; arr [ i ] = arr [ i ] % 2 ; if ( arr [ i ] > 0 ) { count ++ ; } } arr [ i ] = val ; } return count ; } static int solve ( int [ ] arr , int n ) { Array . Sort ( arr ) ; Array . Reverse ( arr ) ; int minimum = arr [ n - 1 ] ; int count1 = 0 , count2 = 0 , count3 = 0 ; count1 = calculate_steps ( arr , n , minimum ) ; count2 = calculate_steps ( arr , n , minimum - 1 ) ; count3 = calculate_steps ( arr , n , minimum - 2 ) ; return Math . Min ( count1 , Math . Min ( count2 , count3 ) ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 6 , 6 } ; int N = arr . Length ; Console . Write ( solve ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Text ; class GFG { static string mergePalindromes ( string S , string P ) { Dictionary < char , int > mapS = new Dictionary < char , int > ( ) ; Dictionary < char , int > mapP = new Dictionary < char , int > ( ) ; Dictionary < char , int > mapT = new Dictionary < char , int > ( ) ; int n = S . Length , m = P . Length ; for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { mapS [ i ] = 0 ; mapP [ i ] = 0 ; mapT [ i ] = 0 ; } for ( int i = 0 ; i < n ; i ++ ) { mapS [ S [ i ] ] ++ ; } for ( int i = 0 ; i < m ; i ++ ) { mapP [ P [ i ] ] ++ ; } for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { if ( mapS [ i ] % 2 == 0 ) { mapT [ i ] += mapS [ i ] ; mapS [ i ] = 0 ; } else { mapT [ i ] += mapS [ i ] - 1 ; mapS [ i ] = 1 ; } if ( mapP [ i ] % 2 == 0 ) { mapT [ i ] += mapP [ i ] ; mapP [ i ] = 0 ; } else { mapT [ i ] += mapP [ i ] - 1 ; mapP [ i ] = 1 ; } } int check = 0 ; for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { if ( mapS [ i ] > 0 && mapP [ i ] > 0 ) { mapT [ i ] += 2 ; check = 1 ; break ; } } string half1 = " " , half2 = " " ; for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { for ( int j = 0 ; ( 2 * j ) < mapT [ i ] ; j ++ ) { half1 += i ; half2 += i ; } } char [ ] tmp = half2 . ToCharArray ( ) ; Array . Reverse ( tmp ) ; half2 = new string ( tmp ) ; if ( check != 0 ) { return half1 + half2 ; } for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { if ( mapS [ i ] > 0 mapP [ i ] > 0 ) { half1 += i ; return half1 + half2 ; } } return half1 + half2 ; } public static void Main ( string [ ] args ) { string S = " aeabb " ; string P = " dfedf " ; Console . Write ( mergePalindromes ( S , P ) ) ; } }

Index/key variables: i
Accumulator variables: half1, half2, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int countOfSubarray ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) arr [ i ] -- ; int [ ] pref = new int [ N ] ; pref [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) pref [ i ] = pref [ i - 1 ] + arr [ i ] ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; int answer = 0 ; mp . Add ( 0 , 1 ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( mp . ContainsKey ( pref [ i ] ) ) { answer += mp [ pref [ i ] ] ; mp [ pref [ i ] ] = mp [ pref [ i ] ] + 1 ; } else { mp . Add ( pref [ i ] , 1 ) ; } } return answer ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 1 , 0 } ; int N = arr . Length ; Console . Write ( countOfSubarray ( arr , N ) ) ; } }

Index/key variables: N, i
Accumulator variables: answer, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System . Collections . Generic ; using System ; class GFG { static void printsubset ( int n , int k ) { int count = 0 , x = 0 ; List < int > vec = new List < int > ( ) ; while ( n != 0 ) { x = n & 1 ; if ( x != 0 ) { vec . Add ( ( int ) Math . Pow ( k , count ) ) ; } n = n >> 1 ; count ++ ; } for ( int i = 0 ; i < vec . Count ; i ++ ) Console . Write ( vec [ i ] + " ▁ " ) ; } public static void Main ( ) { int n = 7 , k = 4 ; printsubset ( n , k ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int solve ( String s , int x , int y ) { int res = 0 ; foreach ( char c in s . ToCharArray ( ) ) { if ( c - '0' == x ) { res ++ ; x = x + y ; y = x - y ; x = x - y ; } } if ( x != y && res % 2 == 1 ) -- res ; return res ; } static int find_min ( String s ) { int count = 0 ; for ( int i = 0 ; i < 10 ; i ++ ) { for ( int j = 0 ; j < 10 ; j ++ ) { count = Math . Max ( count , solve ( s , i , j ) ) ; } } return count ; } public static void Main ( String [ ] args ) { String s = "100120013" ; int n = s . Length ; int answer = find_min ( s ) ; Console . Write ( ( n - answer ) ) ; } }

Accumulator variables: i, j, res
Iterator variables: c, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSetBitsUtil ( int x ) { if ( x <= 0 ) return 0 ; return ( ( x % 2 == 0 ? 0 : 1 ) + countSetBitsUtil ( x / 2 ) ) ; } static int countSetBits ( int L , int R ) { int bitCount = 0 ; for ( int i = L ; i <= R ; i ++ ) { bitCount += countSetBitsUtil ( i ) ; } return bitCount ; } public static void Main ( String [ ] args ) { int L = 3 , R = 5 ; Console . Write ( " Total ▁ set ▁ bit ▁ count ▁ is ▁ { 0 } " , countSetBits ( L , R ) ) ; } }

Accumulator variables: bitCount, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void values_of_Q ( int X ) { List < int > val_Q = new List < int > ( ) ; for ( int i = 1 ; i <= X ; i ++ ) { if ( ( ( ( X + i ) * X ) ) % i == 0 ) { val_Q . Add ( X + i ) ; } } Console . WriteLine ( val_Q . Count ) ; for ( int i = 0 ; i < val_Q . Count ; i ++ ) { Console . Write ( val_Q [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int X = 3 ; values_of_Q ( X ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static String gcd ( String str1 , String str2 ) { if ( str1 . Length < str2 . Length ) { return gcd ( str2 , str1 ) ; } else if ( ! str1 . StartsWith ( str2 ) ) { return " " ; } else if ( str2 . Length == 0 ) { return str1 ; } else { return gcd ( str1 . Substring ( str2 . Length ) , str2 ) ; } } static String findGCD ( String [ ] arr , int n ) { String result = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { result = gcd ( result , arr [ i ] ) ; } return result ; } public static void Main ( String [ ] args ) { String [ ] arr = new String [ ] { " GFGGFG " , " GFGGFG " , " GFGGFGGFGGFG " } ; int n = arr . Length ; Console . WriteLine ( findGCD ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int N = 4 ; static readonly int M = 4 ; static String balancedMatrix ( int [ , ] mat ) { bool is_balanced = true ; for ( int i = 0 ; i < N && is_balanced ; i ++ ) { for ( int j = 0 ; j < M && is_balanced ; j ++ ) { if ( ( i == 0 i == N - 1 ) && ( j == 0 j == M - 1 ) ) { if ( mat [ i , j ] >= 2 ) is_balanced = false ; } else if ( i == 0 i == N - 1 j == 0 j == M - 1 ) { if ( mat [ i , j ] >= 3 ) is_balanced = false ; } else { if ( mat [ i , j ] >= 4 ) is_balanced = false ; } } } if ( is_balanced ) return " Balanced " ; else return " Unbalanced " ; } public static void Main ( String [ ] args ) { int [ , ] mat = { { 1 , 2 , 3 , 4 } , { 3 , 5 , 2 , 6 } , { 5 , 3 , 6 , 1 } , { 9 , 5 , 6 , 0 } } ; Console . Write ( balancedMatrix ( mat ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Boolean variables: is_balanced
Class/struct names: GFG
C# program:
using System ; class GFG { static String unixTimeToHumanReadable ( int seconds ) { String ans = " " ; int [ ] daysOfMonth = { 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; int currYear , daysTillNow , extraTime , extraDays , index , date , month , hours , minutes , secondss , flag = 0 ; daysTillNow = seconds / ( 24 * 60 * 60 ) ; extraTime = seconds % ( 24 * 60 * 60 ) ; currYear = 1970 ; while ( daysTillNow >= 365 ) { if ( currYear % 400 == 0 || ( currYear % 4 == 0 && currYear % 100 != 0 ) ) { daysTillNow -= 366 ; } else { daysTillNow -= 365 ; } currYear += 1 ; } extraDays = daysTillNow + 1 ; if ( currYear % 400 == 0 || ( currYear % 4 == 0 && currYear % 100 != 0 ) ) flag = 1 ; month = 0 ; index = 0 ; if ( flag == 1 ) { while ( true ) { if ( index == 1 ) { if ( extraDays - 29 < 0 ) break ; month += 1 ; extraDays -= 29 ; } else { if ( extraDays - daysOfMonth [ index ] < 0 ) { break ; } month += 1 ; extraDays -= daysOfMonth [ index ] ; } index += 1 ; } } else { while ( true ) { if ( extraDays - daysOfMonth [ index ] < 0 ) { break ; } month += 1 ; extraDays -= daysOfMonth [ index ] ; index += 1 ; } } if ( extraDays > 0 ) { month += 1 ; date = extraDays ; } else { if ( month == 2 && flag == 1 ) date = 29 ; else { date = daysOfMonth [ month - 1 ] ; } } hours = extraTime / 3600 ; minutes = ( extraTime % 3600 ) / 60 ; secondss = ( extraTime % 3600 ) % 60 ; ans += String . Join ( " " , date ) ; ans += " / " ; ans += String . Join ( " " , month ) ; ans += " / " ; ans += String . Join ( " " , currYear ) ; ans += " ▁ " ; ans += String . Join ( " " , hours ) ; ans += " : " ; ans += String . Join ( " " , minutes ) ; ans += " : " ; ans += String . Join ( " " , secondss ) ; return ans ; } public static void Main ( String [ ] args ) { int T = 1595497956 ; String ans = unixTimeToHumanReadable ( T ) ; Console . Write ( ans + " STRNEWLINE " ) ; } }

Index/key variables: index
Accumulator variables: ans, currYear, daysTillNow, extraDays, index, month
Class/struct names: GFG
C# program:
using System ; class GFG { static double AreaofRectangle ( int L , int W ) { double area = ( W + L ) * ( W + L ) / 2 ; return area ; } public static void Main ( String [ ] args ) { int L = 18 ; int W = 12 ; Console . Write ( AreaofRectangle ( L , W ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int downToZero ( int n ) { if ( n <= 3 ) return n ; int [ ] dp = new int [ n + 1 ] ; for ( int i = 0 ; i < n + 1 ; i ++ ) dp [ i ] = - 1 ; dp [ 0 ] = 0 ; dp [ 1 ] = 1 ; dp [ 2 ] = 2 ; dp [ 3 ] = 3 ; int sqr ; for ( int i = 4 ; i <= n ; i ++ ) { sqr = ( int ) Math . Sqrt ( i ) ; int best = int . MaxValue ; while ( sqr > 1 ) { if ( i % sqr == 0 ) { best = Math . Min ( best , 1 + dp [ sqr ] ) ; } sqr -- ; } best = Math . Min ( best , 1 + dp [ i - 1 ] ) ; dp [ i ] = best ; } return dp [ n ] ; } public static void Main ( String [ ] args ) { int n = 4 ; Console . Write ( downToZero ( n ) ) ; } }

Index/key variables: i, n, sqr
Accumulator variables: i, sqr
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int downToZero ( int n ) { if ( n <= 3 ) return n ; return n % 2 == 0 ? 3 : 4 ; } public static void Main ( String [ ] args ) { int n = 4 ; Console . WriteLine ( downToZero ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int minimumrequired ( int [ ] A , int N ) { int K = N ; int ans = 0 ; while ( K > 0 ) { if ( K % 2 == 1 ) { ans = K ; break ; } int ispalindrome = 1 ; for ( int i = 0 ; i < K / 2 ; i ++ ) { if ( A [ i ] != A [ K - 1 - i ] ) ispalindrome = 0 ; } if ( ispalindrome == 1 ) { ans = K / 2 ; K /= 2 ; } else { ans = K ; break ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 2 , 1 , 1 , 2 , 2 , 1 } ; int N = a . Length ; Console . WriteLine ( minimumrequired ( a , N ) ) ; } }

Index/key variables: i
Accumulator variables: K, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumOfFactors ( int N ) { int ans = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { int first = i ; int last = ( N / i ) * i ; int factors = ( last - first ) / i + 1 ; int totalContribution = ( ( ( factors ) * ( factors + 1 ) ) / 2 ) * i ; ans += totalContribution ; } return ans ; } public static void Main ( String [ ] args ) { int N = 3 ; Console . WriteLine ( sumOfFactors ( N ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMaxDifference ( int N ) { int M = - 1 ; int maxDiff = 0 ; for ( int i = 0 ; i < N ; i ++ ) { int diff = ( N ^ i ) - ( N & i ) ; if ( diff >= maxDiff ) { maxDiff = diff ; M = i ; } } return M ; } public static void Main ( String [ ] args ) { int N = 6 ; Console . Write ( getMaxDifference ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findM ( int N ) { int M = 0 ; int MSB = ( int ) Math . Log ( N ) ; for ( int i = 0 ; i < MSB ; i ++ ) { if ( ( N & ( 1 << i ) ) == 0 ) M += ( 1 << i ) ; } return M ; } public static void Main ( String [ ] args ) { int N = 6 ; Console . Write ( findM ( N ) ) ; } }

Accumulator variables: M, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double [ , ] cont = new double [ 1000 , 1000 ] ; static void num_of_containers ( int n , double x ) { int count = 0 ; cont [ 1 , 1 ] = x ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { if ( cont [ i , j ] >= ( double ) 1 ) { count ++ ; cont [ i + 1 , j ] += ( cont [ i , j ] - ( double ) 1 ) / ( double ) 2 ; cont [ i + 1 , j + 1 ] += ( cont [ i , j ] - ( double ) 1 ) / ( double ) 2 ; } } } Console . Write ( count ) ; } public static void Main ( String [ ] args ) { int n = 3 ; double x = 5 ; num_of_containers ( n , x ) ; } }

Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static bool findTriplet ( int [ ] arr ) { int n = arr . Length ; Stack < int > st = new Stack < int > ( ) ; int h3 = int . MinValue ; int h1 = int . MaxValue ; for ( int i = n - 1 ; i >= 0 ; i -- ) { h1 = arr [ i ] ; while ( st . Count != 0 && st . Peek ( ) < arr [ i ] ) { h3 = st . Peek ( ) ; st . Pop ( ) ; } st . Push ( arr [ i ] ) ; if ( h1 < h3 ) { return true ; } } return false ; } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 7 , 5 , 6 } ; if ( findTriplet ( arr ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

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