dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class GFG { static int MAX = 100001 ; static void maxSum ( int [ ] arr , int N , int K ) { if ( N < K ) { Console . WriteLine ( " Invalid " ) ; return ; } int [ ] CountDistinct = new int [ MAX + 1 ] ; bool [ ] prime = new bool [ MAX + 1 ] ; for ( int i = 0 ; i <= MAX ; i ++ ) { CountDistinct [ i ] = 0 ; prime [ i ] = true ; } for ( int i = 2 ; i <= MAX ; i ++ ) { if ( prime [ i ] == true ) { CountDistinct [ i ] = 1 ; for ( int j = i * 2 ; j <= MAX ; j += i ) { CountDistinct [ j ] ++ ; prime [ j ] = false ; } } } int Maxarr_sum = 0 , DistPrimeSum = 0 ; for ( int i = 0 ; i < K ; i ++ ) { Maxarr_sum += arr [ i ] ; DistPrimeSum += CountDistinct [ arr [ i ] ] ; } int curr_sum = DistPrimeSum ; int curr_arrSum = Maxarr_sum ; for ( int i = K ; i < N ; i ++ ) { curr_sum += CountDistinct [ arr [ i ] ] - CountDistinct [ arr [ i - K ] ] ; curr_arrSum += arr [ i ] - arr [ i - K ] ; if ( curr_sum > DistPrimeSum ) { DistPrimeSum = curr_sum ; Maxarr_sum = curr_arrSum ; } else if ( curr_sum == DistPrimeSum ) { Maxarr_sum = Math . Max ( curr_arrSum , Maxarr_sum ) ; } } Console . WriteLine ( Maxarr_sum ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 4 , 2 , 10 , 3 } ; int K = 3 ; int N = arr . Length ; maxSum ( arr , N , K ) ; } }

