dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class Tree { public TreeNode root ; public Tree [ ] buildFromLinks ( String [ ] links ) { TreeNode [ ] nodes = new TreeNode [ 26 ] ; Tree [ ] forest = new Tree [ 26 ] ; foreach ( String link in links ) { char [ ] sep = { ' ▁ ' , ' ▁ ' } ; String [ ] ends = link . Split ( sep ) ; int start = ( int ) ( ends [ 0 ] [ 0 ] - ' a ' ) ; int end = ( int ) ( ends [ 1 ] [ 0 ] - ' a ' ) ; if ( nodes [ start ] == null ) { nodes [ start ] = new TreeNode ( ( char ) ( start + ' a ' ) ) ; forest [ start ] = new Tree ( nodes [ start ] ) ; } if ( nodes [ end ] == null ) nodes [ end ] = new TreeNode ( ( char ) ( end + ' a ' ) ) ; else forest [ end ] = null ; nodes [ start ] . addChild ( nodes [ end ] , end ) ; } return forest ; } public Tree ( TreeNode root ) { this . root = root ; } public static void printForest ( String [ ] links ) { Tree t = new Tree ( new TreeNode ( ' \0' ) ) ; foreach ( Tree t1 in t . buildFromLinks ( links ) ) { if ( t1 != null ) { t1 . root . printTreeIdented ( " " ) ; Console . WriteLine ( " " ) ; } } } public static void Main ( String [ ] args ) { String [ ] links1 = { " a ▁ b " , " b ▁ c " , " b ▁ d " , " a ▁ e " } ; Console . WriteLine ( " - - - - - - - - - - - - ▁ Forest ▁ 1 ▁ - - - - - - - - - - - - - - - - " ) ; printForest ( links1 ) ; String [ ] links2 = { " a ▁ b " , " a ▁ g " , " b ▁ c " , " c ▁ d " , " d ▁ e " , " c ▁ f " , " z ▁ y " , " y ▁ x " , " x ▁ w " } ; Console . WriteLine ( " - - - - - - - - - - - - ▁ Forest ▁ 2 ▁ - - - - - - - - - - - - - - - - " ) ; printForest ( links2 ) ; } } public class TreeNode { TreeNode [ ] children ; char c ; public void addChild ( TreeNode n , int index ) { this . children [ index ] = n ; } public TreeNode ( char c ) { this . c = c ; this . children = new TreeNode [ 26 ] ; } public void printTreeIdented ( String indent ) { Console . WriteLine ( indent + " - - > " + c ) ; foreach ( TreeNode child in children ) { if ( child != null ) child . printTreeIdented ( indent + " ▁ " ) ; } } }

Index/key variables: end, index, start
Iterator variables: child, link, t1
Class/struct names: Tree, TreeNode
C# program:
using System ; using System . Collections . Generic ; class GFG { static bool issafe ( int m , int n , int i , int j ) { if ( i < 0 ) return false ; if ( j < 0 ) return false ; if ( i >= m ) return false ; if ( j >= n ) return false ; return true ; } static int [ ] endpoints ( int [ , ] arr , int m , int n ) { int i = 0 ; int j = 0 ; int current_i = 0 ; int current_j = 0 ; char current_d = ' r ' ; Dictionary < char , char > rcd = new Dictionary < char , char > ( ) ; rcd [ ' l ' ] = ' u ' ; rcd [ ' u ' ] = ' r ' ; rcd [ ' r ' ] = ' d ' ; rcd [ ' d ' ] = ' l ' ; while ( issafe ( m , n , i , j ) ) { current_i = i ; current_j = j ; if ( arr [ i , j ] == 1 ) { char move_in = rcd [ current_d ] ; arr [ i , j ] = 0 ; if ( move_in == ' u ' ) i -= 1 ; else if ( move_in == ' d ' ) i += 1 ; else if ( move_in == ' l ' ) j -= 1 ; else if ( move_in == ' r ' ) j += 1 ; current_d = move_in ; } else { if ( current_d == ' u ' ) i -= 1 ; else if ( current_d == ' d ' ) i += 1 ; else if ( current_d == ' l ' ) j -= 1 ; else if ( current_d == ' r ' ) j += 1 ; } } return new int [ ] { current_i , current_j } ; } public static void Main ( string [ ] args ) { int M = 3 ; int N = 5 ; int [ , ] arr = { { 0 , 1 , 1 , 1 , 0 } , { 1 , 0 , 1 , 0 , 1 } , { 1 , 1 , 1 , 0 , 0 } } ; int [ ] p = endpoints ( arr , M , N ) ; Console . WriteLine ( " ( " + p [ 0 ] + " , ▁ " + p [ 1 ] + " ) " + " STRNEWLINE " ) ; } }

