dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void smlstNonNeg ( int [ ] arr , int N ) { int smNonNeg = 0 ; bool [ ] hash = new bool [ N + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { hash [ i ] = false ; } for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] >= 0 && arr [ i ] < N ) { hash [ arr [ i ] ] = true ; } while ( hash [ smNonNeg ] ) { smNonNeg ++ ; } Console . Write ( smNonNeg + " ▁ " ) ; } } public static void Main ( ) { int [ ] arr = { 0 , 1 , 2 , 3 , 5 } ; int N = arr . Length ; smlstNonNeg ( arr , N ) ; } }

Index/key variables: i, smNonNeg
Accumulator variables: i, smNonNeg
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void solve ( int [ ] arr , int N , int X ) { List < int > A = new List < int > ( ) , B = new List < int > ( ) ; int c = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( 2 * arr [ i ] ) < X ) { A . Add ( arr [ i ] ) ; } else if ( ( 2 * arr [ i ] ) > X ) { B . Add ( arr [ i ] ) ; } else { if ( c % 2 == 0 ) { A . Add ( arr [ i ] ) ; } else { B . Add ( arr [ i ] ) ; } c ++ ; } } Console . Write ( " The ▁ First ▁ Array ▁ is ▁ - ▁ " ) ; for ( int i = 0 ; i < A . Count ; i ++ ) { Console . Write ( A [ i ] + " ▁ " ) ; } Console . WriteLine ( ) ; Console . Write ( " The ▁ Second ▁ Array ▁ is ▁ - ▁ " ) ; for ( int i = 0 ; i < B . Count ; i ++ ) { Console . Write ( B [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 5 , 4 , 3 , 6 , 2 , 4 , 3 } ; int X = 7 ; int N = arr . Length ; solve ( arr , N , X ) ; } }

Index/key variables: i
Accumulator variables: c, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int cntMinSub ( int [ ] arr , int N , int K ) { int res = 0 ; int start = 0 ; int end = N - 1 ; Array . Sort ( arr ) ; while ( end - start > 1 ) { if ( arr [ start ] + arr [ end ] <= K ) { start ++ ; } else { res ++ ; end -- ; } } if ( end - start == 1 ) { if ( arr [ start ] + arr [ end ] <= K ) { res ++ ; start ++ ; end -- ; } else { res ++ ; end -- ; } } if ( start == end ) { res ++ ; } return res ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 6 , 8 , 10 , 20 , 25 } ; int N = arr . Length ; int K = 26 ; Console . Write ( cntMinSub ( arr , N , K ) ) ; } }

