dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static bool isPalindrome ( string str ) { int i = 0 , j = str . Length - 1 ; while ( i < j ) { if ( str [ i ++ ] != str [ j -- ] ) return false ; } return true ; } static String removePalinWords ( string str ) { string final_str = " " , word = " " ; str = str + " ▁ " ; int n = str . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( str [ i ] != ' ▁ ' ) word = word + str [ i ] ; else { if ( ! ( isPalindrome ( word ) ) ) final_str += word + " ▁ " ; word = " " ; } } return final_str ; } public static void Main ( ) { string str = " Text ▁ contains ▁ malayalam ▁ " + " and ▁ level ▁ words " ; Console . WriteLine ( removePalinWords ( str ) ) ; } }

Index/key variables: i
Accumulator variables: final_str, i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findSubSequence ( string s , int num ) { int res = 0 ; int i = 0 ; while ( num > 0 ) { if ( ( num & 1 ) == 1 ) res += s [ i ] - '0' ; i ++ ; num = num >> 1 ; } return res ; } static int combinedSum ( string s ) { int n = s . Length ; int c_sum = 0 ; int range = ( 1 << n ) - 1 ; for ( int i = 0 ; i <= range ; i ++ ) c_sum += findSubSequence ( s , i ) ; return c_sum ; } public static void Main ( ) { string s = "123" ; Console . Write ( combinedSum ( s ) ) ; } }

Index/key variables: i
Accumulator variables: c_sum, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX_CHAR = 26 ; static void findSubsequence ( string str , int k ) { int [ ] a = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < str . Length ; i ++ ) a [ str [ i ] - ' a ' ] ++ ; for ( int i = 0 ; i < str . Length ; i ++ ) if ( a [ str [ i ] - ' a ' ] >= k ) Console . Write ( str [ i ] ) ; } public static void Main ( ) { int k = 2 ; findSubsequence ( " geeksforgeeks " , k ) ; } }