Index/key variables: current_d
Accumulator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; class GFG { public static void sumOfTwoPerfectCubes ( int N ) { Dictionary < int , int > cubes = new Dictionary < int , int > ( ) ; for ( int i = 1 ; i * i * i <= N ; i ++ ) cubes . Add ( ( i * i * i ) , i ) ; var val = cubes . Keys . ToList ( ) ; foreach ( var key in val ) { int firstNumber = cubes [ 1 ] ; int secondNumber = N - cubes [ 1 ] ; if ( cubes . ContainsKey ( secondNumber ) ) { Console . Write ( " True " ) ; return ; } } Console . Write ( " False " ) ; } static public void Main ( ) { int N = 28 ; sumOfTwoPerfectCubes ( N ) ; } }

Accumulator variables: i
Iterator variables: i, key
Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = 1000000007 ; static void countSets ( int [ ] arr , int n ) { int cnt = 0 ; int maxE = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( maxE < arr [ i ] ) maxE = arr [ i ] ; } int [ ] sieve = new int [ maxE + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) sieve [ arr [ i ] ] = 1 ; for ( int i = 1 ; i <= maxE ; i ++ ) { if ( sieve [ i ] != 0 ) { for ( int j = i * 2 ; j <= maxE ; j += i ) { if ( sieve [ j ] != 0 ) sieve [ j ] = ( sieve [ j ] + sieve [ i ] ) % mod ; } } } for ( int i = 0 ; i <= maxE ; i ++ ) cnt = ( cnt % mod + sieve [ i ] % mod ) % mod ; Console . WriteLine ( cnt % mod ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 16 , 18 , 6 , 7 , 2 , 19 , 20 , 9 } ; int N = arr . Length ; countSets ( arr , N ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void findDay ( int Y , int B ) { int lyear , rest , totaldays , day ; Y = ( Y - 1 ) - B ; lyear = Y / 4 ; rest = Y - lyear ; totaldays = ( rest * 365 ) + ( lyear * 366 ) + 1 ; day = ( totaldays % 7 ) ; if ( day == 0 ) Console . WriteLine ( " Monday " ) ; else if ( day == 1 ) Console . WriteLine ( " Tuesday " ) ; else if ( day == 2 ) Console . WriteLine ( " Wednesday " ) ; else if ( day == 3 ) Console . WriteLine ( " Thursday " ) ; else if ( day == 4 ) Console . WriteLine ( " Friday " ) ; else if ( day == 5 ) Console . WriteLine ( " Saturday " ) ; else if ( day == 6 ) Console . WriteLine ( " Sunday " ) ; else Console . WriteLine ( " INPUT ▁ YEAR ▁ IS ▁ WRONG ! " ) ; } static void Main ( ) { int Y = 2020 , B = 1900 ; findDay ( Y , B ) ; } }

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 modifyArray ( int [ ] arr , int N , int [ , ] Q , int cntQuery ) { int [ ] arr1 = new int [ N + 2 ] ; int [ ] arr2 = new int [ N + 2 ] ; for ( int i = 0 ; i < cntQuery ; i ++ ) { int L = Q [ i , 0 ] + 1 , R = Q [ i , 1 ] + 1 ; arr1 [ L ] ++ ; arr1 [ R + 1 ] -- ; arr2 [ R + 1 ] -= R - L + 1 ; } for ( int i = 1 ; i <= N ; i ++ ) arr1 [ i ] += arr1 [ i - 1 ] ; for ( int i = 1 ; i <= N ; i ++ ) arr2 [ i ] += arr2 [ i - 1 ] + arr1 [ i ] ; for ( int i = 1 ; i <= N ; i ++ ) arr [ i - 1 ] = arr2 [ i ] ; printArray ( arr , N ) ; } public static void Main ( ) { int [ ] arr = { 0 , 0 , 0 , 0 } ; int N = arr . Length ; int [ , ] Q = { { 1 , 3 } , { 0 , 1 } } ; int cntQuery = 2 ; modifyArray ( arr , N , Q , cntQuery ) ; } }

