dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool [ ] arr = new bool [ 1001 ] ; static void simpleSieve ( ) { for ( int i = 0 ; i < 1001 ; i ++ ) arr [ i ] = true ; for ( int p = 2 ; p * p < 1001 ; p ++ ) { if ( arr [ p ] ) { for ( int i = p * 2 ; i < 1001 ; i = i + p ) arr [ i ] = false ; } } } static int find_sphene ( int N ) { int [ ] arr1 = new int [ 8 ] ; int count = 0 ; int j = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( N % i == 0 && count < 8 ) { count ++ ; arr1 [ j ++ ] = i ; } } if ( count == 8 && ( arr [ arr1 [ 1 ] ] && arr [ arr1 [ 2 ] ] && arr [ arr1 [ 3 ] ] ) ) return 1 ; return 0 ; } public static void Main ( String [ ] args ) { int n = 60 ; simpleSieve ( ) ; int ans = find_sphene ( n ) ; if ( ans == 1 ) Console . Write ( " Yes " ) ; else Console . Write ( " NO " ) ; } }

Index/key variables: i, p
Accumulator variables: count, i, j, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; return gcd ( b % a , a ) ; } static int commDiv ( int a , int b ) { int n = gcd ( a , b ) ; int result = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) result += 1 ; else result += 2 ; } } return result ; } public static void Main ( String [ ] args ) { int a = 12 , b = 24 ; Console . Write ( commDiv ( a , b ) ) ; } }

Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static long spellsCount ( String num ) { int n = num . Length ; long result = 1 ; for ( int i = 0 ; i < n ; i ++ ) { int count = 1 ; while ( i < n - 1 && num [ i + 1 ] == num [ i ] ) { count ++ ; i ++ ; } result = result * ( long ) Math . Pow ( 2 , count - 1 ) ; } return result ; } public static void Main ( ) { String num = "11112" ; Console . Write ( spellsCount ( num ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numSquareSum ( int n ) { int squareSum = 0 ; while ( n != 0 ) { squareSum += ( n % 10 ) * ( n % 10 ) ; n /= 10 ; } return squareSum ; } static bool isHappynumber ( int n ) { int slow , fast ; slow = fast = n ; do { slow = numSquareSum ( slow ) ; fast = numSquareSum ( numSquareSum ( fast ) ) ; } while ( slow != fast ) ; return ( slow == 1 ) ; } public static void Main ( ) { int n = 13 ; if ( isHappynumber ( n ) ) Console . WriteLine ( n + " ▁ is ▁ a ▁ Happy ▁ number " ) ; else Console . WriteLine ( n + " ▁ is ▁ not ▁ a ▁ Happy ▁ number " ) ; } }

Accumulator variables: n, squareSum
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static ArrayList allPrimes = new ArrayList ( ) ; static void sieve ( int n ) { bool [ ] prime = new bool [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) prime [ i ] = true ; for ( int p = 2 ; p * p <= n ; p ++ ) { if ( prime [ p ] == true ) { for ( int i = p * 2 ; i <= n ; i += p ) prime [ i ] = false ; } } for ( int p = 2 ; p <= n ; p ++ ) if ( prime [ p ] ) allPrimes . Add ( p ) ; } static int factorialDivisors ( int n ) { int result = 1 ; for ( int i = 0 ; i < allPrimes . Count ; i ++ ) { int p = ( int ) allPrimes [ i ] ; int exp = 0 ; while ( p <= n ) { exp = exp + ( n / p ) ; p = p * ( int ) allPrimes [ i ] ; } result = result * ( exp + 1 ) ; } return result ; } public static void Main ( ) { Console . WriteLine ( factorialDivisors ( 6 ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static int nonFibonacci ( int n ) { int prevPrev = 1 , prev = 2 , curr = 3 ; while ( n > 0 ) { prevPrev = prev ; prev = curr ; curr = prevPrev + prev ; n = n - ( curr - prev - 1 ) ; } n = n + ( curr - prev - 1 ) ; return prev + n ; } public static void Main ( ) { Console . WriteLine ( nonFibonacci ( 5 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { if ( a == 0 ) return b ; if ( b == 0 ) return a ; int k ; for ( k = 0 ; ( ( a b ) & 1 ) == 0 ; ++ k ) { a >>= 1 ; b >>= 1 ; } while ( ( a & 1 ) == 0 ) a >>= 1 ; do { while ( ( b & 1 ) == 0 ) b >>= 1 ; if ( a > b ) { int temp = a ; a = b ; b = temp ; } b = ( b - a ) ; } while ( b != 0 ) ; return a << k ; } public static void Main ( ) { int a = 34 , b = 17 ; Console . Write ( " Gcd ▁ of ▁ given ▁ " + " numbers ▁ is ▁ " + gcd ( a , b ) ) ; } }

Iterator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { static string [ ] one = { " " , " one ▁ " , " two ▁ " , " three ▁ " , " four ▁ " , " five ▁ " , " six ▁ " , " seven ▁ " , " eight ▁ " , " nine ▁ " , " ten ▁ " , " eleven ▁ " , " twelve ▁ " , " thirteen ▁ " , " fourteen ▁ " , " fifteen ▁ " , " sixteen ▁ " , " seventeen ▁ " , " eighteen ▁ " , " nineteen ▁ " } ; static string [ ] ten = { " " , " " , " twenty ▁ " , " thirty ▁ " , " forty ▁ " , " fifty ▁ " , " sixty ▁ " , " seventy ▁ " , " eighty ▁ " , " ninety ▁ " } ; static string numToWords ( int n , string s ) { string str = " " ; if ( n > 19 ) { str += ten [ n / 10 ] + one [ n % 10 ] ; } else { str += one [ n ] ; } if ( n != 0 ) { str += s ; } return str ; } static string convertToWords ( long n ) { string out1 = " " ; out1 += numToWords ( ( int ) ( n / 10000000 ) , " crore ▁ " ) ; out1 += numToWords ( ( int ) ( ( n / 100000 ) % 100 ) , " lakh ▁ " ) ; out1 += numToWords ( ( int ) ( ( n / 1000 ) % 100 ) , " thousand ▁ " ) ; out1 += numToWords ( ( int ) ( ( n / 100 ) % 10 ) , " hundred ▁ " ) ; if ( n > 100 && n % 100 > 0 ) { out1 += " and ▁ " ; } out1 += numToWords ( ( int ) ( n % 100 ) , " " ) ; return out1 ; } static void Main ( ) { long n = 438237764 ; Console . WriteLine ( convertToWords ( n ) ) ; } }

Index/key variables: n
Accumulator variables: out1, str
Class/struct names: GFG
C# program:
using System ; public class GFG { public static long countEvenSum ( int [ ] a , int n ) { long res = 0 ; int s = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( a [ i ] % 2 == 1 ) { s = n - i - 1 - s ; } else { s = s + 1 ; } res = res + s ; } return res ; } static public void Main ( ) { int [ ] arr = { 1 , 2 , 2 , 3 , 4 , 1 } ; int n = arr . Length ; Console . WriteLine ( " The ▁ Number ▁ of ▁ Subarrays " + " ▁ with ▁ even ▁ sum ▁ is ▁ " + countEvenSum ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int gcd ( int a , int b ) { return ( a % b == 0 ) ? Math . Abs ( b ) : gcd ( b , a % b ) ; } static bool isPossible ( int a , int b , int c ) { return ( c % gcd ( a , b ) == 0 ) ; } public static void Main ( ) { int a = 3 , b = 6 , c = 9 ; if ( isPossible ( a , b , c ) ) Console . WriteLine ( " Possible " ) ; else Console . WriteLine ( " Not ▁ Possible " ) ; a = 3 ; b = 6 ; c = 8 ; if ( isPossible ( a , b , c ) ) Console . WriteLine ( " Possible " ) ; else Console . WriteLine ( " Not ▁ Possible " ) ; a = 2 ; b = 5 ; c = 1 ; if ( isPossible ( a , b , c ) ) Console . WriteLine ( " Possible " ) ; else Console . WriteLine ( " Not ▁ Possible " ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void farey ( int n ) { double x1 = 0 , y1 = 1 , x2 = 1 , y2 = n ; Console . Write ( " { 0 : F0 } / { 1 : F0 } ▁ { 2 : F0 } / { 3 : F0 } " , x1 , y1 , x2 , y2 ) ; while ( y != 1.0 ) { x = Math . Floor ( ( y1 + n ) / y2 ) * x2 - x1 ; y = Math . Floor ( ( y1 + n ) / y2 ) * y2 - y1 ; Console . Write ( " ▁ { 0 : F0 } / { 1 : F0 } " , x , y ) ; x1 = x2 ; x2 = x ; y1 = y2 ; y2 = y ; } } public static void Main ( String [ ] args ) { int n = 7 ; Console . Write ( " Farey ▁ Sequence ▁ of ▁ order ▁ " + n + " ▁ is STRNEWLINE " ) ; farey ( n ) ; } }

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 void findSmallest ( int a , int b ) { int lcm = ( a * b ) / gcd ( a , b ) ; Console . Write ( " x ▁ = ▁ " + lcm / a + " y = " } public static void Main ( ) { int a = 25 , b = 35 ; findSmallest ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public int power ( int x , int y , int p ) { while ( y > 0 ) { if ( ( y & 1 ) > 0 ) res = ( res * x ) % p ; x = ( x * x ) % p ; } return res ; } public int modInverse ( int a , int p ) { return power ( a , p - 2 , p ) ; } public int modFact ( int n , int p ) { if ( p <= n ) return 0 ; int res = ( p - 1 ) ; for ( int i = n + 1 ; i < p ; i ++ ) res = ( res * modInverse ( i , p ) ) % p ; return res ; } public static void Main ( ) { GFG g = new GFG ( ) ; int n = 25 , p = 29 ; Console . WriteLine ( g . modFact ( n , p ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countWays ( int n ) { for ( int i = 1 ; i < n ; i ++ ) for ( int j = i ; j < n ; j ++ ) for ( int k = j ; k < n ; k ++ ) for ( int l = k ; l < n ; l ++ ) if ( i + j + k + l == n ) counter ++ ; return counter ; } static public void Main ( ) { int n = 8 ; Console . WriteLine ( countWays ( n ) ) ; } }

Accumulator variables: counter, i, j, k, l
Iterator variables: i, j, k, l
Class/struct names: GFG
C# program:
using System ; class GFG { static int pairAndSum ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) ans += arr [ i ] & arr [ j ] ; return ans ; } public static void Main ( ) { int [ ] arr = { 5 , 10 , 15 } ; int n = arr . Length ; Console . Write ( pairAndSum ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int pairAndSum ( int [ ] arr , int n ) { for ( int i = 0 ; i < 32 ; i ++ ) { int k = 0 ; for ( int j = 0 ; j < n ; j ++ ) { if ( ( arr [ j ] & ( 1 << i ) ) != 0 ) k ++ ; } ans += ( 1 << i ) * ( k * ( k - 1 ) / 2 ) ; } return ans ; } public static void Main ( ) { int [ ] arr = new int [ ] { 5 , 10 , 15 } ; int n = arr . Length ; Console . Write ( pairAndSum ( arr , n ) ) ; } }

Index/key variables: j
Accumulator variables: ans, i, j, k
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; namespace prime { public class GFG { public static bool isprime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } public static void Main ( ) { if ( isprime ( 11 ) ) Console . WriteLine ( " true " ) ; else Console . WriteLine ( " false " ) ; if ( isprime ( 15 ) ) Console . WriteLine ( " true " ) ; else Console . WriteLine ( " false " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void computeTotient ( int n ) { long [ ] phi = new long [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) phi [ i ] = i ; for ( int p = 2 ; p <= n ; p ++ ) { if ( phi [ p ] == p ) { phi [ p ] = p - 1 ; for ( int i = 2 * p ; i <= n ; i += p ) { phi [ i ] = ( phi [ i ] / p ) * ( p - 1 ) ; } } } for ( int i = 1 ; i <= n ; i ++ ) Console . WriteLine ( " Totient ▁ of ▁ " + i + " ▁ is ▁ " + phi [ i ] ) ; } public static void Main ( ) { int n = 12 ; computeTotient ( n ) ; } }

Index/key variables: i, p
Accumulator variables: i, p
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { static long Euler_totient_function ( long n ) { long result = 1 ; for ( long i = 2 ; i * i <= n ; i ++ ) { long c = 0 ; if ( n % i == 0 ) { while ( n % i == 0 ) { c ++ ; n /= i ; } } if ( c > 0 ) { long sm = ( long ) Math . Pow ( i , c - 1 ) * ( i - 1 ) ; result *= sm ; } } if ( n > 1 ) { result *= ( n - 1 ) ; } return result ; } public static void Main ( ) { for ( long i = 1 ; i < 13 ; i ++ ) { Console . Write ( " Euler _ totient _ function ( " + i + " ) : ▁ " ) ; Console . WriteLine ( Euler_totient_function ( i ) ) ; } } }

Accumulator variables: c, i, n, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPower ( int n ) { double p ; if ( n <= 1 ) { return true ; } for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { p = Math . Log ( n ) / Math . Log ( i ) ; if ( ( Math . Ceiling ( p ) == Math . Floor ( p ) ) && p > 1 ) { return true ; } } return false ; } static public void Main ( ) { for ( int i = 2 ; i < 100 ; i ++ ) { if ( isPower ( i ) ) Console . Write ( i + " ▁ " ) ; } } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int sumBetweenTwoKth ( int [ ] arr , int n , int k1 , int k2 ) { Array . Sort ( arr ) ; int result = 0 ; for ( int i = k1 ; i < k2 - 1 ; i ++ ) result += arr [ i ] ; return result ; } public static void Main ( ) { int [ ] arr = { 20 , 8 , 22 , 4 , 12 , 10 , 14 } ; int k1 = 3 , k2 = 6 ; int n = arr . Length ; Console . Write ( sumBetweenTwoKth ( arr , n , k1 , k2 ) ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countSquares ( int n ) { return ( n * ( n + 1 ) / 2 ) * ( 2 * n + 1 ) / 3 ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( " Count ▁ of " + " squares ▁ is ▁ " + countSquares ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int nthMagicNo ( int n ) { int pow = 1 , answer = 0 ; while ( n != 0 ) { pow = pow * 5 ; if ( ( int ) ( n & 1 ) == 1 ) answer += pow ; n >>= 1 ; } return answer ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( " nth ▁ magic " + " ▁ number ▁ is ▁ " + nthMagicNo ( n ) ) ; } }

Accumulator variables: answer
Class/struct names: GFG
C# program:
using System ; public class GFG { static uint countOfMultiples ( uint n ) { return ( n / 3 + n / 5 - n / 15 ) ; } static public void Main ( ) { Console . WriteLine ( countOfMultiples ( 6 ) ) ; Console . WriteLine ( countOfMultiples ( 16 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int XorSum ( int [ ] A , int [ ] B , int N , int M ) { int ans1 = 0 , ans2 = 0 ; for ( int i = 0 ; i < N ; i ++ ) ans1 = ans1 ^ A [ i ] ; for ( int i = 0 ; i < M ; i ++ ) ans2 = ans2 ^ B [ i ] ; return ( ans1 & ans2 ) ; } public static void Main ( String [ ] args ) { int [ ] A = { 3 , 5 } ; int [ ] B = { 2 , 3 } ; int N = A . Length ; int M = B . Length ; Console . Write ( XorSum ( A , B , N , M ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { class TreeNode { public int val = 0 ; public TreeNode left , right ; public TreeNode ( int x ) { val = x ; left = null ; right = null ; } } ; static void uniqueLevels ( TreeNode root ) { int uniqueLevels = 0 ; Queue < TreeNode > que = new Queue < TreeNode > ( ) ; que . Enqueue ( root ) ; while ( que . Count > 0 ) { int length = que . Count ; int prefix_XOR = 0 ; int prefix_OR = 0 ; bool flag = true ; for ( int i = 0 ; i < length ; i ++ ) { TreeNode temp = que . Peek ( ) ; que . Dequeue ( ) ; prefix_OR |= temp . val ; prefix_XOR ^= temp . val ; if ( prefix_XOR != prefix_OR ) flag = false ; if ( temp . left != null ) que . Enqueue ( temp . left ) ; if ( temp . right != null ) que . Enqueue ( temp . right ) ; } if ( flag ) uniqueLevels += 1 ; } Console . Write ( uniqueLevels ) ; } public static void Main ( String [ ] args ) { TreeNode root = new TreeNode ( 5 ) ; root . left = new TreeNode ( 6 ) ; root . right = new TreeNode ( 9 ) ; root . left . left = new TreeNode ( 1 ) ; root . left . right = new TreeNode ( 4 ) ; root . right . right = new TreeNode ( 7 ) ; uniqueLevels ( root ) ; } }

Accumulator variables: i, prefix_OR, prefix_XOR, uniqueLevels
Iterator variables: i
Boolean variables: flag
Class/struct names: GFG, TreeNode
C# program:
using System ; class GFG { static int n = 7 ; static void minheapify ( int [ ] a , int index ) { int small = index ; int l = 2 * index + 1 ; int r = 2 * index + 2 ; if ( l < n && a [ l ] < a [ small ] ) small = l ; if ( r < n && a [ r ] < a [ small ] ) small = r ; if ( small != index ) { int t = a [ small ] ; a [ small ] = a [ index ] ; a [ index ] = t ; minheapify ( a , small ) ; } } static void Main ( ) { int i = 0 ; int k1 = 3 ; int k2 = 6 ; int [ ] a = { 20 , 8 , 22 , 4 , 12 , 10 , 14 } ; int ans = 0 ; for ( i = ( n / 2 ) - 1 ; i >= 0 ; i -- ) { minheapify ( a , i ) ; } k1 -- ; k2 -- ; for ( i = 0 ; i <= k1 ; i ++ ) { a [ 0 ] = a [ n - 1 ] ; n -- ; minheapify ( a , 0 ) ; } for ( i = k1 + 1 ; i < k2 ; i ++ ) { ans += a [ 0 ] ; a [ 0 ] = a [ n - 1 ] ; n -- ; minheapify ( a , 0 ) ; } Console . Write ( ans ) ; } }

Index/key variables: index, l, r, small
Accumulator variables: ans, i, k1, k2, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > ConstructList ( int [ , ] Q ) { int xor = 0 ; List < int > ans = new List < int > ( ) ; for ( int i = Q . GetLength ( 0 ) - 1 ; i >= 0 ; i -- ) { if ( Q [ i , 0 ] == 0 ) ans . Add ( Q [ i , 1 ] ^ xor ) ; else xor ^= Q [ i , 1 ] ; } ans . Add ( xor ) ; ans . Sort ( ) ; return ans ; } public static void Main ( String [ ] args ) { int [ , ] Q = { { 0 , 6 } , { 0 , 3 } , { 0 , 2 } , { 1 , 4 } , { 1 , 5 } } ; foreach ( int i in ConstructList ( Q ) ) Console . Write ( i + " , ▁ " ) ; } }

Accumulator variables: i, xor
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int build_num ( int [ ] bit ) { int ans = 0 ; for ( int i = 0 ; i < 32 ; i ++ ) if ( bit [ i ] > 0 ) ans += ( 1 << i ) ; return ans ; } static int maximumOR ( int [ ] arr , int n , int k ) { int [ ] bit = new int [ 32 ] ; for ( int i = 0 ; i < k ; i ++ ) { for ( int j = 0 ; j < 32 ; j ++ ) { if ( ( arr [ i ] & ( 1 << j ) ) > 0 ) bit [ j ] ++ ; } } int max_or = build_num ( bit ) ; for ( int i = k ; i < n ; i ++ ) { for ( int j = 0 ; j < 32 ; j ++ ) { if ( ( arr [ i - k ] & ( 1 << j ) ) > 0 ) bit [ j ] -- ; } for ( int j = 0 ; j < 32 ; j ++ ) { if ( ( arr [ i ] & ( 1 << j ) ) > 0 ) bit [ j ] ++ ; } max_or = Math . Max ( build_num ( bit ) , max_or ) ; } return max_or ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 5 , 3 , 6 , 11 , 13 } ; int k = 3 ; int n = arr . Length ; Console . Write ( maximumOR ( arr , n , k ) ) ; } }

Index/key variables: i, j
Accumulator variables: ans, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void constructXORArray ( int [ ] A , int n , int K ) { int [ ] B = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) B [ i ] = A [ i ] ^ K ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( B [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { int [ ] A = { 2 , 4 , 1 , 3 , 5 } ; int K = 5 ; int n = A . Length ; constructXORArray ( A , n , K ) ; int [ ] B = { 4 , 75 , 45 , 42 } ; K = 2 ; n = B . Length ; constructXORArray ( B , n , K ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int find_and ( int [ ] arr ) { int ans = arr [ 0 ] ; for ( int i = 0 ; i < arr . Length ; i ++ ) { ans = ( ans & arr [ i ] ) ; } return ans ; } public static void Main ( ) { int [ ] arr = { 1 , 3 , 5 , 9 , 11 } ; Console . Write ( find_and ( arr ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maxsize = 100005 ; static int [ ] xor_tree = new int [ maxsize ] ; static void construct_Xor_Tree_Util ( int [ ] current , int start , int end , int x ) { if ( start == end ) { xor_tree [ x ] = current [ start ] ; return ; } int left = x * 2 + 1 ; int right = x * 2 + 2 ; int mid = start + ( end - start ) / 2 ; construct_Xor_Tree_Util ( current , start , mid , left ) ; construct_Xor_Tree_Util ( current , mid + 1 , end , right ) ; xor_tree [ x ] = ( xor_tree [ left ] ^ xor_tree [ right ] ) ; } static void construct_Xor_Tree ( int [ ] arr , int n ) { construct_Xor_Tree_Util ( arr , 0 , n - 1 , 0 ) ; } public static void Main ( String [ ] args ) { int [ ] leaf_nodes = { 40 , 32 , 12 , 1 , 4 , 3 , 2 , 7 } ; int n = leaf_nodes . Length ; construct_Xor_Tree ( leaf_nodes , n ) ; int x = ( int ) ( Math . Ceiling ( Math . Log ( n ) ) ) ; int max_size = 2 * ( int ) Math . Pow ( 2 , x ) - 1 ; Console . Write ( " Nodes ▁ of ▁ the ▁ XOR ▁ Tree : STRNEWLINE " ) ; for ( int i = 0 ; i < max_size ; i ++ ) { Console . Write ( xor_tree [ i ] + " ▁ " ) ; } int root = 0 ; Console . Write ( " Root : " } }

Index/key variables: i, left, maxsize, right, start, x
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check ( int [ ] arr , int n , int m , int d ) { int i = 0 ; while ( i < n && m > 0 ) { m -- ; i += d ; } return m == 0 ? true : false ; } static int maximumDistance ( int [ ] arr , int n , int m ) { int low = 1 , high = n - 1 ; int ans = 0 ; while ( low <= high ) { int mid = ( low + high ) / 2 ; bool flag = check ( arr , n , m , mid ) ; if ( flag ) { ans = mid ; low = mid + 1 ; } else { high = mid - 1 ; } } return ans ; } public static void Main ( String [ ] args ) { int n = 5 , m = 3 ; int [ ] arr = new int [ n ] ; Console . Write ( maximumDistance ( arr , n , m ) ) ; } }

Index/key variables: n
Accumulator variables: i, m
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maximumXor ( int [ ] arr , int n ) { Stack < int > sForward = new Stack < int > ( ) , sBackward = new Stack < int > ( ) ; int ans = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { while ( sForward . Count != 0 && arr [ i ] < arr [ sForward . Peek ( ) ] ) { ans = Math . Max ( ans , arr [ i ] ^ arr [ sForward . Peek ( ) ] ) ; sForward . Pop ( ) ; } sForward . Push ( i ) ; while ( sBackward . Count != 0 && arr [ n - i - 1 ] < arr [ sBackward . Peek ( ) ] ) { ans = Math . Max ( ans , arr [ n - i - 1 ] ^ arr [ sBackward . Peek ( ) ] ) ; sBackward . Pop ( ) ; } sBackward . Push ( n - i - 1 ) ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 8 , 1 , 2 } ; int n = arr . Length ; Console . Write ( maximumXor ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minTrees ( int n ) { int count = 0 ; while ( n > 0 ) { n &= ( n - 1 ) ; count ++ ; } return count ; } public static void Main ( ) { int n = 7 ; Console . Write ( minTrees ( n ) ) ; } }

Accumulator variables: count, n
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMinSteps ( int K ) { return countSetBits ( K ) ; } static int countSetBits ( int x ) { int setBits = 0 ; while ( x != 0 ) { x = x & ( x - 1 ) ; setBits ++ ; } return setBits ; } public static void Main ( String [ ] args ) { int n = 343 ; Console . WriteLine ( getMinSteps ( n ) ) ; } }

Accumulator variables: setBits
Class/struct names: GFG
C# program:
using System ; class GfG { static bool isDefeat ( string s1 , string s2 , int n ) { for ( int i = 0 ; i < n ; i ++ ) { if ( ( s1 [ i ] == '0' && s2 [ i ] == '1' ) || ( s1 [ i ] == '1' && s2 [ i ] == '0' ) ) continue ; else if ( ( s1 [ i ] == '0' && s2 [ i ] == ' Z ' ) || ( s1 [ i ] == ' Z ' && s2 [ i ] == '0' ) ) continue ; else { return true ; } } return false ; } public static void Main ( ) { string s1 = ( "01001101ZZ " ) ; string s2 = ( "10Z1001000" ) ; int n = 10 ; if ( isDefeat ( s1 , s2 , n ) ) Console . WriteLine ( " Defeat " ) ; else Console . WriteLine ( " Victory " ) ; } }

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