Index/key variables: i, j
Accumulator variables: DistPrimeSum, Maxarr_sum, curr_arrSum, curr_sum, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static bool checkPronic ( int x ) { for ( int i = 0 ; i <= ( int ) ( Math . Sqrt ( x ) ) ; i ++ ) { if ( ( x == i * ( i + 1 ) ) != false ) { return true ; } } return false ; } static void countPronic ( int A , int B ) { int count = 0 ; for ( int i = A ; i <= B ; i ++ ) { if ( checkPronic ( i ) != false ) { count ++ ; } } Console . Write ( count ) ; } public static void Main ( String [ ] args ) { int A = 3 , B = 20 ; countPronic ( A , B ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int pronic ( int num ) { int N = ( int ) Math . Sqrt ( num ) ; if ( N * ( N + 1 ) <= num ) { return N ; } return N - 1 ; } static int countPronic ( int A , int B ) { return pronic ( B ) - pronic ( A - 1 ) ; } public static void Main ( String [ ] args ) { int A = 3 ; int B = 20 ; Console . Write ( countPronic ( A , B ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void oddDivisors ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) { int powerOfTwo = 2 ; int count = 0 ; while ( powerOfTwo <= arr [ i ] ) { count ++ ; powerOfTwo = 2 * powerOfTwo ; } Console . Write ( count + " ▁ " ) ; } return ; } public static void Main ( String [ ] args ) { int [ ] arr = { 15 , 16 , 20 , 35 } ; int N = arr . Length ; oddDivisors ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void checkPossible ( int [ ] arr , int n ) { for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] < arr [ i - 1 ] ) { Console . Write ( " No STRNEWLINE " ) ; return ; } else { arr [ i ] -= arr [ i - 1 ] ; arr [ i - 1 ] = 0 ; } } if ( arr [ n - 1 ] == 0 ) { Console . Write ( " Yes STRNEWLINE " ) ; } else { Console . Write ( " No STRNEWLINE " ) ; } } public static void Main ( ) { int [ ] arr = { 2 , 3 , 3 , 4 , 2 } ; int N = arr . Length ; checkPossible ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void highestPowerOfTwo ( int num ) { String s = num . ToString ( ) ; for ( int i = 0 ; i < ( int ) s . Length ; i ++ ) { if ( s [ i ] == '0' ) { Console . Write ( "0" ) ; continue ; } int lg = ( int ) ( Math . Log ( s [ i ] - '0' ) / Math . Log ( 2 ) ) ; int p = ( int ) Math . Pow ( 2 , lg ) ; Console . Write ( ( char ) ( p + 48 ) ) ; } } public static void Main ( ) { int num = 4317 ; highestPowerOfTwo ( num ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void maxSumAfterKReverse ( int [ ] arr , int K , int N ) { int sum = Int32 . MinValue ; if ( K % 2 != 0 ) Array . Reverse ( arr ) ; int currsum = 0 ; for ( int i = 0 ; i < N ; i ++ ) { currsum += arr [ i ] ; sum = Math . Max ( sum , currsum ) ; } Console . Write ( sum ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 1 , 5 , 8 , 9 , 11 , 2 } ; int K = 1 ; int N = arr . Length ; maxSumAfterKReverse ( arr , K , N ) ; } }

Index/key variables: i
Accumulator variables: currsum, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void SubMasks ( int N ) { for ( int S = N ; S > 0 ; S = ( S - 1 ) & N ) { Console . Write ( S + " ▁ " ) ; } } static public void Main ( ) { int N = 25 ; SubMasks ( N ) ; } }

Iterator variables: S
Class/struct names: GFG
C# program:
using System ; class GFG { static int MOD = 1000000007 ; static int power ( int x , int y ) { int res = 1 ; x = x % MOD ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % MOD ; y = y >> 1 ; x = ( x * x ) % MOD ; } return res ; } static void countPairs ( int N ) { int high = power ( 2 , N ) ; int count = 0 ; for ( int i = 0 ; i < high ; i ++ ) { for ( int j = 0 ; j < high ; j ++ ) { int X = ( i ^ j ) ; int Y = ( i j ) ; if ( X == Y ) { count ++ ; } } } Console . WriteLine ( count % MOD ) ; } static public void Main ( ) { int N = 10 ; countPairs ( N ) ; } }

Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { static readonly int MOD = 1000000007 ; static int power ( int x , int y ) { int res = 1 ; x = x % MOD ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % MOD ; y = y >> 1 ; x = ( x * x ) % MOD ; } return res ; } static void countPairs ( int N ) { Console . Write ( power ( 3 , N ) ) ; } public static void Main ( String [ ] args ) { int N = 10 ; countPairs ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int minimumMoves ( int [ ] a , int n ) { int min_element = int . MaxValue ; int max_element = int . MinValue ; int min_ind = - 1 ; int max_ind = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] <= min_element ) { min_element = a [ i ] ; min_ind = i ; } if ( a [ i ] > max_element ) { max_element = a [ i ] ; max_ind = i ; } } if ( max_ind == min_ind ) { return 0 ; } else if ( max_ind > min_ind ) { return max_ind + ( n - min_ind - 2 ) ; } else { return max_ind + n - min_ind - 1 ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 35 , 46 , 17 , 23 } ; int N = arr . Length ; Console . Write ( minimumMoves ( arr , N ) + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findIndex ( int [ ] arr , int n , int K ) { int sum = 0 ; int res = - 1 ; int mini = ( int ) 1e9 ; for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; } for ( int i = 0 ; i < n ; i ++ ) { int temp = sum - arr [ i ] ; if ( temp % K == 0 ) { if ( res == - 1 mini > arr [ i ] ) { res = i + 1 ; mini = arr [ i ] ; } } } return res ; } static void Main ( ) { int [ ] arr = { 14 , 7 , 8 , 2 , 4 } ; int K = 7 ; int N = arr . Length ; Console . WriteLine ( findIndex ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void divisionalArrays ( int [ ] arr , int N ) { int sum = N ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] = mp [ arr [ i ] ] + 1 ; } else { mp . Add ( arr [ i ] , 1 ) ; } } foreach ( KeyValuePair < int , int > x in mp ) { if ( ( int ) x . Value > 1 ) { sum += ( int ) x . Value - 1 ; } } Console . WriteLine ( sum ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 1 , 3 } ; int N = arr . Length ; divisionalArrays ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static void totalInversions ( int [ ] arr , int K , int N ) { int inv = 0 ; int X = 0 ; int i , j ; for ( i = 0 ; i < N ; i ++ ) { for ( j = 0 ; j < N ; j ++ ) { if ( arr [ i ] > arr [ j ] && i < j ) inv ++ ; if ( arr [ i ] > arr [ j ] ) X ++ ; } } int totalInv = X * K * ( K - 1 ) / 2 + inv * K ; Console . WriteLine ( totalInv ) ; } public static void Main ( ) { int [ ] arr = { 2 , 1 , 3 } ; int K = 3 ; int N = arr . Length ; totalInversions ( arr , K , N ) ; } }