Index/key variables: L, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; public class GFG { static int findProduct ( int number_1 , int number_2 ) { if ( number_1 == Int32 . MinValue number_2 == Int32 . MinValue ) { return 0 ; } else return number_1 * number_2 ; } static List < int > calculateProduct ( List < List < int > > List , int index ) { int highest = List [ index ] . Max ( ) ; int lowest = List [ index ] . Min ( ) ; if ( index + 1 == List . Count ) { if ( lowest < 0 && highest >= 0 ) { return ( new List < int > ( ) { highest , lowest } ) ; } else if ( lowest <= 0 && highest <= 0 ) { return ( new List < int > ( ) { Int32 . MinValue , lowest } ) ; } else if ( lowest >= 0 && highest >= 0 ) { return ( new List < int > ( ) { highest , Int32 . MinValue } ) ; } } List < int > temp = calculateProduct ( List , index + 1 ) ; int positive = temp [ 0 ] ; int negative = temp [ 1 ] ; int highPos = findProduct ( highest , positive ) ; int highNeg = findProduct ( highest , negative ) ; int lowPos = findProduct ( lowest , positive ) ; int lowNeg = findProduct ( lowest , negative ) ; if ( lowest < 0 && highest >= 0 ) { return ( new List < int > ( ) { Math . Max ( highPos , lowNeg ) , Math . Min ( highNeg , lowPos ) } ) ; } else if ( lowest <= 0 && highest <= 0 ) { return ( new List < int > ( ) { lowNeg , lowPos } ) ; } else if ( lowest >= 0 && highest >= 0 ) { return ( new List < int > ( ) { Math . Max ( lowPos , highPos ) , Math . Min ( lowNeg , highNeg ) } ) ; } return ( new List < int > ( ) { 0 , 0 } ) ; } static public void Main ( ) { List < List < int > > arr = new List < List < int > > ( ) ; arr . Add ( new List < int > ( ) { - 3 , - 4 } ) ; arr . Add ( new List < int > ( ) { 1 , 2 , - 3 } ) ; List < int > ans = calculateProduct ( arr , 0 ) ; Console . WriteLine ( ans [ 0 ] ) ; } }