Index/key variables: MAX_CHAR, i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static string convert ( string str ) { string w = " " , z = " " ; str = str . ToUpper ( ) + " ▁ " ; for ( int i = 0 ; i < str . Length ; i ++ ) { char ch = str [ i ] ; if ( ch != ' ▁ ' ) w = w + ch ; else { z = z + ( Char . ToLower ( w [ 0 ] ) ) + w . Substring ( 1 ) + " ▁ " ; w = " " ; } } return z ; } static void Main ( ) { string str = " I ▁ got ▁ intern ▁ at ▁ geeksforgeeks " ; Console . WriteLine ( convert ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isVowel ( char c ) { return ( c == ' a ' c == ' e ' c == ' i ' c == ' o ' c == ' u ' ) ; } static String encryptString ( char [ ] s , int n , int k ) { int [ ] cv = new int [ n ] ; int [ ] cc = new int [ n ] ; if ( isVowel ( s [ 0 ] ) ) cv [ 0 ] = 1 ; else cc [ 0 ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { cv [ i ] = cv [ i - 1 ] + ( isVowel ( s [ i ] ) == true ? 1 : 0 ) ; cc [ i ] = cc [ i - 1 ] + ( isVowel ( s [ i ] ) == true ? 0 : 1 ) ; } String ans = " " ; int prod = 0 ; prod = cc [ k - 1 ] * cv [ k - 1 ] ; ans += String . Join ( " " , prod ) ; for ( int i = k ; i < s . Length ; i ++ ) { prod = ( cc [ i ] - cc [ i - k ] ) * ( cv [ i ] - cv [ i - k ] ) ; ans += String . Join ( " " , prod ) ; } return ans ; } public static void Main ( String [ ] args ) { String s = " hello " ; int n = s . Length ; int k = 2 ; Console . Write ( encryptString ( s . ToCharArray ( ) , n , k ) + " STRNEWLINE " ) ; } }

Index/key variables: i, n
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countOccurrences ( string str , string word ) { string [ ] a = str . Split ( ' ▁ ' ) ; int count = 0 ; for ( int i = 0 ; i < a . Length ; i ++ ) { if ( word . Equals ( a [ i ] ) ) count ++ ; } return count ; } public static void Main ( ) { string str = " GeeksforGeeks ▁ A ▁ computer ▁ science ▁ portal ▁ for ▁ geeks ▁ " ; string word = " portal " ; Console . Write ( countOccurrences ( str , word ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class PermuteString { static void permute ( String input ) { int n = input . Length ; int max = 1 << n ; input = input . ToLower ( ) ; for ( int i = 0 ; i < max ; i ++ ) { char [ ] combination = input . ToCharArray ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( ( ( i >> j ) & 1 ) == 1 ) combination [ j ] = ( char ) ( combination [ j ] - 32 ) ; } Console . Write ( combination ) ; Console . Write ( " ▁ " ) ; } } public static void Main ( ) { permute ( " ABC " ) ; } }

Index/key variables: j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: PermuteString
C# program:
using System ; public class GFG { static public void printString ( string str , char ch , int count ) { int occ = 0 , i ; if ( count == 0 ) { Console . WriteLine ( str ) ; return ; } for ( i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] == ch ) occ ++ ; if ( occ == count ) break ; } if ( i < str . Length - 1 ) Console . WriteLine ( str . Substring ( i + 1 ) ) ; else Console . WriteLine ( " Empty ▁ string " ) ; } static public void Main ( ) { string str = " geeks ▁ for ▁ geeks " ; printString ( str , ' e ' , 2 ) ; } }

Index/key variables: i
Accumulator variables: i, occ
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static Boolean isVowel ( char c ) { return ( c == ' a ' c == ' A ' c == ' e ' c == ' E ' c == ' i ' c == ' I ' c == ' o ' c == ' O ' c == ' u ' c == ' U ' ) ; } static String reverseVowel ( String str ) { int i = 0 ; int j = str . Length - 1 ; char [ ] str1 = str . ToCharArray ( ) ; while ( i < j ) { if ( ! isVowel ( str1 [ i ] ) ) { i ++ ; continue ; } if ( ! isVowel ( str1 [ j ] ) ) { j -- ; continue ; } char t = str1 [ i ] ; str1 [ i ] = str1 [ j ] ; str1 [ j ] = t ; i ++ ; j -- ; } String str2 = String . Join ( " " , str1 ) ; return str2 ; } public static void Main ( String [ ] args ) { String str = " hello ▁ world " ; Console . WriteLine ( reverseVowel ( str ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPalindrome ( String str ) { int l = 0 ; int h = str . Length - 1 ; while ( h > l ) if ( str [ l ++ ] != str [ h -- ] ) return false ; return true ; } static int minRemovals ( String str ) { if ( str [ 0 ] == ' ' ) return 0 ; if ( isPalindrome ( str ) ) return 1 ; return 2 ; } public static void Main ( ) { Console . WriteLine ( minRemovals ( "010010" ) ) ; Console . WriteLine ( minRemovals ( "0100101" ) ) ; } }

Accumulator variables: h, l
Class/struct names: GFG
C# program:
using System ; class GFG { static int power ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } static int findModuloByM ( int X , int N , int M ) { if ( N < 6 ) { string temp = " " ; for ( int i = 0 ; i < N ; i ++ ) temp = temp + ( char ) ( X + 48 ) ; int res = Convert . ToInt32 ( temp ) % M ; return res ; } if ( N % 2 == 0 ) { int half = findModuloByM ( X , N / 2 , M ) % M ; int res = ( half * power ( 10 , N / 2 , M ) + half ) % M ; return res ; } else { int half = findModuloByM ( X , N / 2 , M ) % M ; int res = ( half * power ( 10 , N / 2 + 1 , M ) + half * 10 + X ) % M ; return res ; } } public static void Main ( ) { int X = 6 , N = 14 , M = 9 ; Console . WriteLine ( findModuloByM ( X , N , M ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { class circle { public double x ; public double y ; public double r ; public circle ( int x , int y , int r ) { this . x = x ; this . y = y ; this . r = r ; } } static bool check ( circle [ ] C ) { double C1C2 = Math . Sqrt ( ( C [ 1 ] . x - C [ 0 ] . x ) * ( C [ 1 ] . x - C [ 0 ] . x ) + ( C [ 1 ] . y - C [ 0 ] . y ) * ( C [ 1 ] . y - C [ 0 ] . y ) ) ; bool flag = false ; if ( C1C2 < ( C [ 0 ] . r + C [ 1 ] . r ) ) { if ( ( C [ 0 ] . x + C [ 1 ] . x ) == 2 * C [ 2 ] . x && ( C [ 0 ] . y + C [ 1 ] . y ) == 2 * C [ 2 ] . y ) { flag = true ; } } return flag ; } static bool IsFairTriplet ( circle [ ] c ) { bool f = false ; f |= check ( c ) ; for ( int i = 0 ; i < 2 ; i ++ ) { swap ( c [ 0 ] , c [ 2 ] ) ; f |= check ( c ) ; } return f ; } static void swap ( circle circle1 , circle circle2 ) { circle temp = circle1 ; circle1 = circle2 ; circle2 = temp ; } public static void Main ( String [ ] args ) { circle [ ] C = new circle [ 3 ] ; C [ 0 ] = new circle ( 0 , 0 , 8 ) ; C [ 1 ] = new circle ( 0 , 10 , 6 ) ; C [ 2 ] = new circle ( 0 , 5 , 5 ) ; if ( IsFairTriplet ( C ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: f, i
Iterator variables: i
Boolean variables: f, flag
Class/struct names: GFG, circle
C# program:
using System ; class GFG { static double eccHyperbola ( double A , double B ) { double r = ( double ) B * B / A * A ; r += 1 ; return Math . Sqrt ( r ) ; } public static void Main ( String [ ] args ) { double A = 3.0 , B = 2.0 ; Console . Write ( eccHyperbola ( A , B ) ) ; } }

Accumulator variables: r
Class/struct names: GFG
C# program:
using System ; class GFG { static float calculateArea ( float A , float B , float C , float D ) { float S = ( A + B + C + D ) / 2 ; float area = ( float ) Math . Sqrt ( ( S - A ) * ( S - B ) * ( S - C ) * ( S - D ) ) ; return area ; } static public void Main ( ) { float A = 10 ; float B = 15 ; float C = 20 ; float D = 25 ; Console . Write ( calculateArea ( A , B , C , D ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void triangleArea ( int a , int b ) { double ratio = ( double ) b / a ; Console . WriteLine ( ratio ) ; } public static void Main ( ) { int a = 1 , b = 2 ; triangleArea ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { class pair { public float first , second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } } static float distance ( int m , int n , int p , int q ) { return ( float ) Math . Sqrt ( Math . Pow ( n - m , 2 ) + Math . Pow ( q - p , 2 ) * 1.0 ) ; } static void Excenters ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 ) { float a = distance ( x2 , x3 , y2 , y3 ) ; float b = distance ( x3 , x1 , y3 , y1 ) ; float c = distance ( x1 , x2 , y1 , y2 ) ; pair [ ] excenter = new pair [ 4 ] ; excenter [ 1 ] = new pair ( ( - ( a * x1 ) + ( b * x2 ) + ( c * x3 ) ) / ( - a + b + c ) , ( - ( a * y1 ) + ( b * y2 ) + ( c * y3 ) ) / ( - a + b + c ) ) ; excenter [ 2 ] = new pair ( ( ( a * x1 ) - ( b * x2 ) + ( c * x3 ) ) / ( a - b + c ) , ( ( a * y1 ) - ( b * y2 ) + ( c * y3 ) ) / ( a - b + c ) ) ; excenter [ 3 ] = new pair ( ( ( a * x1 ) + ( b * x2 ) - ( c * x3 ) ) / ( a + b - c ) , ( ( a * y1 ) + ( b * y2 ) - ( c * y3 ) ) / ( a + b - c ) ) ; for ( int i = 1 ; i <= 3 ; i ++ ) { Console . WriteLine ( ( int ) excenter [ i ] . first + " ▁ " + ( int ) excenter [ i ] . second ) ; } } static void Main ( ) { int x1 , x2 , x3 , y1 , y2 , y3 ; x1 = 0 ; x2 = 3 ; x3 = 0 ; y1 = 0 ; y2 = 0 ; y3 = 4 ; Excenters ( x1 , y1 , x2 , y2 , x3 , y3 ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
C# program:
using System ; public class GFG { static void findHeight ( float p1 , float p2 , float b , float c ) { float a = Math . Max ( p1 , p2 ) - Math . Min ( p1 , p2 ) ; float s = ( a + b + c ) / 2 ; float area = ( int ) Math . Sqrt ( s * ( s - a ) * ( s - b ) * ( s - c ) ) ; float height = ( area * 2 ) / a ; Console . Write ( " Height ▁ is : ▁ " + height ) ; } public static void Main ( String [ ] args ) { float p1 = 25 , p2 = 10 ; float a = 14 , b = 13 ; findHeight ( p1 , p2 , a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int Icositetragonal_num ( int n ) { return ( 22 * n * n - 20 * n ) / 2 ; } public static void Main ( string [ ] args ) { int n = 3 ; Console . Write ( Icositetragonal_num ( n ) + " STRNEWLINE " ) ; n = 10 ; Console . Write ( Icositetragonal_num ( n ) + " STRNEWLINE " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double area_of_circle ( int m , int n ) { int square_of_radius = ( m * n ) / 4 ; double area = ( 3.141 * square_of_radius ) ; return area ; } public static void Main ( ) { int n = 10 ; int m = 30 ; Console . WriteLine ( area_of_circle ( m , n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double area ( int R ) { double Base = 1.732 * R ; double height = ( 1.5 ) * R ; double area = 0.5 * Base * height ; return area ; } public static void Main ( String [ ] args ) { int R = 7 ; Console . WriteLine ( area ( R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static float circlearea ( float R ) { if ( R < 0 ) return - 1 ; float a = ( float ) ( ( 3.14 * R * R ) / 4 ) ; return a ; } public static void Main ( string [ ] args ) { float R = 2 ; Console . WriteLine ( circlearea ( R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int countPairs ( int [ ] P , int [ ] Q , int N , int M ) { int [ ] A = new int [ 2 ] ; int [ ] B = new int [ 2 ] ; for ( int i = 0 ; i < N ; i ++ ) A [ P [ i ] % 2 ] ++ ; for ( int i = 0 ; i < M ; i ++ ) B [ Q [ i ] % 2 ] ++ ; return ( A [ 0 ] * B [ 0 ] + A [ 1 ] * B [ 1 ] ) ; } public static void Main ( ) { int [ ] P = { 1 , 3 , 2 } ; int [ ] Q = { 3 , 0 } ; int N = P . Length ; int M = Q . Length ; Console . Write ( countPairs ( P , Q , N , M ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countIntersections ( int n ) { return n * ( n - 1 ) / 2 ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . WriteLine ( countIntersections ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double PI = 3.14159 ; static double areaOfTriangle ( float d ) { float c = ( float ) ( 1.618 * d ) ; float s = ( d + c + c ) / 2 ; double area = Math . Sqrt ( s * ( s - c ) * ( s - c ) * ( s - d ) ) ; return 5 * area ; } static double areaOfRegPentagon ( float d ) { double cal = 4 * Math . Tan ( PI / 5 ) ; double area = ( 5 * d * d ) / cal ; return area ; } static double areaOfPentagram ( float d ) { return areaOfRegPentagon ( d ) + areaOfTriangle ( d ) ; } public static void Main ( ) { float d = 5 ; Console . WriteLine ( areaOfPentagram ( d ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void anglequichord ( int z ) { Console . WriteLine ( " The ▁ angle ▁ is ▁ " + z + " ▁ degrees " ) ; } public static void Main ( ) { int z = 48 ; anglequichord ( z ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static void convertToASCII ( int N ) { String num = N . ToString ( ) ; foreach ( char ch in num . ToCharArray ( ) ) { Console . Write ( ch + " ▁ ( " + ( int ) ch + " ) STRNEWLINE " ) ; } } public static void Main ( String [ ] args ) { int N = 36 ; convertToASCII ( N ) ; } }

Iterator variables: ch
Class/struct names: GFG
C# program:
using System ; class GFG { static void productExceptSelf ( int [ ] arr , int N ) { int product = 1 ; int z = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] != 0 ) product *= arr [ i ] ; if ( arr [ i ] == 0 ) z += 1 ; } int a = Math . Abs ( product ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( z == 1 ) { if ( arr [ i ] != 0 ) arr [ i ] = 0 ; else arr [ i ] = product ; continue ; } else if ( z > 1 ) { arr [ i ] = 0 ; continue ; } int b = Math . Abs ( arr [ i ] ) ; int curr = ( int ) Math . Round ( Math . Exp ( Math . Log ( a ) - Math . Log ( b ) ) ) ; if ( arr [ i ] < 0 && product < 0 ) arr [ i ] = curr ; else if ( arr [ i ] > 0 && product > 0 ) arr [ i ] = curr ; else arr [ i ] = - 1 * curr ; } for ( int i = 0 ; i < N ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 10 , 3 , 5 , 6 , 2 } ; int N = arr . Length ; productExceptSelf ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, product, z
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void singleDigitSubarrayCount ( int [ ] arr , int N ) { int res = 0 ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] <= 9 ) { count ++ ; res += count ; } else { count = 0 ; } } Console . Write ( res ) ; } public static void Main ( string [ ] args ) { int [ ] arr = { 0 , 1 , 14 , 2 , 5 } ; int N = arr . Length ; singleDigitSubarrayCount ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: count, i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int isPossible ( int N ) { return ( ( ( N & ( N - 1 ) ) & N ) ) ; } static void countElements ( int N ) { int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( isPossible ( i ) != 0 ) count ++ ; } Console . Write ( count ) ; } static public void Main ( ) { int N = 15 ; countElements ( N ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void countElements ( int N ) { int Cur_Ele = 1 ; int Count = 0 ; while ( Cur_Ele <= N ) { Count ++ ; Cur_Ele = Cur_Ele * 2 ; } Console . Write ( N - Count ) ; } public static void Main ( String [ ] args ) { int N = 15 ; countElements ( N ) ; } }

Accumulator variables: Count
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void maxAdjacent ( int [ ] arr , int N ) { List < int > res = new List < int > ( ) ; int arr_max = Int32 . MinValue ; for ( int i = 1 ; i < N ; i ++ ) { arr_max = Math . Max ( arr_max , Math . Abs ( arr [ i - 1 ] - arr [ i ] ) ) ; } for ( int i = 1 ; i < N - 1 ; i ++ ) { int curr_max = Math . Abs ( arr [ i - 1 ] - arr [ i + 1 ] ) ; int ans = Math . Max ( curr_max , arr_max ) ; res . Add ( ans ) ; } foreach ( int x in res ) Console . Write ( x + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 3 , 4 , 7 , 8 } ; int N = arr . Length ; maxAdjacent ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int minimumIncrement ( int [ ] arr , int N ) { if ( N % 2 != 0 ) { Console . WriteLine ( " - 1" ) ; Environment . Exit ( 0 ) ; } int cntEven = 0 ; int cntOdd = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { cntEven += 1 ; } } cntOdd = N - cntEven ; return Math . Abs ( cntEven - cntOdd ) / 2 ; } public static void Main ( ) { int [ ] arr = { 1 , 3 , 4 , 9 } ; int N = arr . Length ; Console . WriteLine ( minimumIncrement ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: cntEven, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void cntWaysConsArray ( int [ ] A , int N ) { int total = 1 ; int oddArray = 1 ; for ( int i = 0 ; i < N ; i ++ ) { total = total * 3 ; if ( A [ i ] % 2 == 0 ) { oddArray *= 2 ; } } Console . WriteLine ( total - oddArray ) ; } public static void Main ( String [ ] args ) { int [ ] A = { 2 , 4 } ; int N = A . Length ; cntWaysConsArray ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i, oddArray
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void countNumberHavingKthBitSet ( int N , int K ) { int numbers_rightmost_setbit_K = 0 ; for ( int i = 1 ; i <= K ; i ++ ) { int numbers_rightmost_bit_i = ( N + 1 ) / 2 ; N -= numbers_rightmost_bit_i ; if ( i == K ) { numbers_rightmost_setbit_K = numbers_rightmost_bit_i ; } } Console . WriteLine ( numbers_rightmost_setbit_K ) ; } static public void Main ( String [ ] args ) { int N = 15 ; int K = 2 ; countNumberHavingKthBitSet ( N , K ) ; } }

Accumulator variables: N, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countSetBits ( int N ) { int count = 0 ; while ( N != 0 ) { N = N & ( N - 1 ) ; count ++ ; } return count ; } public static void Main ( ) { int N = 4 ; int bits = countSetBits ( N ) ; Console . WriteLine ( " Odd ▁ " + " : ▁ " + ( int ) ( Math . Pow ( 2 , bits ) ) ) ; Console . WriteLine ( " Even ▁ " + " : ▁ " + ( N + 1 - ( int ) ( Math . Pow ( 2 , bits ) ) ) ) ; } }

Accumulator variables: count
Class/struct names: GFG
C# program:
using System ; public class GFG { static void minMoves ( int [ ] arr , int N ) { int odd_element_cnt = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 2 != 0 ) { odd_element_cnt ++ ; } } int moves = ( odd_element_cnt ) / 2 ; if ( odd_element_cnt % 2 != 0 ) moves += 2 ; Console . Write ( moves ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 5 , 6 , 3 , 7 , 20 } ; int N = arr . Length ; minMoves ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, moves, odd_element_cnt
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void minimumSubsetDifference ( int N ) { int blockOfSize8 = N / 8 ; string str = " ABBABAAB " ; int subsetDifference = 0 ; string partition = " " ; while ( blockOfSize8 -- > 0 ) { partition += str ; } int [ ] A = new int [ N ] ; int [ ] B = new int [ N ] ; int x = 0 , y = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( partition [ i ] == ' A ' ) { A [ x ++ ] = ( ( i + 1 ) * ( i + 1 ) ) ; } else { B [ y ++ ] = ( ( i + 1 ) * ( i + 1 ) ) ; } } Console . WriteLine ( subsetDifference ) ; for ( int i = 0 ; i < x ; i ++ ) Console . Write ( A [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; for ( int i = 0 ; i < y ; i ++ ) Console . Write ( B [ i ] + " ▁ " ) ; } public static void Main ( string [ ] args ) { int N = 8 ; minimumSubsetDifference ( N ) ; } }

Index/key variables: N, i
Accumulator variables: blockOfSize8, i, partition, x, y
Iterator variables: i
Class/struct names: GFG
C# program:
using System . Collections . Generic ; using System ; using System . Linq ; class GFG { static void findTheGreatestX ( int P , int Q ) { Dictionary < int , int > divisers = new Dictionary < int , int > ( ) ; for ( int i = 2 ; i * i <= Q ; i ++ ) { while ( Q % i == 0 && Q > 1 ) { Q /= i ; if ( divisers . ContainsKey ( i ) ) divisers [ i ] ++ ; else divisers [ i ] = 1 ; } } if ( Q > 1 ) { if ( divisers . ContainsKey ( Q ) ) divisers [ Q ] ++ ; else divisers [ Q ] = 1 ; } int ans = 0 ; var val = divisers . Keys . ToList ( ) ; foreach ( var key in val ) { int frequency = divisers [ key ] ; int temp = P ; int cur = 0 ; while ( temp % key == 0 ) { temp /= key ; cur ++ ; } if ( cur < frequency ) { ans = P ; break ; } temp = P ; for ( int j = cur ; j >= frequency ; j -- ) { temp /= key ; } ans = Math . Max ( temp , ans ) ; } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { int P = 10 , Q = 4 ; findTheGreatestX ( P , Q ) ; } }

Index/key variables: Q, i, key
Accumulator variables: Q, cur, i, j, temp
Iterator variables: i, j, key
Class/struct names: GFG
C# program:
using System ; class GFG { static String checkRearrangements ( int [ , ] mat , int N , int M ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 1 ; j < M ; j ++ ) { if ( mat [ i , 0 ] != mat [ i , j ] ) { return " Yes " ; } } } return " No " ; } static String nonZeroXor ( int [ , ] mat , int N , int M ) { int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { res = res ^ mat [ i , 0 ] ; } if ( res != 0 ) return " Yes " ; else return checkRearrangements ( mat , N , M ) ; } public static void Main ( String [ ] args ) { int [ , ] mat = { { 1 , 1 , 2 } , { 2 , 2 , 2 } , { 3 , 3 , 3 } } ; int N = mat . GetLength ( 0 ) ; int M = mat . GetLength ( 1 ) ; Console . Write ( nonZeroXor ( mat , N , M ) ) ; } }

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