Index/key variables: i, j
Accumulator variables: X, i, inv, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int Fact ( int N ) { int result = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { result = ( result * i ) ; } return result ; } static void numberOfWays ( int M , int [ ] arr , int N ) { int [ ] B = new int [ M ] ; int [ ] counter = new int [ M + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] != 0 ) { if ( B [ i % M ] == 0 ) { B [ i % M ] = arr [ i ] ; counter [ arr [ i ] ] ++ ; if ( counter [ arr [ i ] ] > 1 ) { Console . WriteLine ( 0 ) ; return ; } } else if ( B [ i % M ] != arr [ i ] ) { Console . WriteLine ( 0 ) ; return ; } } } int cnt = 0 ; for ( int i = 0 ; i < M ; i ++ ) { if ( B [ i ] == 0 ) { cnt ++ ; } } Console . WriteLine ( Fact ( cnt ) ) ; } static public void Main ( ) { int M = 4 ; int [ ] arr = new int [ ] { 1 , 0 , 3 , 0 , 0 } ; int N = arr . Length ; numberOfWays ( M , arr , N ) ; } }

Index/key variables: M, i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MaximumSum ( int [ , ] arr , int n ) { int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int x = 0 , y = i , sum = 0 ; for ( int j = i ; j < n ; j ++ ) { sum += arr [ x ++ , y ++ ] ; } if ( sum > ans ) ans = sum ; } for ( int i = 1 ; i < n ; i ++ ) { int x = i , y = 0 , sum = 0 ; for ( int j = i ; j < n ; j ++ ) { sum += arr [ x ++ , y ++ ] ; } if ( sum > ans ) ans = sum ; } return ans ; } public static void Main ( String [ ] args ) { int [ , ] arr = { { 1 , 2 , 3 } , { 3 , 5 , 10 } , { 1 , 3 , 5 } } ; int n = arr . GetLength ( 0 ) ; Console . Write ( MaximumSum ( arr , n ) ) ; } }

Accumulator variables: i, j, sum, x, y
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void numberOfIntegers ( int [ ] arr , int N ) { int cur_max = 0 , count = 0 ; if ( N == 1 ) { count = 1 ; } else { for ( int i = 0 ; i < N - 1 ; i ++ ) { if ( arr [ i ] > cur_max ) { cur_max = arr [ i ] ; if ( arr [ i ] > arr [ i + 1 ] ) { count ++ ; } } } if ( arr [ N - 1 ] > cur_max ) count ++ ; } Console . WriteLine ( count ) ; } static public void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 0 , 7 , 2 , 0 , 2 , 0 } ; int N = arr . Length ; numberOfIntegers ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfWays ( int n , int k ) { if ( n == 0 ) return 1 ; if ( k == 0 ) return 1 ; if ( n >= ( int ) Math . Pow ( 2 , k ) ) { int curr_val = ( int ) Math . Pow ( 2 , k ) ; return numberOfWays ( n - curr_val , k ) + numberOfWays ( n , k - 1 ) ; } else return numberOfWays ( n , k - 1 ) ; } public static void Main ( String [ ] args ) { int n = 4 ; int k = ( int ) ( Math . Log ( n ) / Math . Log ( 2 ) ) ; Console . WriteLine ( numberOfWays ( n , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int possibleTriplets ( int [ ] arr , int N ) { int freq = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] > 0 ) { freq ++ ; } } return ( int ) ( ( freq * 1L * ( freq - 1 ) * ( freq - 2 ) ) / 6 ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 5 , - 9 , - 3 , 6 } ; int N = arr . Length ; Console . Write ( possibleTriplets ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: freq, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static void maxPossibleDiff ( List < int > arr , int N ) { arr . Add ( - 1 ) ; arr . Reverse ( ) ; arr . Add ( - 1 ) ; arr . Reverse ( ) ; int maxDiff = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( arr [ i ] > arr [ i - 1 ] && arr [ i ] > arr [ i + 1 ] ) { maxDiff += arr [ i ] ; } if ( arr [ i ] < arr [ i - 1 ] && arr [ i ] < arr [ i + 1 ] ) { maxDiff -= arr [ i ] ; } } Console . Write ( maxDiff ) ; } public static void Main ( String [ ] args ) { int [ ] array = { 3 , 2 , 1 , 4 , 5 , 2 , 1 , 7 , 8 , 9 } ; List < int > v = new List < int > ( ) ; foreach ( int i in array ) { v . Add ( i ) ; } int N = v . Count ; maxPossibleDiff ( v , N ) ; } }

