dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void printPermutation ( int [ ] arr , int n , int k ) { bool flag = false ; Array . Sort ( arr ) ; do { int sum = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { sum += arr [ i ] & arr [ i + 1 ] ; } if ( sum >= k ) { flag = true ; for ( int i = 0 ; i < n ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } Console . Write ( " STRNEWLINE " ) ; } } while ( next_permutation ( arr ) ) ; if ( flag == false ) { Console . Write ( " - 1" ) ; } } static bool next_permutation ( int [ ] p ) { for ( int a = p . Length - 2 ; a >= 0 ; -- a ) if ( p [ a ] < p [ a + 1 ] ) for ( int b = p . Length - 1 ; ; -- b ) if ( p [ b ] > p [ a ] ) { int t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; for ( ++ a , b = p . Length - 1 ; a < b ; ++ a , -- b ) { t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; } return true ; } return false ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int K = 8 ; int N = arr . Length ; printPermutation ( arr , N , K ) ; } }

Index/key variables: a, b, i
Accumulator variables: i, sum
Iterator variables: a, b, i
Boolean variables: flag
Class/struct names: GFG
C# program:
using System ; class GFG { static void findSum ( int a , int b , int n ) { if ( n == 1 ) { Console . WriteLine ( a ) ; return ; } int s = a + b ; for ( int i = 0 ; i < n - 2 ; i ++ ) { int x = a ^ b ; s += x ; a = b ; b = x ; } Console . WriteLine ( s ) ; } public static void Main ( ) { int a = 2 , b = 5 , N = 8 ; findSum ( a , b , N ) ; } }