Index/key variables: end, start
Accumulator variables: end, res, start
Class/struct names: GFG
C# program:
using System ; class GFG { static int condition ( int a , int b ) { int d = Math . Abs ( a - b ) , count = 0 ; for ( int i = 1 ; i <= Math . Sqrt ( d ) ; i ++ ) { if ( d % i == 0 ) { if ( d / i == i ) count += 1 ; else count += 2 ; } } return count ; } public static void Main ( String [ ] args ) { int x = 2 , y = 6 ; Console . WriteLine ( condition ( x , y ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isComposite ( int N ) { for ( int i = 2 ; i * i <= N ; i ++ ) { if ( N % i == 0 ) { return true ; } } return false ; } static int compositePair ( int [ ] arr , int N ) { int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { int prod = arr [ i ] * arr [ j ] ; if ( isComposite ( prod ) ) { res ++ ; } } } return res ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 1 , 2 , 2 , 8 } ; int N = arr . Length ; Console . WriteLine ( compositePair ( arr , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, res
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static long power ( int x , int y ) { if ( y == 0 ) return 1 ; int p = ( int ) ( power ( x , y / 2 ) % mod ) ; p = ( p * p ) % mod ; if ( y % 2 == 1 ) { p = ( x * p ) % mod ; } return p ; } static int TotalNumber ( int N ) { int ans = ( int ) ( ( power ( 10 , N ) - 2 * power ( 9 , N ) + power ( 8 , N ) + 2 * mod ) % mod ) ; return ans ; } public static void Main ( String [ ] args ) { int N = 10 ; Console . Write ( TotalNumber ( N ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void generateArray ( int [ ] arr , int n ) { List < int > ans = new List < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( i & 1 ) != 0 ) ans . Insert ( 0 , arr [ i ] ) ; else ans . Add ( arr [ i ] ) ; } if ( ( n & 1 ) != 0 ) { ans . Reverse ( ) ; } foreach ( int x in ans ) { Console . Write ( x + " ▁ " ) ; } Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { int n = 4 ; int [ ] arr = { 1 , 2 , 3 , 4 } ; generateArray ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { public static string closestgtNum ( string str ) { string res = " " ; int n = str . Length ; if ( str [ 0 ] < '9' ) { res = res + ( char ) ( str [ 0 ] + 1 ) ; } else { res = res + '1' ; res = res + '0' ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { res = res + '0' ; } return res ; } static void Main ( ) { string str = "120" ; Console . WriteLine ( closestgtNum ( str ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maximumSubarrays ( int [ ] arr , int N , int target ) { int ans = 0 ; int availIdx = - 1 ; int cur_sum = 0 ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; mp . Add ( 0 , 1 ) ; for ( int i = 0 ; i < N ; i ++ ) { cur_sum += arr [ i ] ; if ( mp . ContainsKey ( cur_sum - target ) && mp [ cur_sum - target ] >= availIdx ) { ans ++ ; availIdx = i ; } if ( mp . ContainsKey ( cur_sum ) ) mp [ cur_sum ] = i ; else mp . Add ( cur_sum , i ) ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , - 1 , 4 , 3 , 6 , 4 , 5 , 1 } ; int N = arr . Length ; int target = 6 ; Console . Write ( maximumSubarrays ( arr , N , target ) ) ; } }

Index/key variables: cur_sum, i
Accumulator variables: ans, cur_sum, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int y ) { int temp ; if ( y == 0 ) return 1 ; temp = power ( x , y / 2 ) ; if ( y % 2 == 0 ) return temp * temp ; else return x * temp * temp ; } public static void maximumPossibleSum ( int N , int X ) { Console . WriteLine ( X * ( power ( 2 , N ) - 1 ) ) ; } public static void Main ( String [ ] args ) { int N = 3 , X = 5 ; maximumPossibleSum ( N , X ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countOfPairs ( int x , int y ) { int counter = 1 ; while ( x > 0 y > 0 ) { int bit1 = x % 2 ; int bit2 = y % 2 ; x >>= 1 ; y >>= 1 ; if ( bit1 == 1 && bit2 == 0 ) { counter *= 2 ; continue ; } if ( ( bit1 & bit2 ) > 0 ) { counter = 0 ; break ; } } return counter ; } public static void Main ( String [ ] args ) { int X = 2 , Y = 5 ; Console . Write ( countOfPairs ( X , Y ) ) ; } }

Accumulator variables: counter
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 findGCD ( int [ ] arr , int N ) { int result = 0 ; foreach ( int element in arr ) { result = gcd ( result , element ) ; if ( result == 1 ) { return 1 ; } } return result ; } public static void Main ( ) { int [ ] arr = { 2 , 3 , 4 } ; int N = arr . Length ; Console . WriteLine ( findGCD ( arr , N ) ) ; } }

Iterator variables: element
Class/struct names: GFG
C# program:
using System ; class GFG { static void factorsOf3 ( int [ ] arr , int N ) { int a = 0 , b = 0 , c = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 3 == 0 ) a ++ ; else if ( arr [ i ] % 3 == 1 ) b ++ ; else if ( arr [ i ] % 3 == 2 ) c ++ ; } if ( a >= 1 && a <= b + c + 1 ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else if ( a == 0 && b == 0 && c > 0 ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else if ( a == 0 && c == 0 && b > 0 ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else Console . Write ( " No " + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 3 } ; int N = arr . Length ; factorsOf3 ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: a, b, c, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool check_digits ( long N ) { while ( N > 0 ) { int n = ( int ) ( N % 10 ) ; if ( ( n != 0 ) && ( n != 1 ) && ( n != 4 ) && ( n != 9 ) ) { return false ; } N = N / 10 ; } return true ; } static bool is_perfect ( long N ) { double n = Math . Sqrt ( N ) ; if ( Math . Floor ( n ) != Math . Ceiling ( n ) ) { return false ; } return true ; } static void isFullSquare ( long N ) { if ( is_perfect ( N ) && check_digits ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } public static void Main ( ) { long N = 144 ; isFullSquare ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void countSubString ( char [ ] s , int n ) { Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) if ( mp . ContainsKey ( s [ i ] ) ) { mp [ s [ i ] ] = mp [ s [ i ] ] + 1 ; } else { mp . Add ( s [ i ] , 1 ) ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int cnt = 0 ; if ( mp . ContainsKey ( s [ i ] ) ) { mp [ s [ i ] ] = mp [ s [ i ] ] - 1 ; foreach ( KeyValuePair < char , int > value in mp ) { if ( value . Key == s [ i ] ) { continue ; } else { cnt += value . Value ; } } ans += cnt ; } } Console . Write ( ans ) ; } public static void Main ( String [ ] args ) { String S = " abcab " ; int N = 5 ; countSubString ( S . ToCharArray ( ) , N ) ; } }

Index/key variables: i
Accumulator variables: ans, cnt, i
Iterator variables: i, value
Class/struct names: GFG
C# program:
using System ; class GFG { static int maxBottles ( int n , int e ) { int s = 0 , b = 0 ; int a = n ; while ( a != 0 ) { s = s + a ; a = ( a + b ) / e ; b = n - ( a * e ) ; n = a + b ; } return s ; } public static void Main ( ) { int n = 9 , e = 3 ; int s = maxBottles ( n , e ) ; Console . Write ( s + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int n ) { int temp ; if ( n == 0 ) return 1 ; temp = power ( x , n / 2 ) ; if ( n % 2 == 0 ) return temp * temp ; else return x * temp * temp ; } static int count_Total_Numbers ( int n , int x ) { int total , multiples = 0 ; for ( int i = 0 ; i < 10 ; i ++ ) { if ( i % x == 0 ) multiples ++ ; } if ( n == 1 ) return multiples ; total = ( multiples - 1 ) * power ( multiples , n - 1 ) ; return total ; } public static void Main ( ) { int N = 1 , X = 3 ; Console . Write ( count_Total_Numbers ( N , X ) ) ; } }

Accumulator variables: i, multiples
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getPosition ( int N , int M ) { if ( M > ( N / 2 ) ) { return ( M - ( N / 2 ) ) ; } return ( M + ( N / 2 ) ) ; } public static void Main ( String [ ] args ) { int N = 8 , M = 5 ; Console . Write ( getPosition ( N , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void number_of_strings ( int N , int M ) { int ans = 0 ; while ( N > 0 && M > 0 ) { if ( N > M ) { if ( N >= 2 ) { N -= 2 ; -- M ; ++ ans ; } else { break ; } } else { if ( M >= 2 ) { M -= 2 ; -- N ; ++ ans ; } else { break ; } } } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { int N = 4 , M = 19 ; number_of_strings ( N , M ) ; } }

Accumulator variables: M, N
Class/struct names: GFG
C# program:
using System ; class GFG { static int minLength ( int [ ] A , int N ) { int elem = A [ 0 ] , count = 1 ; for ( int i = 1 ; i < N ; i ++ ) { if ( A [ i ] == elem ) { count ++ ; } else { break ; } } if ( count == N ) return N ; else return 1 ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 1 , 3 , 1 } ; int N = arr . Length ; Console . Write ( minLength ( arr , N ) + " STRNEWLINE " ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool NegEqu ( int N , int X , int Y ) { while ( X > 0 && ( N > N / 2 + 10 ) ) { N = N / 2 + 10 ; X -= 1 ; } while ( Y > 0 ) { N = N - 10 ; Y -= 1 ; } if ( N <= 0 ) return true ; return false ; } public static void Main ( String [ ] args ) { int N = 100 ; int X = 3 ; int Y = 4 ; if ( NegEqu ( N , X , Y ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Accumulator variables: X, Y
Class/struct names: GFG
C# program:
using System ; class GFG { static int minSubarrays ( int [ ] arr , int n ) { int right = n - 1 ; int left = 0 ; int subarrays = 0 ; while ( right >= 0 ) { for ( left = 0 ; left <= right ; left += 1 ) { if ( __gcd ( arr [ left ] , arr [ right ] ) > 1 ) { subarrays += 1 ; right = left - 1 ; break ; } if ( left == right && __gcd ( arr [ left ] , arr [ right ] ) == 1 ) { return 0 ; } } } return subarrays ; } static int __gcd ( int a , int b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } public static void Main ( ) { int N = 6 ; int [ ] arr = { 2 , 3 , 4 , 4 , 4 , 3 } ; Console . Write ( minSubarrays ( arr , N ) ) ; } }

Index/key variables: left, right
Accumulator variables: left, subarrays
Iterator variables: left
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMaxSoln ( int n , int x , int y ) { int ans = int . MinValue ; for ( int k = 0 ; k <= n ; k ++ ) { if ( k % x == y ) { ans = Math . Max ( ans , k ) ; } } return ( ( ans >= 0 && ans <= n ) ? ans : - 1 ) ; } public static void Main ( String [ ] args ) { int n = 15 , x = 10 , y = 5 ; Console . Write ( findMaxSoln ( n , x , y ) ) ; } }

Accumulator variables: k
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { static int getCount ( int N , int M ) { int total_count = 0 ; total_count += ( N / 10 ) ; int x = ( N / 10 ) * 10 ; if ( ( N - x ) >= M ) { total_count = total_count + 1 ; } return total_count ; } public static void Main ( String [ ] args ) { int N = 100 , M = 1 ; Console . Write ( getCount ( N , M ) ) ; } }

Accumulator variables: total_count
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int RightAngled ( int [ , ] a , int n ) { Dictionary < int , int > xpoints = new Dictionary < int , int > ( ) ; Dictionary < int , int > ypoints = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( xpoints . ContainsKey ( a [ i , 0 ] ) ) { xpoints [ a [ i , 0 ] ] = xpoints [ a [ i , 0 ] ] + 1 ; } else { xpoints . Add ( a [ i , 0 ] , 1 ) ; } if ( ypoints . ContainsKey ( a [ i , 1 ] ) ) { ypoints [ a [ i , 1 ] ] = ypoints [ a [ i , 1 ] ] + 1 ; } else { ypoints . Add ( a [ i , 1 ] , 1 ) ; } } int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( xpoints [ a [ i , 0 ] ] >= 1 && ypoints [ a [ i , 1 ] ] >= 1 ) { count += ( xpoints [ a [ i , 0 ] ] - 1 ) * ( ypoints [ a [ i , 1 ] ] - 1 ) ; } } return count ; } public static void Main ( String [ ] args ) { int N = 5 ; int [ , ] arr = { { 1 , 2 } , { 2 , 1 } , { 2 , 2 } , { 2 , 3 } , { 3 , 2 } } ; Console . Write ( RightAngled ( arr , N ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printArray ( List < int > brr ) { foreach ( int it in brr ) { Console . Write ( it + " ▁ " ) ; } } static void RepeatingSubarray ( int [ ] arr , int N ) { if ( N < 2 ) { Console . Write ( " - 1" ) ; } List < int > brr = new List < int > ( ) ; brr . Add ( arr [ 0 ] ) ; brr . Add ( arr [ 1 ] ) ; for ( int i = 2 ; i < N / 2 + 1 ; i ++ ) { if ( N % i == 0 ) { bool a = false ; int n = brr . Count ; int j = i ; while ( j < N ) { int K = j % i ; if ( arr [ j ] == brr [ K ] ) { j ++ ; } else { a = true ; break ; } } if ( ! a && j == N ) { printArray ( brr ) ; return ; } } brr . Add ( arr [ i ] ) ; } Console . Write ( " - 1" ) ; return ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 2 , 1 , 2 , 2 , 1 , 2 , 2 } ; int N = arr . Length ; RepeatingSubarray ( arr , N ) ; } }

Index/key variables: K, i, j
Accumulator variables: i, j
Iterator variables: i, it
Boolean variables: a
Class/struct names: GFG
C# program:
using System ; class GFG { static void printMissingElements ( int [ ] arr , int N ) { int diff = arr [ 0 ] - 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] - i != diff ) { while ( diff < arr [ i ] - i ) { Console . Write ( i + diff + " ▁ " ) ; diff ++ ; } } } } static void Main ( ) { int [ ] arr = { 6 , 7 , 10 , 11 , 13 } ; int N = arr . Length ; printMissingElements ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: diff, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printMissingElements ( int [ ] arr , int N ) { int [ ] b = new int [ arr [ N - 1 ] + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { b [ arr [ i ] ] = 1 ; } for ( int i = arr [ 0 ] ; i <= arr [ N - 1 ] ; i ++ ) { if ( b [ i ] == 0 ) { Console . Write ( i + " ▁ " ) ; } } } public static void Main ( String [ ] args ) { int [ ] arr = { 6 , 7 , 10 , 11 , 13 } ; int N = arr . Length ; printMissingElements ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int smallestCommon ( int a , int b , int c , int d ) { if ( a == c ) return a ; if ( a > c ) { swap ( a , c ) ; swap ( b , d ) ; } int first_term_diff = ( c - a ) ; int possible_y ; for ( possible_y = 0 ; possible_y < b ; possible_y ++ ) { if ( ( first_term_diff % b + possible_y * d ) % b == 0 ) { break ; } } if ( possible_y != b ) { return c + possible_y * d ; } return - 1 ; } static void swap ( int x , int y ) { int temp = x ; x = y ; y = temp ; } public static void Main ( String [ ] args ) { int A = 2 , B = 20 , C = 19 , D = 9 ; Console . Write ( smallestCommon ( A , B , C , D ) ) ; } }

Accumulator variables: possible_y
Iterator variables: possible_y
Class/struct names: GFG
C# program:
using System ; class GFG { static int MinimumFlips ( String s , int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = ( s [ i ] == '1' ? 1 : 0 ) ; } int [ ] oddone = new int [ n + 1 ] ; int [ ] evenone = new int [ n + 1 ] ; oddone [ 0 ] = 0 ; evenone [ 0 ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( i % 2 != 0 ) { oddone [ i + 1 ] = oddone [ i ] + ( a [ i ] == 1 ? 1 : 0 ) ; evenone [ i + 1 ] = evenone [ i ] + ( a [ i ] == 0 ? 1 : 0 ) ; } else { oddone [ i + 1 ] = oddone [ i ] + ( a [ i ] == 0 ? 1 : 0 ) ; evenone [ i + 1 ] = evenone [ i ] + ( a [ i ] == 1 ? 1 : 0 ) ; } } int minimum = Math . Min ( oddone [ n ] , evenone [ n ] ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( n % 2 != 0 ) { minimum = Math . Min ( minimum , oddone [ n ] - oddone [ i + 1 ] + evenone [ i + 1 ] ) ; minimum = Math . Min ( minimum , evenone [ n ] - evenone [ i + 1 ] + oddone [ i + 1 ] ) ; } } return minimum ; } public static void Main ( String [ ] args ) { String S = "000001100" ; int n = S . Length ; Console . Write ( MinimumFlips ( S , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int isprm ( int n ) { if ( n <= 1 ) return 0 ; if ( n <= 3 ) return 1 ; if ( n % 2 == 0 n % 3 == 0 ) return 0 ; for ( int i = 5 ; i * i <= n ; i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return 0 ; return 1 ; } static void shortestpath ( int m , int n ) { List < int > mfactor = new List < int > ( ) ; List < int > nfactor = new List < int > ( ) ; Dictionary < int , int > fre = new Dictionary < int , int > ( ) ; mfactor . Add ( m ) ; fre . Add ( m , 1 ) ; while ( m != 1 ) { if ( isprm ( m ) != 0 ) { mfactor . Add ( 1 ) ; if ( ! fre . ContainsKey ( 1 ) ) fre . Add ( 1 , 1 ) ; m = 1 ; } else { for ( int i = 2 ; i <= Math . Sqrt ( m ) ; i ++ ) { if ( m % i == 0 ) { mfactor . Add ( m / i ) ; if ( ! fre . ContainsKey ( m / i ) ) fre . Add ( m / i , 1 ) ; m = ( m / i ) ; break ; } } } } nfactor . Add ( n ) ; while ( fre . ContainsKey ( n ) && fre [ n ] != 1 ) { if ( isprm ( n ) != 0 ) { nfactor . Add ( 1 ) ; n = 1 ; } else { for ( int i = 2 ; i <= Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { nfactor . Add ( n / i ) ; n = ( n / i ) ; break ; } } } } for ( int i = 0 ; i < mfactor . Count ; i ++ ) { if ( mfactor [ i ] == n ) break ; Console . Write ( mfactor [ i ] + " ▁ < - - > ▁ " ) ; } for ( int i = nfactor . Count - 1 ; i >= 0 ; i -- ) { if ( i == 0 ) Console . Write ( nfactor [ i ] ) ; else Console . Write ( nfactor [ i ] + " ▁ < - - > ▁ " ) ; } } public static void Main ( String [ ] args ) { int m = 18 , n = 19 ; shortestpath ( m , n ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static int mod = ( int ) ( 1e9 + 7 ) ; static int NumberOfTrees ( int [ ] arr , int N ) { int maxElement = arr . Max ( ) ; int [ ] level = new int [ maxElement + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { level [ arr [ i ] ] ++ ; } if ( arr [ 0 ] != 0 level [ 0 ] != 1 ) { return 0 ; } int ans = 1 ; for ( int i = 0 ; i < maxElement ; i ++ ) { for ( int j = 0 ; j < level [ i + 1 ] ; j ++ ) { ans = ( ans * level [ i ] ) % mod ; } } return ans ; } public static void Main ( String [ ] args ) { int N = 7 ; int [ ] arr = { 0 , 3 , 2 , 1 , 2 , 2 , 1 } ; Console . Write ( NumberOfTrees ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Linq ; class GFG { static int mod = ( int ) 1e9 + 7 ; static int power ( int x , int y ) { if ( y == 0 ) return 1 ; int p = power ( x , y / 2 ) % mod ; p = ( p * p ) % mod ; if ( ( y & 1 ) != 0 ) p = ( x * p ) % mod ; return p ; } static int NumberOfTrees ( int [ ] arr , int N ) { int maxElement = arr . Max ( ) ; int [ ] level = new int [ maxElement + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { level [ arr [ i ] ] ++ ; } if ( arr [ 0 ] != 0 level [ 0 ] != 1 ) { return 0 ; } int ans = 1 ; for ( int i = 0 ; i < maxElement ; i ++ ) { ans = ( ans * power ( level [ i ] , level [ i + 1 ] ) ) % mod ; } return ans ; } public static void Main ( String [ ] args ) { int N = 7 ; int [ ] arr = { 0 , 3 , 2 , 1 , 2 , 2 , 1 } ; Console . Write ( NumberOfTrees ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static String gameMax ( String S ) { int N = S . Length ; List < int > list = new List < int > ( ) ; int one = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( S [ i ] == '1' ) { one ++ ; } else { if ( one != 0 ) { list . Add ( one ) ; } one = 0 ; } } if ( one != 0 ) { list . Add ( one ) ; } list . Sort ( ) ; list . Reverse ( ) ; int score_1 = 0 , score_2 = 0 ; for ( int i = 0 ; i < list . Count ; i ++ ) { if ( list [ i ] % 2 == 1 ) { score_1 += list [ i ] ; } else { score_2 += list [ i ] ; } } if ( score_1 == score_2 ) return " - 1" ; return ( score_1 > score_2 ) ? " Player ▁ 1" : " Player ▁ 2" ; } public static void Main ( String [ ] args ) { String S = "11111101" ; Console . WriteLine ( gameMax ( S ) ) ; } }

Index/key variables: i
Accumulator variables: i, one, score_1, score_2
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSetBits ( int x ) { int setBits = 0 ; while ( x != 0 ) { x = x & ( x - 1 ) ; setBits ++ ; } return setBits ; } static int carryCount ( int num1 , int num2 ) { int count = 0 ; while ( num2 != 0 ) { int carry = num1 & num2 ; num1 = num1 ^ num2 ; num2 = carry << 1 ; count += countSetBits ( num2 ) ; } return count ; } public static void Main ( String [ ] args ) { int A = 15 , B = 10 ; Console . Write ( carryCount ( A , B ) ) ; } }

Accumulator variables: count, setBits
Class/struct names: GFG