Index/key variables: i
Accumulator variables: i, maxDiff
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printArray ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } static void reverseCircularArray ( int [ ] arr , int N , int K ) { int start = K , end = K - 1 ; int count = N / 2 ; while ( count != 0 ) { int temp = arr [ start % N ] ; arr [ start % N ] = arr [ end % N ] ; arr [ end % N ] = temp ; start ++ ; end -- ; if ( end == - 1 ) { end = N - 1 ; } count -= 1 ; } printArray ( arr , N ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 5 , 2 , 4 , 1 } ; int K = 2 ; int N = arr . Length ; reverseCircularArray ( arr , N , K ) ; } }

Index/key variables: i
Accumulator variables: count, end, i, start
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findOriginalMatrix ( int [ , ] B , int N , int M ) { int [ , ] A = new int [ N , M ] ; for ( int i = 0 ; i < N ; ++ i ) { for ( int j = 0 ; j < M ; ++ j ) { A [ i , j ] = 1 ; } } for ( int i = 0 ; i < N ; ++ i ) { for ( int j = 0 ; j < M ; ++ j ) { if ( B [ i , j ] == 0 ) { for ( int k = 0 ; k < M ; ++ k ) { A [ i , k ] = 0 ; } for ( int k = 0 ; k < N ; ++ k ) { A [ k , j ] = 0 ; } } } } for ( int i = 0 ; i < N ; ++ i ) { for ( int j = 0 ; j < M ; ++ j ) { int c = 0 ; for ( int k = 0 ; k < M ; ++ k ) { if ( c == 1 ) break ; c += A [ i , k ] ; } for ( int k = 0 ; k < N ; ++ k ) { if ( c == 1 ) break ; c += A [ k , j ] ; } if ( c != B [ i , j ] ) { Console . WriteLine ( " Not ▁ Possible " ) ; return ; } } } for ( int i = 0 ; i < N ; ++ i ) { for ( int j = 0 ; j < M ; ++ j ) { Console . Write ( A [ i , j ] + " ▁ " ) ; } Console . WriteLine ( ) ; } } static public void Main ( ) { int [ , ] B = new int [ , ] { { 1 , 1 , 1 } , { 1 , 1 , 1 } } ; int N = B . GetLength ( 0 ) ; int M = B . GetLength ( 1 ) ; findOriginalMatrix ( B , N , M ) ; } }