Index/key variables: index
Class/struct names: GFG
C# program:
using System ; class GFG { static void maxNumTrailNine ( int n , int d ) { int res = n ; int cntDigits = ( int ) Math . Log10 ( n ) + 1 ; int p10 = 10 ; for ( int i = 1 ; i <= cntDigits ; i ++ ) { if ( n % p10 >= d ) { break ; } else { res = n - n % p10 - 1 ; } p10 = p10 * 10 ; } Console . WriteLine ( res ) ; } public static void Main ( String [ ] args ) { int n = 1025 , d = 6 ; maxNumTrailNine ( n , d ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MinimumNoOfWays ( int [ ] arr , int n ) { int mini_no_of_ways ; if ( n % 2 == 0 ) { mini_no_of_ways = n / 2 ; } else { mini_no_of_ways = n / 2 + 1 ; } return mini_no_of_ways ; } public static void Main ( string [ ] args ) { int [ ] arr = { 3 , 4 , 2 , 1 , 5 } ; int N = arr . Length ; Console . WriteLine ( MinimumNoOfWays ( arr , N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { public static int minChocolates ( int [ ] a , int n ) { int i = 0 , j = 0 ; int res = 0 , val = 1 ; while ( j < n - 1 ) { if ( a [ j ] > a [ j + 1 ] ) { j += 1 ; continue ; } if ( i == j ) res += val ; else { res += get_sum ( val , i , j ) ; } if ( a [ j ] < a [ j + 1 ] ) val += 1 ; else val = 1 ; j += 1 ; i = j ; } if ( i == j ) res += val ; else res += get_sum ( val , i , j ) ; return res ; } public static int get_sum ( int peak , int start , int end ) { int count = end - start + 1 ; peak = ( peak > count ) ? peak : count ; int s = peak + ( ( ( count - 1 ) * count ) >> 1 ) ; return s ; } static public void Main ( ) { int [ ] a = { 5 , 5 , 4 , 3 , 2 , 1 } ; int n = a . Length ; Console . WriteLine ( " Minimum ▁ number ▁ of ▁ chocolates ▁ = ▁ " + minChocolates ( a , n ) ) ; } }

Index/key variables: j
Accumulator variables: j, res, val
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static int [ ] RemoveElemArr ( int [ ] arr , int n , int k ) { if ( n == 0 n == 1 ) return arr ; int j = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( j < k arr [ i ] > arr [ j - k ] ) { arr [ j ++ ] = arr [ i ] ; } } while ( arr . Length > j ) { arr = arr . Take ( arr . Length - 1 ) . ToArray ( ) ; } return arr ; } static void printArray ( int [ ] arr ) { for ( int i = 0 ; i < arr . Length ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } static void UtilRemov ( int [ ] arr , int n , int k ) { arr = RemoveElemArr ( arr , n , k ) ; printArray ( arr ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 2 , 3 , 4 , 4 , 4 , 5 , 5 } ; int k = 2 ; int n = arr . Length ; UtilRemov ( arr , n , k ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void pairs_after_removing ( int [ ] arr , int N ) { int cntPairs = 0 ; 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 ; } } foreach ( KeyValuePair < int , int > element in mp ) { int i = element . Key ; cntPairs += mp [ i ] * ( mp [ i ] - 1 ) / 2 ; } for ( int i = 0 ; i < N ; i ++ ) { int pairs_after_arr_i_removed = cntPairs + 1 - mp [ arr [ i ] ] ; Console . Write ( pairs_after_arr_i_removed + " ▁ " ) ; } return ; } public static void Main ( ) { int [ ] arr = { 2 , 3 , 4 , 3 , 2 } ; int N = arr . Length ; pairs_after_removing ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: cntPairs, i
Iterator variables: element, i
Class/struct names: GFG
C# program:
using System ; 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 ) { if ( N % 2 == 0 ) { N += K * 2 ; } else { N += smallestDivisorGr1 ( N ) + ( K - 1 ) * 2 ; } return N ; } static public void Main ( ) { 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 ; using System . Collections . Generic ; class GFG { static int CntOfSubsetsByPartitioning ( int [ ] arr , int N ) { Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( freq . ContainsKey ( arr [ i ] ) ) { freq [ arr [ i ] ] = freq [ arr [ i ] ] + 1 ; } else { freq . Add ( arr [ i ] , 1 ) ; } } int freqGCD = 0 ; foreach ( KeyValuePair < int , int > i in freq ) { freqGCD = __gcd ( freqGCD , i . Value ) ; } return ( N ) / freqGCD ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 4 , 3 , 2 , 1 } ; int N = arr . Length ; Console . Write ( CntOfSubsetsByPartitioning ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { private static int r , c ; static int [ , ] dir = { { 1 , 0 } , { - 1 , 0 } , { 0 , 1 } , { 0 , - 1 } , { - 1 , - 1 } , { - 1 , 1 } , { 1 , 1 } , { 1 , - 1 } } ; public static bool valid ( int i , int j ) { if ( i >= 0 && j >= 0 && i < r && j < c ) return true ; return false ; } static int find ( int i , int j , int [ , ] v ) { int s = 0 ; for ( int k = 0 ; k < 8 ; k ++ ) { int ni = i + dir [ k , 0 ] , nj = j + dir [ k , 1 ] ; if ( valid ( ni , nj ) ) s += v [ ni , nj ] ; } return s ; } static void findsumofneighbors ( int [ , ] M ) { int [ , ] v = new int [ r , c ] ; for ( int i = 0 ; i < r ; i ++ ) { for ( int j = 0 ; j < c ; j ++ ) { v [ i , j ] = find ( i , j , M ) ; Console . Write ( v [ i , j ] + " ▁ " ) ; } Console . WriteLine ( " " ) ; } } public static void Main ( String [ ] args ) { int [ , ] M = { { 1 , 4 , 1 } , { 2 , 4 , 5 } , { 3 , 1 , 2 } } ; r = M . GetLength ( 0 ) ; c = M . GetLength ( 1 ) ; findsumofneighbors ( M ) ; } }

Accumulator variables: i, j, k, s
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int [ , ] T = new int [ 2000 , 2000 ] ; static int [ , ] result = new int [ 2000 , 2000 ] ; static void mul_2 ( int K ) { int [ , ] temp = new int [ K + 1 , K + 1 ] ; for ( int i = 1 ; i <= K ; i ++ ) { for ( int j = 1 ; j <= K ; j ++ ) { for ( int k = 1 ; k <= K ; k ++ ) { temp [ i , j ] = ( temp [ i , j ] + ( T [ i , k ] * T [ k , j ] ) % mod ) % mod ; } } } for ( int i = 1 ; i <= K ; i ++ ) { for ( int j = 1 ; j <= K ; j ++ ) { T [ i , j ] = temp [ i , j ] ; } } } static void mul_1 ( int K ) { int [ , ] temp = new int [ K + 1 , K + 1 ] ; for ( int i = 1 ; i <= K ; i ++ ) { for ( int j = 1 ; j <= K ; j ++ ) { for ( int k = 1 ; k <= K ; k ++ ) { temp [ i , j ] = ( temp [ i , j ] + ( result [ i , k ] * T [ k , j ] ) % mod ) % mod ; } } } for ( int i = 1 ; i <= K ; i ++ ) { for ( int j = 1 ; j <= K ; j ++ ) { result [ i , j ] = temp [ i , j ] ; } } } static void matrix_pow ( int K , int n ) { for ( int i = 1 ; i <= K ; i ++ ) { for ( int j = 1 ; j <= K ; j ++ ) { if ( i == j ) result [ i , j ] = 1 ; } } while ( n > 0 ) { if ( n % 2 == 1 ) mul_1 ( K ) ; mul_2 ( K ) ; n /= 2 ; } } static int NthTerm ( int [ ] F , int [ ] C , int K , int n ) { for ( int i = 1 ; i <= K ; i ++ ) T [ i , K ] = C [ K - i ] ; for ( int i = 1 ; i <= K ; i ++ ) T [ i + 1 , i ] = 1 ; matrix_pow ( K , n ) ; int answer = 0 ; for ( int i = 1 ; i <= K ; i ++ ) { answer += F [ i - 1 ] * result [ i , 1 ] ; } Console . Write ( answer + " STRNEWLINE " ) ; return 0 ; } public static void Main ( String [ ] args ) { int [ ] F = { 1 , 2 , 3 } ; int [ ] C = { 1 , 1 , 1 } ; int K = 3 ; int N = 10 ; NthTerm ( F , C , K , N ) ; } }

Accumulator variables: answer, i, j, k, n
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static double nthRoot ( int A , int N ) { Random rand = new Random ( ) ; double xPre = ( rand . Next ( ) * 10 ) % 10 ; double eps = 1e-3 ; double delX = Int32 . MaxValue ; double xK = 0 ; while ( delX > eps ) { xK = ( ( N - 1.0 ) * xPre + ( double ) A / Math . Pow ( xPre , N - 1 ) ) / ( double ) N ; delX = Math . Abs ( xK - xPre ) ; xPre = xK ; } return xK ; } static float RMNValue ( int [ ] arr , int n , int k ) { int Nth = 0 ; float mean = 0 , root = 0 ; for ( int i = 0 ; i < n ; i ++ ) { Nth += ( int ) Math . Pow ( arr [ i ] , k ) ; } mean = ( Nth / ( float ) ( n ) ) ; root = ( float ) nthRoot ( ( int ) mean , k ) ; return root ; } public static void Main ( ) { int [ ] arr = { 10 , 4 , 6 , 8 } ; int N = arr . Length ; int K = 3 ; Console . Write ( RMNValue ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: Nth, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static Stack < int > PushStack ( Stack < int > N1 , Stack < int > N2 ) { Stack < int > res = new Stack < int > ( ) ; int sum = 0 , rem = 0 ; while ( N1 . Count != 0 && N2 . Count != 0 ) { sum = ( rem + N1 . Peek ( ) + N2 . Peek ( ) ) ; res . Push ( ( int ) sum % 10 ) ; rem = sum / 10 ; N1 . Pop ( ) ; N2 . Pop ( ) ; } while ( N1 . Count != 0 ) { sum = ( rem + N1 . Peek ( ) ) ; res . Push ( sum % 10 ) ; rem = sum / 10 ; N1 . Pop ( ) ; } while ( N2 . Count != 0 ) { sum = ( rem + N2 . Peek ( ) ) ; res . Push ( sum % 10 ) ; rem = sum / 10 ; N2 . Pop ( ) ; } while ( rem > 0 ) { res . Push ( rem ) ; rem /= 10 ; } while ( res . Count != 0 ) { N1 . Push ( res . Peek ( ) ) ; res . Pop ( ) ; } res = N1 ; return res ; } static void display ( Stack < int > res ) { int N = res . Count ; String s = " " ; while ( res . Count != 0 ) { s = String . Join ( " " , res . Peek ( ) ) + s ; res . Pop ( ) ; } Console . Write ( s + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { Stack < int > N1 = new Stack < int > ( ) ; N1 . Push ( 5 ) ; N1 . Push ( 8 ) ; N1 . Push ( 7 ) ; N1 . Push ( 4 ) ; Stack < int > N2 = new Stack < int > ( ) ; N2 . Push ( 2 ) ; N2 . Push ( 1 ) ; N2 . Push ( 3 ) ; Stack < int > res = PushStack ( N1 , N2 ) ; display ( res ) ; } }

Accumulator variables: rem
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( double x ) { double sr = Math . Sqrt ( x ) ; return ( ( sr - Math . Floor ( sr ) ) == 0 ) ; } static void checkFactors ( int x ) { if ( isPerfectSquare ( x ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } public static void Main ( String [ ] args ) { int N = 36 ; checkFactors ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int total_xor ; static void initialize_xor ( int [ ] arr , int n ) { for ( int i = 0 ; i < n ; i ++ ) { total_xor = total_xor ^ arr [ i ] ; } } static void find_xor ( int X , int Y ) { total_xor = total_xor ^ X ; total_xor = total_xor ^ Y ; Console . Write ( total_xor + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 7 , 8 , 9 } ; int n = arr . Length ; initialize_xor ( arr , n ) ; int [ , ] Q = { { 5 , 6 } , { 8 , 1 } } ; for ( int i = 0 ; i < Q . GetLength ( 0 ) ; i ++ ) { find_xor ( Q [ i , 0 ] , Q [ i , 1 ] ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int isUgly ( int n ) { if ( n == 1 ) return 1 ; if ( n <= 0 ) return 0 ; if ( n % 2 == 0 ) { return ( isUgly ( n / 2 ) ) ; } if ( n % 3 == 0 ) { return ( isUgly ( n / 3 ) ) ; } if ( n % 5 == 0 ) { return ( isUgly ( n / 5 ) ) ; } return 0 ; } public static void Main ( String [ ] args ) { int no = isUgly ( 14 ) ; if ( no == 1 ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int maxGCD ( int N ) { for ( int i = 2 ; i * i <= N ; i ++ ) { if ( N % i == 0 ) { return N / i ; } } return 1 ; } public static void Main ( String [ ] args ) { int N = 33 ; Console . WriteLine ( " Maximum ▁ Possible ▁ GCD ▁ " + " value ▁ is ▁ : ▁ " + maxGCD ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int min_value ( int [ ] arr , int N ) { int X , K ; HashSet < int > S = new HashSet < int > ( ) ; for ( int i = 0 ; i < N ; i ++ ) { S . Add ( arr [ i ] ) ; } int count = 0 ; for ( int i = 1 ; i <= 1024 ; i ++ ) { count = 0 ; foreach ( int it in S ) { X = ( ( i it ) - ( i & it ) ) ; if ( S . Contains ( X ) ) { count ++ ; } } if ( count == S . Count ) { K = i ; return K ; } } return - 1 ; } static void Main ( ) { int [ ] arr = { 1 , 0 , 3 , 3 , 0 , 2 } ; int N = arr . Length ; Console . Write ( min_value ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static int sum ( int n ) { int sum = 0 ; while ( n != 0 ) { int r = n % 10 ; sum = sum + r ; n = n / 10 ; } return sum ; } static bool isJunction ( int n ) { int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i + sum ( i ) == n ) count ++ ; } return count >= 2 ; } public static void Main ( ) { int N = 111 ; if ( isJunction ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int digProduct ( int n ) { int product = 1 ; while ( n != 0 ) { product = product * ( n % 10 ) ; n = n / 10 ; } return product ; } 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 int nextPrime ( int N ) { if ( N <= 1 ) return 2 ; int prime = N ; bool found = false ; while ( ! found ) { prime ++ ; if ( isPrime ( prime ) ) found = true ; } return prime ; } static bool isPointerPrime ( int n ) { if ( isPrime ( n ) && ( n + digProduct ( n ) == nextPrime ( n ) ) ) return true ; else return false ; } public static void Main ( ) { int N = 23 ; if ( isPointerPrime ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: prime
Iterator variables: i
Boolean variables: found
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int y ) { if ( y == 0 ) { return 1 ; } if ( y % 2 == 0 ) { return ( power ( x , y / 2 ) * power ( x , y / 2 ) ) ; } return ( x * power ( x , y / 2 ) * power ( x , y / 2 ) ) ; } static bool isPerfectDigitalInvariant ( int x ) { for ( int fixed_power = 1 ; ; fixed_power ++ ) { int temp = x , sum = 0 ; while ( temp > 0 ) { int r = temp % 10 ; sum += power ( r , fixed_power ) ; temp = temp / 10 ; } if ( sum == x ) { return true ; } if ( sum > x ) { return false ; } } } public static void Main ( String [ ] args ) { int N = 4150 ; if ( isPerfectDigitalInvariant ( N ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Accumulator variables: fixed_power, sum
Iterator variables: fixed_power
Class/struct names: GFG