Accumulator variables: i, s
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findSum ( int a , int b , int n ) { int sum = 0 ; int x = a ^ b ; if ( n % 3 == 0 ) { sum = ( n / 3 ) * ( a + b + x ) ; } else if ( n % 3 == 1 ) { sum = ( n / 3 ) * ( a + b + x ) + a ; } else { sum = ( n / 3 ) * ( a + b + x ) + a + b ; } Console . Write ( sum ) ; } public static void Main ( String [ ] args ) { int a = 2 , b = 5 , N = 8 ; findSum ( a , b , N ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int longestLenXORK ( int [ ] arr , int N , int K ) { int prefixXOR = 0 ; int maxLen = 0 ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; mp . Add ( 0 , - 1 ) ; for ( int i = 0 ; i < N ; i ++ ) { prefixXOR ^= arr [ i ] ; if ( mp . ContainsKey ( prefixXOR ^ K ) ) { maxLen = Math . Max ( maxLen , ( i - mp [ prefixXOR ^ K ] ) ) ; } if ( ! mp . ContainsKey ( prefixXOR ) ) { mp . Add ( prefixXOR , i ) ; } } return maxLen ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 4 , 7 , 2 } ; int N = arr . Length ; int K = 1 ; Console . Write ( longestLenXORK ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: i, prefixXOR
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int N = 3 ; static int M = 3 ; static void intializeDiff ( int [ , ] D , int [ , ] A ) { for ( int i = 0 ; i < N ; i ++ ) { D [ i , 0 ] = A [ i , 0 ] ; D [ i , M ] = 0 ; } for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 1 ; j < M ; j ++ ) D [ i , j ] = A [ i , j ] - A [ i , j - 1 ] ; } } static void update ( int [ , ] D , int k , int r1 , int c1 , int r2 , int c2 ) { for ( int i = r1 ; i <= r2 ; i ++ ) { D [ i , c1 ] += k ; D [ i , c2 + 1 ] -= k ; } } static void printArray ( int [ , ] A , int [ , ] D ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 0 ; j < M ; j ++ ) { if ( j == 0 ) A [ i , j ] = D [ i , j ] ; else A [ i , j ] = D [ i , j ] + A [ i , j - 1 ] ; Console . Write ( A [ i , j ] + " ▁ " ) ; } Console . WriteLine ( ) ; } } static void performQueries ( int [ , ] A , List < List < int > > Queries ) { int [ , ] D = new int [ N , M + 1 ] ; intializeDiff ( D , A ) ; int Q = Queries . Count ; for ( int i = 0 ; i < Q ; i ++ ) { update ( D , Queries [ i ] [ 0 ] , Queries [ i ] [ 1 ] , Queries [ i ] [ 2 ] , Queries [ i ] [ 3 ] , Queries [ i ] [ 4 ] ) ; } printArray ( A , D ) ; } static void Main ( ) { int [ , ] A = { { 1 , 2 , 3 } , { 1 , 1 , 0 } , { 4 , - 2 , 2 } } ; List < List < int > > Queries = new List < List < int > > ( ) ; Queries . Add ( new List < int > { 2 , 0 , 0 , 1 , 1 } ) ; Queries . Add ( new List < int > { - 1 , 1 , 0 , 2 , 2 } ) ; performQueries ( A , Queries ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int onesComplement ( int n , int maxElement ) { int bits = ( int ) Math . Floor ( ( Math . Log ( maxElement ) / Math . Log ( 2 ) ) ) + 1 ; return ( ( 1 << bits ) - 1 ) ^ n ; } static int findNumber ( int [ ] arr , int n ) { int res = 0 ; int maxElement = 0 ; for ( int i = 0 ; i < n ; i ++ ) { res = res ^ arr [ i ] ; if ( maxElement < arr [ i ] ) maxElement = arr [ i ] ; } res = onesComplement ( res , maxElement ) ; return ( res ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; int N = arr . Length ; Console . Write ( findNumber ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int [ ] calculateFactorial ( int N ) { int [ ] fact = new int [ ( N + 1 ) ] ; fact [ 0 ] = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { fact [ i ] = fact [ i - 1 ] * i ; } return fact ; } static int cntWaysSelection ( int [ ] arr , int N , int K , int L , int R ) { int cntWays = 0 ; int cntNum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] >= L && arr [ i ] <= R ) { cntNum ++ ; } } int [ ] fact = calculateFactorial ( cntNum ) ; for ( int i = K ; i <= cntNum ; i ++ ) { cntWays += fact [ cntNum ] / ( fact [ i ] * fact [ cntNum - i ] ) ; } return cntWays ; } public static void Main ( ) { int [ ] arr = { 12 , 4 , 6 , 13 , 5 , 10 } ; int N = arr . Length ; int K = 3 ; int L = 4 ; int R = 10 ; Console . WriteLine ( cntWaysSelection ( arr , N , K , L , R ) ) ; } }

Index/key variables: cntNum, i
Accumulator variables: cntNum, cntWays, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int TotalAndPair ( int [ ] arr , int N ) { int totalAND = ( 1 << 30 ) - 1 ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { totalAND &= arr [ i ] & arr [ j ] ; } } return totalAND ; } public static void Main ( ) { int [ ] arr = { 4 , 5 , 12 , 15 } ; int N = arr . Length ; Console . Write ( TotalAndPair ( arr , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, totalAND
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static int smallestDivisorGr1 ( int N ) { for ( int i = 2 ; i <= Math . Sqrt ( N ) ; i ++ ) { if ( N % i == 0 ) { return i ; } } return N ; } static int findValOfNWithOperat ( int N , int K ) { for ( int i = 1 ; i <= K ; i ++ ) { N += smallestDivisorGr1 ( N ) ; } return N ; } public static void Main ( String [ ] args ) { int N = 6 , K = 4 ; Console . Write ( findValOfNWithOperat ( N , K ) ) ; } }

Accumulator variables: N, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int M = 1000000007 ; static int findTripleSum ( int A , int B , int C ) { int sum = 0 ; for ( int i = 1 ; i <= A ; i ++ ) { for ( int j = 1 ; j <= B ; j ++ ) { for ( int k = 1 ; k <= C ; k ++ ) { int prod = ( ( ( i % M ) * ( j % M ) ) % M * ( k % M ) ) % M ; sum = ( sum + prod ) % M ; } } } return sum ; } public static void Main ( ) { int A = 10 ; int B = 100 ; int C = 1000 ; Console . WriteLine ( findTripleSum ( A , B , C ) ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int M = 1000000007 ; static long power ( long x , long N ) { long res = 1 ; while ( N > 0 ) { if ( N % 2 == 1 ) { res = ( res * x ) % M ; } x = ( x * x ) % M ; N = N >> 1 ; } return res ; } static long modinv ( long X ) { return power ( X , M - 2 ) ; } static long findTripleSum ( long A , long B , long C ) { long MMI = modinv ( 8 ) ; long res = 0 ; res = ( ( ( ( A % M * ( A + 1 ) % M ) % M * ( B % M * ( B + 1 ) % M ) % M ) % M * ( C % M * ( C + 1 ) % M ) % M ) % M * MMI ) % M ; return res ; } public static void Main ( String [ ] args ) { long A = 10 ; long B = 100 ; long C = 1000 ; Console . Write ( findTripleSum ( A , B , C ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int getMaximum ( int N , int M , int [ , ] mat ) { int global_max = int . MinValue ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { int row_min = int . MaxValue ; for ( int k = 0 ; k < M ; k ++ ) { int m = Math . Max ( mat [ i , k ] , mat [ j , k ] ) ; row_min = Math . Min ( row_min , m ) ; } global_max = Math . Max ( global_max , row_min ) ; } } return global_max ; } public static void Main ( ) { int [ , ] mat = { { 5 , 0 , 3 , 1 , 2 } , { 1 , 8 , 9 , 1 , 3 } , { 1 , 2 , 3 , 4 , 5 } , { 9 , 1 , 0 , 3 , 7 } , { 2 , 3 , 0 , 6 , 3 } , { 6 , 4 , 1 , 7 , 0 } } ; int N = 6 , M = 5 ; Console . WriteLine ( getMaximum ( N , M , mat ) ) ; } }

Accumulator variables: i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static void makeTree ( List < int > [ ] tree , pair [ ] edges , int N ) { for ( int i = 0 ; i < N - 1 ; i ++ ) { int u = edges [ i ] . first ; int v = edges [ i ] . second ; tree [ u ] . Add ( v ) ; } } static pair dfs ( int node , List < int > [ ] tree ) { int mex = 0 ; int size = 1 ; foreach ( int u in tree [ node ] ) { pair temp = dfs ( u , tree ) ; mex = Math . Max ( mex , temp . first ) ; size += temp . second ; } return new pair ( mex + size , size ) ; } public static void Main ( String [ ] args ) { int N = 7 ; pair [ ] edges = { new pair ( 1 , 4 ) , new pair ( 1 , 5 ) , new pair ( 5 , 2 ) , new pair ( 5 , 3 ) , new pair ( 4 , 7 ) , new pair ( 7 , 6 ) } ; List < int > [ ] tree = new List < int > [ N + 1 ] ; for ( int i = 0 ; i < tree . Length ; i ++ ) tree [ i ] = new List < int > ( ) ; makeTree ( tree , edges , N ) ; Console . Write ( ( dfs ( 1 , tree ) . first ) ) ; } }

Index/key variables: i, node, u
Accumulator variables: i, size
Iterator variables: i, u
Class/struct names: GFG, pair
C# program:
using System ; class GFG { static int divisorCount ( int n ) { int x = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( i == n / i ) x ++ ; else x += 2 ; } } return x ; } static int minvalue_y ( int x ) { int a = divisorCount ( x ) ; int y = x + 1 ; while ( ( a & 1 ) == ( divisorCount ( y ) & 1 ) ) y ++ ; return y ; } public static void Main ( ) { int x = 5 ; Console . WriteLine ( minvalue_y ( x ) ) ; } }

Accumulator variables: i, x, y
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minvalue_y ( int x ) { int n = ( int ) Math . Sqrt ( x ) ; if ( n * n == x ) return x + 1 ; return ( int ) Math . Pow ( n + 1 , 2 ) ; } public static void Main ( ) { int x = 5 ; Console . WriteLine ( minvalue_y ( x ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int alternatingSumOfFirst_N ( int N ) { int alternateSum = 0 ; if ( N % 2 == 0 ) { alternateSum = ( - N ) / 2 ; } else { alternateSum = ( N + 1 ) / 2 ; } return alternateSum ; } public static void Main ( String [ ] args ) { int N = 6 ; Console . Write ( alternatingSumOfFirst_N ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int minStartValue ( int [ ] nums ) { int minValue = 0 ; int sum = 0 ; foreach ( int n in nums ) { sum += n ; minValue = Math . Min ( minValue , sum ) ; } int startValue = 1 - minValue ; return startValue ; } public static void Main ( ) { int [ ] nums = { - 3 , 2 , - 3 , 4 , 2 } ; Console . WriteLine ( minStartValue ( nums ) ) ; } }

Accumulator variables: sum
Iterator variables: n
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int countSubArrayRemove ( int [ ] arr , int N ) { Dictionary < int , int > prefix_element_count = new Dictionary < int , int > ( ) ; Dictionary < int , int > suffix_element_count = new Dictionary < int , int > ( ) ; int total_sum_of_elements = 0 ; for ( int i = N - 1 ; i >= 0 ; i -- ) { total_sum_of_elements += arr [ i ] ; if ( ! suffix_element_count . ContainsKey ( arr [ i ] ) ) suffix_element_count [ arr [ i ] ] = 1 ; else suffix_element_count [ arr [ i ] ] ++ ; } int prefix_sum = 0 ; int suffix_sum = 0 ; int count_subarray_equal_sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { prefix_sum += arr [ i ] ; if ( ! prefix_element_count . ContainsKey ( arr [ i ] ) ) prefix_element_count [ arr [ i ] ] = 1 ; else prefix_element_count [ arr [ i ] ] ++ ; suffix_sum = total_sum_of_elements - prefix_sum ; if ( ! suffix_element_count . ContainsKey ( arr [ i ] ) ) suffix_element_count [ arr [ i ] ] = 0 ; else suffix_element_count [ arr [ i ] ] -= 1 ; int difference = prefix_sum - suffix_sum ; int number_of_subarray_at_i_split = 0 ; if ( prefix_element_count . ContainsKey ( difference ) ) number_of_subarray_at_i_split = prefix_element_count [ difference ] ; if ( suffix_element_count . ContainsKey ( - difference ) ) number_of_subarray_at_i_split += suffix_element_count [ - difference ] ; count_subarray_equal_sum += number_of_subarray_at_i_split ; } return count_subarray_equal_sum ; } public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 2 , 1 , 1 , 3 , 1 } ; int N = arr . Length ; Console . Write ( countSubArrayRemove ( arr , N ) ) ; } }

Index/key variables: difference, i
Accumulator variables: count_subarray_equal_sum, i, number_of_subarray_at_i_split, prefix_sum, total_sum_of_elements
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countXORSetBitsAdjElemRange1_N ( int N ) { int total_set_bits = 0 ; int bit_Position = 1 ; while ( N != 0 ) { total_set_bits += ( ( N + 1 ) / 2 * bit_Position ) ; N -= ( N + 1 ) / 2 ; bit_Position ++ ; } return total_set_bits ; } public static void Main ( ) { int N = 4 ; Console . Write ( countXORSetBitsAdjElemRange1_N ( N ) ) ; } }

Accumulator variables: N, bit_Position, total_set_bits
Class/struct names: GFG
C# program:
using System ; class GFG { static int checkPerfectSquare ( int N ) { if ( N <= 0 ) { return 0 ; } double sq = Math . Sqrt ( N ) ; if ( Math . Floor ( sq ) == Math . Ceiling ( sq ) ) { return 1 ; } return 0 ; } static bool checktwoSidesareRighTriangle ( int A , int B ) { bool checkTriangle = false ; if ( checkPerfectSquare ( A * A + B * B ) != 0 ) { checkTriangle = true ; } if ( checkPerfectSquare ( A * A - B * B ) != 0 ) { checkTriangle = true ; } if ( checkPerfectSquare ( B * B - A * A ) != 0 ) { checkTriangle = true ; } return checkTriangle ; } public static void Main ( ) { int A = 3 , B = 4 ; if ( checktwoSidesareRighTriangle ( A , B ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Boolean variables: checkTriangle
Class/struct names: GFG
C# program:
using System ; class GFG { static int array_sum ( int [ ] arr , int n ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) sum += arr [ i ] ; return sum ; } static int countOperations ( int [ ] arr , int N ) { int count_zeros = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] == 0 ) count_zeros ++ ; } int sum = array_sum ( arr , N ) ; if ( count_zeros != 0 ) return count_zeros ; if ( sum == 0 ) return 1 ; return 0 ; } public static void Main ( ) { int [ ] arr = { - 1 , - 1 , 0 , 0 } ; int N = arr . Length ; Console . Write ( countOperations ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: count_zeros, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int TotalBitwiseORPair ( int [ ] arr , int N ) { int totalOR = 0 ; for ( int i = 0 ; i < N ; i ++ ) { totalOR |= arr [ i ] ; } return totalOR ; } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 5 , 12 , 15 } ; int N = arr . Length ; Console . Write ( TotalBitwiseORPair ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, totalOR
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findDifference ( int [ ] p , int [ ] q , int N ) { int [ ] A = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = i + 1 ; bool IsCorrect ; int a = 1 , b = 1 ; do { IsCorrect = true ; for ( int i = 0 ; i < N ; i ++ ) { if ( A [ i ] != p [ i ] ) { IsCorrect = false ; break ; } } if ( IsCorrect ) break ; a ++ ; } while ( next_permutation ( A ) ) ; for ( int i = 0 ; i < N ; i ++ ) A [ i ] = i + 1 ; do { IsCorrect = true ; for ( int i = 0 ; i < N ; i ++ ) { if ( A [ i ] != q [ i ] ) { IsCorrect = false ; break ; } } if ( IsCorrect ) break ; b ++ ; } while ( next_permutation ( A ) ) ; Console . Write ( Math . Abs ( a - b ) + " STRNEWLINE " ) ; } static bool next_permutation ( int [ ] p ) { for ( int a = p . Length - 2 ; a >= 0 ; -- a ) if ( p [ a ] < p [ a + 1 ] ) for ( int b = p . Length - 1 ; ; -- b ) if ( p [ b ] > p [ a ] ) { int t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; for ( ++ a , b = p . Length - 1 ; a < b ; ++ a , -- b ) { t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; } return true ; } return false ; } public static void Main ( String [ ] args ) { int [ ] p = { 1 , 3 , 2 } ; int [ ] q = { 3 , 1 , 2 } ; int n = p . Length ; findDifference ( p , q , n ) ; } }

Index/key variables: N, a, b, i
Accumulator variables: a, b, i
Iterator variables: a, b, i
Boolean variables: IsCorrect
Class/struct names: GFG
C# program:
using System ; class GFG { static void printFinalArray ( int [ ] a , int n , int [ ] operations , int p , int capacity ) { int i , curr = 0 ; bool picked = false ; for ( i = 0 ; i < p ; i ++ ) { int s = operations [ i ] ; bool flag = false ; switch ( s ) { case 1 : if ( curr != 0 ) curr -- ; break ; case 2 : if ( curr != n - 1 ) curr ++ ; break ; case 3 : if ( picked == false && a [ curr ] != 0 ) { picked = true ; a [ curr ] -- ; } break ; case 4 : if ( picked == true && a [ curr ] != capacity ) { picked = false ; a [ curr ] ++ ; } break ; default : flag = true ; break ; } if ( flag == true ) break ; } for ( i = 0 ; i < n ; i ++ ) { Console . Write ( a [ i ] + " ▁ " ) ; } } public static void Main ( ) { int capacity = 5 ; int [ ] a = { 2 , 5 , 2 } ; int N = a . Length ; int [ ] operations = { 3 , 2 , 4 , 1 , 4 , 5 } ; int M = operations . Length ; printFinalArray ( a , N , operations , M , capacity ) ; } }

Index/key variables: curr, i
Accumulator variables: curr, i
Iterator variables: i
Boolean variables: flag, picked
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPrime ( int n ) { if ( n <= 1 ) return false ; if ( n <= 3 ) return true ; if ( n % 2 == 0 n % 3 == 0 ) return false ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false ; return true ; } static void CheckSumPrime ( int [ ] A , int N ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { String s = A [ i ] . ToString ( ) ; sum += s . Length ; } if ( isPrime ( sum ) == true ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } public static void Main ( ) { int [ ] A = { 1 , 11 , 12 } ; int N = A . Length ; CheckSumPrime ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int N ) { int res = 1 ; while ( N > 0 ) { if ( N % 2 == 1 ) { res = ( res * x ) ; } x = ( x * x ) ; N = N >> 1 ; } return res ; } static void probablityPrimeprod ( int N ) { int N_E = 3 * N ; int N_S = power ( 6 , N ) ; Console . Write ( N_E + " ▁ / ▁ " + N_S ) ; } public static void Main ( String [ ] args ) { int N = 2 ; probablityPrimeprod ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkPalindrome ( int N ) { int rev = 0 ; int temp = N ; while ( N != 0 ) { rev = rev * 10 + N % 10 ; N = N / 10 ; } N = temp ; if ( N == rev ) { return true ; } return false ; } static int closestSmallerPalindrome ( int N ) { do { N -- ; } while ( N >= 0 && ! checkPalindrome ( N ) ) ; return N ; } public static void Main ( ) { int N = 4000 ; Console . WriteLine ( closestSmallerPalindrome ( N ) ) ; } }

Accumulator variables: N
Class/struct names: GFG
C# program:
using System ; class GFG { static int MinimumOperationReq ( int N ) { int cntDecr = 0 ; int temp = N ; while ( temp > 0 ) { int X = ( int ) Math . Sqrt ( temp ) ; if ( X * X == temp ) { break ; } temp = temp - 2 ; cntDecr += 1 ; } int cntIncr = 0 ; while ( true ) { int X = ( int ) Math . Sqrt ( N ) ; if ( X * X == N ) { break ; } N = N + 2 ; cntIncr += 1 ; } return Math . Min ( cntIncr , cntDecr ) ; } public static void Main ( String [ ] args ) { int N = 15 ; Console . Write ( MinimumOperationReq ( N ) ) ; } }

Accumulator variables: cntDecr, cntIncr
Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int M = 1000000007 ; static long power ( long x , long N ) { long res = 1 ; while ( N > 0 ) { if ( N % 2 == 1 ) { res = ( res * x ) % M ; } x = ( x * x ) % M ; N = N >> 1 ; } return res ; } static long moduloInverse ( long X ) { return power ( X , M - 2 ) ; } static long F_1 ( long N , long F_N ) { long P_2 = power ( 2 , N - 1 ) ; long modInv = moduloInverse ( P_2 ) ; long res ; res = ( ( modInv % M ) * ( F_N % M ) ) % M ; return res ; } public static void Main ( String [ ] args ) { long N = 3 ; long F_N = 6 ; Console . Write ( F_1 ( N , F_N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > arr = new List < int > ( ) ; static int effect ; static void add ( int x ) { arr . Add ( x ) ; } static void update ( int x ) { effect = effect ^ x ; } static void computeResults ( ) { for ( int i = 0 ; i < arr . Count ; i ++ ) { arr [ i ] = arr [ i ] ^ effect ; Console . Write ( arr [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { arr = new List < int > ( ) ; arr . Add ( 0 ) ; effect = 0 ; add ( 5 ) ; update ( 2 ) ; computeResults ( ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { class Point { public int x , y ; public Point ( int first , int second ) { this . x = first ; this . y = second ; } } public static void findSubArray ( List < int > arr , int k ) { Point ans = new Point ( 0 , 0 ) ; int i , sum = 0 ; for ( i = 0 ; i < k ; i ++ ) { sum += arr [ i ] ; } int found = 0 ; if ( sum % 3 == 0 ) { ans = new Point ( 0 , i - 1 ) ; found = 1 ; } for ( int j = i ; j < arr . Count ; j ++ ) { if ( found == 1 ) break ; sum = sum + arr [ j ] - arr [ j - k ] ; if ( sum % 3 == 0 ) { ans = new Point ( j - k + 1 , j ) ; found = 1 ; } } if ( found == 0 ) ans = new Point ( - 1 , 0 ) ; if ( ans . x == - 1 ) { Console . Write ( - 1 ) ; } else { for ( i = ans . x ; i <= ans . y ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } } public static void Main ( String [ ] args ) { List < int > arr = new List < int > ( ) ; arr . Add ( 84 ) ; arr . Add ( 23 ) ; arr . Add ( 45 ) ; arr . Add ( 12 ) ; arr . Add ( 56 ) ; arr . Add ( 82 ) ; int K = 3 ; findSubArray ( arr , K ) ; } }

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