Accumulator variables: c
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int x , int y ) { if ( y == 0 ) return x ; return gcd ( y , x % y ) ; } static int lcm ( int x , int y ) { return ( x * y ) / gcd ( x , y ) ; } static int minimumCost ( int x , int y ) { int lcm_ = lcm ( x , y ) ; int costx = ( lcm_ - x ) / x ; int costy = ( lcm_ - y ) / y ; return costx + costy ; } public static void Main ( String [ ] args ) { int x = 5 , y = 17 ; Console . Write ( minimumCost ( x , y ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = 1000000007 ; static int power ( int a , int n , int d ) { int res = 1 ; while ( n != 0 ) { if ( ( n % 2 ) != 0 ) { res = ( ( res % d ) * ( a % d ) ) % d ; } a = ( ( a % d ) * ( a % d ) ) % d ; n /= 2 ; } return res ; } static int gcd ( int p , int q , int n ) { if ( p == q ) { return ( power ( p , n , mod ) + power ( q , n , mod ) ) % mod ; } int candidate = 1 ; int num = p - q ; int sq = ( int ) Math . Sqrt ( num ) ; for ( int i = 1 ; i <= sq ; ++ i ) { if ( num % i == 0 ) { int X = power ( p , n , i ) ; int Y = power ( q , n , i ) ; int temp = ( X + Y ) % i ; if ( temp == 0 ) { candidate = Math . Max ( candidate , i ) ; } temp = ( power ( p , n , num / i ) + power ( q , n , num / i ) ) % ( num / i ) ; if ( temp == 0 ) { candidate = Math . Max ( candidate , num / i ) ; } } } return candidate % mod ; } static public void Main ( ) { int p , q , n ; p = 10 ; q = 6 ; n = 5 ; Console . WriteLine ( gcd ( p , q , n ) ) ; } }

Accumulator variables: n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findPoint ( int n , int h ) { for ( int i = 1 ; i < n ; i ++ ) Console . Write ( " { 0 : F2 } ▁ " , Math . Sqrt ( i / ( n * 1.0 ) ) * h ) ; } public static void Main ( String [ ] args ) { int n = 3 ; int h = 2 ; findPoint ( n , h ) ; } }

Accumulator variables: i
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 calculateK ( int x , int y ) { int g = gcd ( x , y ) ; int n = y / g ; int res = n ; for ( int i = 2 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { res -= ( res / i ) ; while ( n % i == 0 ) n /= i ; } } if ( n != 1 ) res -= ( res / n ) ; return res ; } public static void Main ( String [ ] args ) { int x = 3 , y = 15 ; Console . Write ( calculateK ( x , y ) + " STRNEWLINE " ) ; } }

