dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static double polyapothem ( double n , double a ) { if ( a < 0 && n < 0 ) return - 1 ; return ( a / ( 2 * Math . Tan ( ( 180 / n ) * 3.14159 / 180 ) ) ) ; } public static void Main ( ) { double a = 9 , n = 6 ; Console . WriteLine ( Math . Round ( polyapothem ( n , a ) , 4 ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float polyarea ( float n , float a ) { if ( a < 0 && n < 0 ) return - 1 ; float A = ( a * a * n ) / ( float ) ( 4 * Math . Tan ( ( 180 / n ) * 3.14159 / 180 ) ) ; return A ; } public static void Main ( ) { float a = 9 , n = 6 ; Console . WriteLine ( polyarea ( n , a ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double calculateSide ( double n , double r ) { double theta , theta_in_radians ; theta = 360 / n ; theta_in_radians = theta * 3.14 / 180 ; return Math . Round ( 2 * r * Math . Sin ( theta_in_radians / 2 ) , 4 ) ; } public static void Main ( ) { double n = 3 ; double r = 5 ; Console . WriteLine ( calculateSide ( n , r ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float cyl ( float r , float R , float h ) { if ( h < 0 && r < 0 && R < 0 ) return - 1 ; float r1 = r ; float h1 = h ; float V = ( float ) ( 3.14 * Math . Pow ( r1 , 2 ) * h1 ) ; return V ; } public static void Main ( ) { float r = 7 , R = 11 , h = 6 ; Console . WriteLine ( cyl ( r , R , h ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double Perimeter ( double s , int n ) { double perimeter = 1 ; perimeter = n * s ; return perimeter ; } static public void Main ( ) { int n = 5 ; double s = 2.5 , peri ; peri = Perimeter ( s , n ) ; Console . WriteLine ( " Perimeter ▁ of ▁ Regular ▁ Polygon " + " ▁ with ▁ " + n + " ▁ sides ▁ of ▁ length ▁ " + s + " ▁ = ▁ " + peri ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float rhombusarea ( float l , float b ) { if ( l < 0 b < 0 ) return - 1 ; return ( l * b ) / 2 ; } public static void Main ( ) { float l = 16 , b = 6 ; Console . WriteLine ( rhombusarea ( l , b ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool FindPoint ( int x1 , int y1 , int x2 , int y2 , int x , int y ) { if ( x > x1 && x < x2 && y > y1 && y < y2 ) return true ; return false ; } public static void Main ( ) { int x1 = 0 , y1 = 0 , x2 = 10 , y2 = 8 ; int x = 1 , y = 5 ; if ( FindPoint ( x1 , y1 , x2 , y2 , x , y ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void shortest_distance ( float x1 , float y1 , float z1 , float a , float b , float c , float d ) { d = Math . Abs ( ( a * x1 + b * y1 + c * z1 + d ) ) ; float e = ( float ) Math . Sqrt ( a * a + b * b + c * c ) ; Console . Write ( " Perpendicular ▁ distance ▁ " + " is ▁ " + d / e ) ; } public static void Main ( ) { float x1 = 4 ; float y1 = - 4 ; float z1 = 3 ; float a = 2 ; float b = - 2 ; float c = 5 ; float d = 8 ; shortest_distance ( x1 , y1 , z1 , a , b , c , d ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float findVolume ( float l , float b , float h ) { float volume = ( l * b * h ) / 2 ; return volume ; } static public void Main ( ) { float l = 18 , b = 12 , h = 9 ; Console . WriteLine ( " Volume ▁ of ▁ triangular ▁ prism : ▁ " + findVolume ( l , b , h ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isRectangle ( int a , int b , int c , int d ) { if ( a == b && a == c && a == d && c == d && b == c && b == d ) return true ; else if ( a == b && c == d ) return true ; else if ( a == d && c == b ) return true ; else if ( a == c && d == b ) return true ; else return false ; } public static void Main ( ) { int a = 1 , b = 2 , c = 3 , d = 4 ; if ( isRectangle ( a , b , c , d ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void midpoint ( int x1 , int x2 , int y1 , int y2 ) { Console . WriteLine ( ( x1 + x2 ) / 2 + " ▁ , ▁ " + ( y1 + y2 ) / 2 ) ; } public static void Main ( ) { int x1 = - 1 , y1 = 2 ; int x2 = 3 , y2 = - 6 ; midpoint ( x1 , x2 , y1 , y2 ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static double arcLength ( double diameter , double angle ) { double pi = 22.0 / 7.0 ; double arc ; if ( angle >= 360 ) { Console . WriteLine ( " Angle ▁ cannot " + " ▁ be ▁ formed " ) ; return 0 ; } else { arc = ( pi * diameter ) * ( angle / 360.0 ) ; return arc ; } } public static void Main ( ) { double diameter = 25.0 ; double angle = 45.0 ; double arc_len = arcLength ( diameter , angle ) ; Console . WriteLine ( arc_len ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkCollision ( int a , int b , int c , int x , int y , int radius ) { double dist = ( Math . Abs ( a * x + b * y + c ) ) / Math . Sqrt ( a * a + b * b ) ; if ( radius == dist ) Console . WriteLine ( " Touch " ) ; else if ( radius > dist ) Console . WriteLine ( " Intersect " ) ; else Console . WriteLine ( " Outside " ) ; } public static void Main ( ) { int radius = 5 ; int x = 0 , y = 0 ; int a = 3 , b = 4 , c = 25 ; checkCollision ( a , b , c , x , y , radius ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double polygonArea ( double [ ] X , double [ ] Y , int n ) { double area = 0.0 ; int j = n - 1 ; for ( int i = 0 ; i < n ; i ++ ) { area += ( X [ j ] + X [ i ] ) * ( Y [ j ] - Y [ i ] ) ; j = i ; } return Math . Abs ( area / 2.0 ) ; } public static void Main ( ) { double [ ] X = { 0 , 2 , 4 } ; double [ ] Y = { 1 , 3 , 7 } ; int n = X . Length ; Console . WriteLine ( polygonArea ( X , Y , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: area, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static int chk ( int n ) { List < int > v = new List < int > ( ) ; while ( n != 0 ) { v . Add ( n % 2 ) ; n = n / 2 ; } int j = 0 ; foreach ( int i in v ) { if ( i == 1 ) { return ( int ) Math . Pow ( 2.0 , ( double ) j ) ; } j ++ ; } return 0 ; } static void sumOfLSB ( int [ ] arr , int N ) { int [ ] lsb_arr = new int [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { lsb_arr [ i ] = chk ( arr [ i ] ) ; } Array . Sort ( lsb_arr ) ; int ans = 0 ; for ( int i = 0 ; i < N - 1 ; i += 2 ) { ans += ( lsb_arr [ i + 1 ] ) ; } Console . WriteLine ( ans ) ; } static public void Main ( ) { int N = 5 ; int [ ] arr = { 1 , 2 , 3 , 4 , 5 } ; sumOfLSB ( arr , N ) ; } }

Index/key variables: N, i
Accumulator variables: ans, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countSubsequences ( int [ ] arr , int N ) { int odd = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( arr [ i ] & 1 ) % 2 == 1 ) odd ++ ; } return ( 1 << odd ) - 1 ; } public static void Main ( string [ ] args ) { int N = 3 ; int [ ] arr = { 1 , 3 , 3 } ; Console . WriteLine ( countSubsequences ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, odd
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getPairsCount ( int [ ] arr , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = arr [ i ] - ( i % arr [ i ] ) ; j < n ; j += arr [ i ] ) { if ( i < j && Math . Abs ( arr [ i ] - arr [ j ] ) >= Math . Min ( arr [ i ] , arr [ j ] ) ) { count ++ ; } } } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 2 , 3 } ; int N = arr . Length ; Console . Write ( getPairsCount ( arr , N ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void check ( int N ) { int twos = 0 , fives = 0 ; while ( N % 2 == 0 ) { N /= 2 ; twos ++ ; } while ( N % 5 == 0 ) { N /= 5 ; fives ++ ; } if ( N == 1 && twos <= fives ) { Console . Write ( 2 * fives - twos ) ; } else { Console . Write ( - 1 ) ; } } public static void Main ( ) { int N = 50 ; check ( N ) ; } }

Accumulator variables: N, fives, twos
Class/struct names: GFG
C# program:
using System ; class GFG { static void rangeSum ( int [ ] arr , int N , int L , int R ) { int sum = 0 ; for ( int i = L - 1 ; i < R ; i ++ ) { sum += arr [ i % N ] ; } Console . Write ( sum ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 5 , 2 , 6 , 9 } ; int L = 10 , R = 13 ; int N = arr . Length ; rangeSum ( arr , N , L , R ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void rangeSum ( int [ ] arr , int N , int L , int R ) { int [ ] prefix = new int [ N + 1 ] ; prefix [ 0 ] = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { prefix [ i ] = prefix [ i - 1 ] + arr [ i - 1 ] ; } int leftsum = ( ( L - 1 ) / N ) * prefix [ N ] + prefix [ ( L - 1 ) % N ] ; int rightsum = ( R / N ) * prefix [ N ] + prefix [ R % N ] ; Console . Write ( rightsum - leftsum ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 2 , 6 , 9 } ; int L = 10 , R = 13 ; int N = arr . Length ; rangeSum ( arr , N , L , R ) ; } }

Index/key variables: N, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int ExpoFactorial ( int N ) { int res = 1 ; int mod = 1000000007 ; for ( int i = 2 ; i < N + 1 ; i ++ ) res = ( int ) Math . Pow ( i , res ) % mod ; return res ; } public static void Main ( ) { int N = 4 ; Console . Write ( ExpoFactorial ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maxSubArraySumRepeated ( int [ ] arr , int N , int K ) { int sum = 0 ; for ( int i = 0 ; i < N ; i ++ ) sum += arr [ i ] ; int curr = arr [ 0 ] ; int ans = arr [ 0 ] ; if ( K == 1 ) { for ( int i = 1 ; i < N ; i ++ ) { curr = Math . Max ( arr [ i ] , curr + arr [ i ] ) ; ans = Math . Max ( ans , curr ) ; } return ans ; } List < int > V = new List < int > ( ) ; for ( int i = 0 ; i < 2 * N ; i ++ ) { V . Add ( arr [ i % N ] ) ; } int maxSuf = V [ 0 ] ; int maxPref = V [ 2 * N - 1 ] ; curr = V [ 0 ] ; for ( int i = 1 ; i < 2 * N ; i ++ ) { curr += V [ i ] ; maxPref = Math . Max ( maxPref , curr ) ; } curr = V [ 2 * N - 1 ] ; for ( int i = 2 * N - 2 ; i >= 0 ; i -- ) { curr += V [ i ] ; maxSuf = Math . Max ( maxSuf , curr ) ; } curr = V [ 0 ] ; for ( int i = 1 ; i < 2 * N ; i ++ ) { curr = Math . Max ( V [ i ] , curr + V [ i ] ) ; ans = Math . Max ( ans , curr ) ; } if ( sum > 0 ) { int temp = sum * ( K - 2 ) ; ans = Math . Max ( ans , Math . Max ( temp + maxPref , temp + maxSuf ) ) ; } return ans ; } public static void Main ( ) { int [ ] arr = { 10 , 20 , - 30 , - 1 , 40 } ; int N = arr . Length ; int K = 10 ; Console . WriteLine ( maxSubArraySumRepeated ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: curr, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void countSubarray ( int [ ] arr , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { int mxSubarray = 0 ; int mxOther = 0 ; for ( int k = i ; k <= j ; k ++ ) { mxSubarray = Math . Max ( mxSubarray , arr [ k ] ) ; } for ( int k = 0 ; k < i ; k ++ ) { mxOther = Math . Max ( mxOther , arr [ k ] ) ; } for ( int k = j + 1 ; k < n ; k ++ ) { mxOther = Math . Max ( mxOther , arr [ k ] ) ; } if ( mxSubarray > ( 2 * mxOther ) ) count ++ ; } } Console . Write ( count ) ; } public static void Main ( ) { int [ ] arr = { 1 , 6 , 10 , 9 , 7 , 3 } ; int N = arr . Length ; countSubarray ( arr , N ) ; } }

Index/key variables: k
Accumulator variables: count, i, j, k
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { static void countSubarray ( int [ ] arr , int n ) { int L = 0 , R = 0 ; int mx = Int32 . MinValue ; for ( int i = 0 ; i < n ; i ++ ) mx = Math . Max ( mx , arr [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] * 2 > mx ) { L = i ; break ; } } for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( arr [ i ] * 2 > mx ) { R = i ; break ; } } Console . WriteLine ( ( L + 1 ) * ( n - R ) ) ; } public static void Main ( ) { int [ ] arr = { 1 , 6 , 10 , 9 , 7 , 3 } ; int N = arr . Length ; countSubarray ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPrime ( int X ) { for ( int i = 2 ; i * i <= X ; i ++ ) if ( X % i == 0 ) return false ; return true ; } static void printPrimes ( int [ ] A , int N ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = A [ i ] - 1 ; ; j -- ) { if ( isPrime ( j ) ) { Console . Write ( j + " ▁ " ) ; break ; } } for ( int j = A [ i ] + 1 ; ; j ++ ) { if ( isPrime ( j ) ) { Console . Write ( j + " ▁ " ) ; break ; } } Console . WriteLine ( ) ; } } public static void Main ( ) { int [ ] A = { 17 , 28 } ; int N = A . Length ; printPrimes ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int KthSmallest ( int [ ] A , int [ ] B , int N , int K ) { int M = 0 ; for ( int i = 0 ; i < N ; i ++ ) { M = Math . Max ( A [ i ] , M ) ; } int [ ] freq = new int [ M + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { freq [ A [ i ] ] += B [ i ] ; } int sum = 0 ; for ( int i = 0 ; i <= M ; i ++ ) { sum += freq [ i ] ; if ( sum >= K ) { return i ; } } return - 1 ; } public static void Main ( String [ ] args ) { int [ ] A = { 3 , 4 , 5 } ; int [ ] B = { 2 , 1 , 3 } ; int N = A . Length ; int K = 4 ; Console . Write ( KthSmallest ( A , B , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findbitwiseOR ( int [ ] a , int n ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int curr_sub_array = a [ i ] ; res = res | curr_sub_array ; for ( int j = i ; j < n ; j ++ ) { curr_sub_array = curr_sub_array & a [ j ] ; res = res | curr_sub_array ; } } Console . Write ( res ) ; } static void Main ( ) { int [ ] A = { 1 , 2 , 3 } ; int N = A . Length ; findbitwiseOR ( A , 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 findbitwiseOR ( int [ ] a , int n ) { int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) res = res | a [ i ] ; Console . Write ( res ) ; } public static void Main ( ) { int [ ] A = { 1 , 2 , 3 } ; int N = A . Length ; findbitwiseOR ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void check ( int n ) { int sumOfDigit = 0 ; int prodOfDigit = 1 ; while ( n > 0 ) { int rem ; rem = n % 10 ; sumOfDigit += rem ; prodOfDigit *= rem ; n /= 10 ; } if ( sumOfDigit > prodOfDigit ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } public static void Main ( ) { int N = 1234 ; check ( N ) ; } }

Accumulator variables: n, prodOfDigit, sumOfDigit
Class/struct names: GFG
C# program:
using System ; class GFG { static void evenOddBitwiseXOR ( int N ) { Console . Write ( " Even : ▁ " + 0 + " ▁ " ) ; for ( int i = 4 ; i <= N ; i = i + 4 ) { Console . Write ( i + " ▁ " ) ; } Console . Write ( " STRNEWLINE " ) ; Console . Write ( " Odd : ▁ " + 1 + " ▁ " ) ; for ( int i = 4 ; i <= N ; i = i + 4 ) { Console . Write ( i - 1 + " ▁ " ) ; } if ( N % 4 == 2 ) Console . Write ( N + 1 ) ; else if ( N % 4 == 3 ) Console . Write ( N ) ; } public static void Main ( ) { int N = 6 ; evenOddBitwiseXOR ( N ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findPermutation ( int [ ] arr ) { int N = arr . Length ; int i = N - 2 ; while ( i >= 0 && arr [ i ] <= arr [ i + 1 ] ) i -- ; if ( i == - 1 ) { Console . Write ( " - 1" ) ; return ; } int j = N - 1 ; while ( j > i && arr [ j ] >= arr [ i ] ) j -- ; while ( j > i && arr [ j ] == arr [ j - 1 ] ) { j -- ; } int temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; foreach ( int it in arr ) { Console . Write ( it + " ▁ " ) ; } } public static void Main ( ) { int [ ] arr = { 1 , 2 , 5 , 3 , 4 , 6 } ; findPermutation ( arr ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: it
Class/struct names: GFG
C# program:
using System ; class GFG { static void sieveOfEratosthenes ( int N , int [ ] s ) { bool [ ] prime = new bool [ N + 1 ] ; for ( int i = 2 ; i <= N ; i += 2 ) s [ i ] = 2 ; for ( int i = 3 ; i <= N ; i += 2 ) { if ( prime [ i ] == false ) { s [ i ] = i ; for ( int j = i ; j * i <= N ; j += 2 ) { if ( ! prime [ i * j ] ) { prime [ i * j ] = true ; s [ i * j ] = i ; } } } } } static void findDifference ( int N ) { int [ ] s = new int [ N + 1 ] ; sieveOfEratosthenes ( N , s ) ; int total = 1 , odd = 1 , even = 0 ; int curr = s [ N ] ; int cnt = 1 ; while ( N > 1 ) { N /= s [ N ] ; if ( curr == s [ N ] ) { cnt ++ ; continue ; } if ( curr == 2 ) { total = total * ( cnt + 1 ) ; } else { total = total * ( cnt + 1 ) ; odd = odd * ( cnt + 1 ) ; } curr = s [ N ] ; cnt = 1 ; } even = total - odd ; Console . Write ( Math . Abs ( even - odd ) ) ; } public static void Main ( ) { int N = 12 ; findDifference ( N ) ; } }

Index/key variables: N, i
Accumulator variables: N, cnt, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMedian ( int Mean , int Mode ) { double Median = ( 2 * Mean + Mode ) / 3.0 ; Console . Write ( Median ) ; } public static void Main ( ) { int mode = 6 , mean = 3 ; findMedian ( mean , mode ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { private static double vectorMagnitude ( int x , int y , int z ) { int sum = x * x + y * y + z * z ; return Math . Sqrt ( sum ) ; } static void Main ( ) { int x = 1 ; int y = 2 ; int z = 3 ; Console . Write ( vectorMagnitude ( x , y , z ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int multiplyByMersenne ( int N , int M ) { int x = ( int ) ( Math . Log ( M + 1 ) / Math . Log ( 2 ) ) ; return ( ( N << x ) - N ) ; } static public void Main ( ) { int N = 4 ; int M = 15 ; Console . Write ( multiplyByMersenne ( N , M ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; using System . Linq ; class GFG { static int perfectSquare ( int num ) { int sr = ( int ) ( Math . Sqrt ( num ) ) ; int a = sr * sr ; int b = ( sr + 1 ) * ( sr + 1 ) ; if ( ( num - a ) < ( b - num ) ) { return a ; } else { return b ; } } static int powerOfTwo ( int num ) { int lg = ( int ) ( Math . Log ( num ) / Math . Log ( 2 ) ) ; int p = ( int ) ( Math . Pow ( 2 , lg ) ) ; return p ; } static void uniqueElement ( int [ ] arr , int N ) { bool ans = true ; 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 [ arr [ i ] ] = 1 ; } } foreach ( var el in freq . OrderBy ( el => el . Key ) ) { if ( el . Value == 1 ) { ans = false ; int ps = perfectSquare ( el . Key ) ; Console . Write ( powerOfTwo ( ps ) + " ▁ " ) ; } } if ( ans ) Console . Write ( " - 1" ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 4 , 11 , 4 , 3 , 4 } ; int N = arr . Length ; uniqueElement ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: el, i
Boolean variables: ans
Class/struct names: GFG
C# program:
using System ; class GFG { static void partitionArray ( int [ ] a , int n ) { int [ ] min = new int [ n ] ; int mini = Int32 . MaxValue ; for ( int i = n - 1 ; i >= 0 ; i -- ) { mini = Math . Min ( mini , a [ i ] ) ; min [ i ] = mini ; } int maxi = Int32 . MinValue ; int ind = - 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { maxi = Math . Max ( maxi , a [ i ] ) ; if ( maxi < min [ i + 1 ] ) { ind = i ; break ; } } if ( ind != - 1 ) { for ( int i = 0 ; i <= ind ; i ++ ) Console . Write ( a [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; for ( int i = ind + 1 ; i < n ; i ++ ) Console . Write ( a [ i ] + " ▁ " ) ; } else Console . Write ( " Impossible " ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 5 , 3 , 2 , 7 , 9 } ; int N = arr . Length ; partitionArray ( arr , N ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countPrimeFactors ( int n ) { int count = 0 ; while ( n % 2 == 0 ) { n = n / 2 ; count ++ ; } for ( int i = 3 ; i <= ( int ) Math . Sqrt ( n ) ; i = i + 2 ) { while ( n % i == 0 ) { n = n / i ; count ++ ; } } if ( n > 2 ) count ++ ; return ( count ) ; } static int findSum ( int n ) { int sum = 0 ; for ( int i = 1 , num = 2 ; i <= n ; num ++ ) { if ( countPrimeFactors ( num ) == 2 ) { sum += num ; i ++ ; } } return sum ; } static void check ( int n , int k ) { int s = findSum ( k - 1 ) ; if ( s >= n ) Console . WriteLine ( " No " ) ; else Console . WriteLine ( " Yes " ) ; } public static void Main ( String [ ] args ) { int n = 100 , k = 6 ; check ( n , k ) ; } }

Accumulator variables: count, i, num, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int gcd ( int a , int b ) { while ( b > 0 ) { int rem = a % b ; a = b ; b = rem ; } return a ; } static int countNumberOfWays ( int n ) { if ( n == 1 ) return - 1 ; int g = 0 ; int power = 0 ; while ( n % 2 == 0 ) { power ++ ; n /= 2 ; } g = gcd ( g , power ) ; for ( int i = 3 ; i <= ( int ) Math . Sqrt ( n ) ; i += 2 ) { power = 0 ; while ( n % i == 0 ) { power ++ ; n /= i ; } g = gcd ( g , power ) ; } if ( n > 2 ) g = gcd ( g , 1 ) ; int ways = 1 ; power = 0 ; while ( g % 2 == 0 ) { g /= 2 ; power ++ ; } ways *= ( power + 1 ) ; for ( int i = 3 ; i <= ( int ) Math . Sqrt ( g ) ; i += 2 ) { power = 0 ; while ( g % i == 0 ) { power ++ ; g /= i ; } ways *= ( power + 1 ) ; } if ( g > 2 ) ways *= 2 ; return ways ; } public static void Main ( String [ ] args ) { int N = 64 ; Console . Write ( countNumberOfWays ( N ) ) ; } }

Accumulator variables: g, i, n, power, ways
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int powOfPositive ( int n ) { int pos = ( int ) Math . Floor ( ( Math . Log ( n ) / Math . Log ( 2 ) ) ) ; return ( int ) Math . Pow ( 2 , pos ) ; } static int powOfNegative ( int n ) { int pos = ( int ) Math . Ceiling ( ( Math . Log ( n ) / Math . Log ( 2 ) ) ) ; return ( int ) ( - 1 * Math . Pow ( 2 , pos ) ) ; } static void highestPowerOf2 ( int n ) { if ( n > 0 ) { Console . WriteLine ( powOfPositive ( n ) ) ; } else { n = - n ; Console . WriteLine ( powOfNegative ( n ) ) ; } } public static void Main ( ) { int n = - 24 ; highestPowerOf2 ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int noOfCards ( int n ) { return n * ( 3 * n + 1 ) / 2 ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . Write ( noOfCards ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static String smallestPoss ( String s , int n ) { String ans = " " ; int [ ] arr = new int [ 10 ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ s [ i ] - 48 ] ++ ; } for ( int i = 0 ; i < 10 ; i ++ ) { for ( int j = 0 ; j < arr [ i ] ; j ++ ) ans = ans + String . Join ( " " , i ) ; } return ans ; } public static void Main ( String [ ] args ) { int N = 15 ; String K = "325343273113434" ; Console . Write ( smallestPoss ( K , N ) ) ; } }

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