Accumulator variables: i, n, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isint ( double N ) { int X = ( int ) N ; double temp2 = N - X ; if ( temp2 > 0 ) { return false ; } return true ; } public static void Main ( String [ ] args ) { double N = 1.5 ; if ( isint ( N ) ) { Console . WriteLine ( " YES " ) ; } else { Console . WriteLine ( " NO " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void nearestPowerOfTwo ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) { int lg = ( int ) ( Math . Log ( arr [ i ] ) / Math . Log ( 2 ) ) ; int a = ( int ) ( Math . Pow ( 2 , lg ) ) ; int b = ( int ) ( Math . Pow ( 2 , lg + 1 ) ) ; if ( ( arr [ i ] - a ) < ( b - arr [ i ] ) ) Console . Write ( a + " ▁ " ) ; else Console . Write ( b + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 2 , 7 , 12 } ; int N = arr . Length ; nearestPowerOfTwo ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSetBits ( int n ) { int count = 0 ; while ( n != 0 ) { n &= ( n - 1 ) ; count ++ ; } return count ; } static int invertBits ( int n ) { int x = ( int ) Math . Log ( n , 2 ) ; int m = 1 << x ; m = m | m - 1 ; n = n ^ m ; return n ; } static void invertSum ( int A , int B ) { int temp = countSetBits ( A ) + countSetBits ( B ) ; Console . WriteLine ( invertBits ( temp ) ) ; } static void Main ( ) { int A = 5 ; int B = 7 ; invertSum ( A , B ) ; } }

Accumulator variables: count, n
Class/struct names: GFG
C# program:
using System ; class GFG { static void XOR_for_every_i ( int [ ] A , int N ) { int [ ] frequency_of_bits = new int [ 32 ] ; for ( int i = 0 ; i < N ; i ++ ) { int bit_position = 0 ; int M = A [ i ] ; while ( M != 0 ) { if ( ( M & 1 ) != 0 ) { frequency_of_bits [ bit_position ] += 1 ; } bit_position += 1 ; M >>= 1 ; } } for ( int i = 0 ; i < N ; i ++ ) { int M = A [ i ] ; int value_at_that_bit = 1 ; int XOR_sum = 0 ; for ( int bit_position = 0 ; bit_position < 32 ; bit_position ++ ) { if ( ( M & 1 ) != 0 ) { XOR_sum += ( N - frequency_of_bits [ bit_position ] ) * value_at_that_bit ; } else { XOR_sum += ( frequency_of_bits [ bit_position ] ) * value_at_that_bit ; } M >>= 1 ; value_at_that_bit <<= 1 ; } Console . Write ( XOR_sum + " ▁ " ) ; } return ; } public static void Main ( ) { int [ ] A = { 1 , 2 , 3 } ; int N = A . Length ; XOR_for_every_i ( A , N ) ; } }

Index/key variables: bit_position, i
Accumulator variables: XOR_sum, bit_position, i
Iterator variables: bit_position, i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; class GFG { static int minimumMaxDiff ( int [ ] nums ) { HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 0 ; i < nums . Length ; i ++ ) { if ( nums [ i ] % 2 == 0 ) s . Add ( nums [ i ] ) ; else s . Add ( nums [ i ] * 2 ) ; } int res = s . Last ( ) - s . First ( ) ; while ( s . Last ( ) % 2 == 0 ) { int x = s . Last ( ) ; s . Remove ( x ) ; s . Add ( x / 2 ) ; res = Math . Min ( res , s . Last ( ) - s . First ( ) ) ; } return res ; } static public void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 5 , 9 } ; Console . WriteLine ( minimumMaxDiff ( arr ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int bitwiseXorRange ( int n ) { if ( n % 4 == 0 ) return n ; if ( n % 4 == 1 ) return 1 ; if ( n % 4 == 2 ) return n + 1 ; return 0 ; } static int evenXorRange ( int l , int r ) { int xor_l ; int xor_r ; xor_r = 2 * bitwiseXorRange ( r / 2 ) ; xor_l = 2 * bitwiseXorRange ( ( l - 1 ) / 2 ) ; return xor_l ^ xor_r ; } static void Main ( ) { int l = 10 ; int r = 20 ; Console . Write ( evenXorRange ( l , r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double find_Variance ( int n ) { long numerator = n * n - 1 ; double ans = ( numerator * 1.0 ) / 12 ; return ans ; } public static void Main ( string [ ] args ) { int N = 5 ; Console . WriteLine ( find_Variance ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int M = 3 ; static int N = 3 ; static void countDigit ( int [ , ] arr ) { for ( int i = 0 ; i < M ; i ++ ) { for ( int j = 0 ; j < N ; j ++ ) { int X = arr [ i , j ] ; int d = ( int ) ( Math . Floor ( Math . Log10 ( X ) * 1.0 ) + 1 ) ; Console . Write ( d + " ▁ " ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int [ , ] arr = { { 27 , 173 , 5 } , { 21 , 6 , 624 } , { 5 , 321 , 49 } } ; countDigit ( arr ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findSum ( int [ ] arr , int N ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] ++ ; } else { mp [ arr [ i ] ] = 1 ; } } int sum_odd = 0 , sum_even = 0 ; foreach ( KeyValuePair < int , int > itr in mp ) { if ( itr . Value % 2 != 0 ) sum_odd += ( itr . Key ) * ( itr . Value ) ; if ( itr . Value % 2 == 0 ) sum_even += ( itr . Key ) * ( itr . Value ) ; } int diff = sum_even - sum_odd ; return diff ; } static void Main ( ) { int [ ] arr = { 1 , 5 , 5 , 2 , 4 , 3 , 3 } ; int N = arr . Length ; Console . Write ( findSum ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum_even, sum_odd
Iterator variables: i, itr
Class/struct names: GFG
C# program:
using System ; class GFG { static void noOfArraysPossible ( int N , int M ) { int ans = 1 ; for ( int i = 0 ; i < N ; ++ i ) { ans = ans * ( M - i ) ; } Console . Write ( ans ) ; } public static void Main ( ) { int N = 2 , M = 3 ; noOfArraysPossible ( N , M ) ; } }

Iterator variables: i
Class/struct names: GFG