dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static void findPair ( int x ) { int lim = 120 ; for ( int i = - lim ; i <= lim ; i ++ ) { for ( int j = - lim ; j <= lim ; j ++ ) { if ( Math . Pow ( i , 5 ) - Math . Pow ( j , 5 ) == x ) { Console . Write ( i + " ▁ " + j + " STRNEWLINE " ) ; return ; } } } Console . Write ( " - 1" ) ; } public static void Main ( String [ ] args ) { int X = 33 ; findPair ( X ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int getCount ( int d , int n ) { int no = n / d ; int result = no ; for ( int p = 2 ; p * p <= no ; ++ p ) { if ( no % p == 0 ) { while ( no % p == 0 ) no /= p ; result -= result / p ; } } if ( no > 1 ) result -= result / no ; return result ; } static int sumOfGCDofPairs ( int n ) { int res = 0 ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { int d1 = i ; int d2 = n / i ; res += d1 * getCount ( d1 , n ) ; if ( d1 != d2 ) res += d2 * getCount ( d2 , n ) ; } } return res ; } public static void Main ( String [ ] args ) { int n = 12 ; Console . Write ( sumOfGCDofPairs ( n ) ) ; } }

Accumulator variables: i, no, res, result
Iterator variables: i, p
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool checkIsFibonacci ( int [ ] arr , int n ) { if ( n == 1 n == 2 ) return true ; Array . Sort ( arr ) ; for ( int i = 2 ; i < n ; i ++ ) { if ( ( arr [ i - 1 ] + arr [ i - 2 ] ) != arr [ i ] ) return false ; } return true ; } public static void Main ( string [ ] args ) { int [ ] arr = { 8 , 3 , 5 , 13 } ; int n = arr . Length ; if ( checkIsFibonacci ( arr , n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int lastDigit2PowerN ( int n ) { if ( n == 0 ) return 1 ; else if ( n % 4 == 1 ) return 2 ; else if ( n % 4 == 2 ) return 4 ; else if ( n % 4 == 3 ) return 8 ; else } public static void Main ( string [ ] args ) { for ( int n = 0 ; n < 20 ; n ++ ) { Console . Write ( lastDigit2PowerN ( n ) + " ▁ " ) ; } } }

Accumulator variables: n
Iterator variables: n
Class/struct names: GFG
C# program:
using System ; class GFG { static int nCr ( int n , int r ) { return fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ; } static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int sumSubsequences ( int [ ] arr , int n , int k ) { int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += arr [ i ] ; } int kLengthSubSequence ; kLengthSubSequence = nCr ( n , k ) ; int ans = sum * ( ( k * kLengthSubSequence ) / n ) ; return ans ; } static void Main ( ) { int [ ] arr = { 7 , 8 , 9 , 2 } ; int K = 2 ; int n = arr . Length ; Console . Write ( sumSubsequences ( arr , n , K ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int findSum ( int n , int k ) { int val = ( k / ( n - 1 ) ) * n ; int rem = k % ( n - 1 ) ; if ( rem == 0 ) { val = val - 1 ; } else { val = val + rem ; } int sum = ( val * ( val + 1 ) ) / 2 ; int x = k / ( n - 1 ) ; int sum_of_multiples = ( x * ( x + 1 ) * n ) / 2 ; sum -= sum_of_multiples ; return sum ; } public static void Main ( String [ ] args ) { int n = 7 , k = 13 ; Console . WriteLine ( findSum ( n , k ) ) ; } }

Accumulator variables: sum
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static List < int > getFactorization ( int x ) { int count = 0 ; List < int > v = new List < int > ( ) ; while ( x % 2 == 0 ) { count ++ ; x = x / 2 ; } if ( count != 0 ) v . Add ( count ) ; for ( int i = 3 ; i <= Math . Sqrt ( x ) ; i += 2 ) { count = 0 ; while ( x % i == 0 ) { count ++ ; x /= i ; } if ( count != 0 ) v . Add ( count ) ; } if ( x > 1 ) { v . Add ( 1 ) ; } return v ; } static int nonPrimeDivisors ( int N ) { List < int > v = getFactorization ( N ) ; int ret = 1 ; for ( int i = 0 ; i < v . Count ; i ++ ) ret = ret * ( v [ i ] + 1 ) ; ret = ret - v . Count ; return ret ; } public static void Main ( String [ ] args ) { int N = 8 ; Console . WriteLine ( nonPrimeDivisors ( N ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, x
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquare ( int x ) { int s = ( int ) Math . Sqrt ( x ) ; return ( s * s == x ) ; } static bool isFibonacci ( int n ) { return isPerfectSquare ( 5 * n * n + 4 ) || isPerfectSquare ( 5 * n * n - 4 ) ; } static bool checkDigits ( int n ) { while ( n != 0 ) { int dig = n % 10 ; if ( dig == 4 && dig == 6 && dig == 7 && dig == 9 ) return false ; n /= 10 ; } return true ; } static bool isFullfibonacci ( int n ) { return ( checkDigits ( n ) && isFibonacci ( n ) ) ; } public static void Main ( String [ ] args ) { int n = 13 ; if ( isFullfibonacci ( n ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: n
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { static bool isDivisible ( char [ ] s ) { while ( s . Length > 4 ) { int l = s . Length - 1 ; int x = ( s [ l ] - '0' ) * 37 ; s = reverse ( s ) ; char [ ] tmp = new char [ s . Length - 1 ] ; Array . Copy ( s , 1 , tmp , 0 , s . Length - 1 ) ; s = tmp ; int i = 0 , carry = 0 ; while ( x > 0 ) { int d = ( s [ i ] - '0' ) - ( x % 10 ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; x /= 10 ; i ++ ; } while ( carry > 0 && i < l ) { int d = ( s [ i ] - '0' ) - carry ; if ( d < 0 ) { d += 10 ; carry = 1 ; } else carry = 0 ; s [ i ] = ( char ) ( d + '0' ) ; i ++ ; } s = reverse ( s ) ; } int num = 0 ; for ( int i = 0 ; i < s . Length ; i ++ ) { num = num * 10 + ( s [ i ] - '0' ) ; } if ( num % 53 == 0 ) return true ; else return false ; } static char [ ] reverse ( char [ ] a ) { int l , r = a . Length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return a ; } public static void Main ( string [ ] args ) { string N = "18432462191076" ; if ( isDivisible ( N . ToCharArray ( ) ) ) Console . Write ( " Yes " + " STRNEWLINE " ) ; else Console . Write ( " No " + " STRNEWLINE " ) ; } }

Index/key variables: i, l, r
Accumulator variables: d, i, l, r, x
Iterator variables: i, l
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checksilverRatio ( double a , double b ) { if ( a < b ) { a = a + b ; b = a - b ; a = a - b ; } double ratio1 = ( ( a / b ) * 1000 ) / 1000 ; double ratio2 = ( int ) ( ( ( 2 * a + b ) / a ) * 1000 ) ; ratio2 = ratio2 / 1000 ; if ( ratio1 == ratio2 && ( int ) ( ratio1 - 2.414 ) == 0 ) { Console . WriteLine ( " Yes " ) ; return true ; } else { Console . WriteLine ( " No " ) ; return false ; } } public static void Main ( ) { double a = 2.414 ; double b = 1 ; checksilverRatio ( a , b ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MIN ( int n ) { int ans = 11 ; while ( n > 0 ) { ans = Math . Min ( ans , n % 10 ) ; n /= 10 ; } return ans ; } static int MAX ( int n ) { int ans = - 1 ; while ( n > 0 ) { ans = Math . Max ( ans , n % 10 ) ; n /= 10 ; } return ans ; } static void Find_value ( int n , int k ) { k -- ; int x = 0 ; int y = 0 ; while ( k -- > 0 ) { x = MIN ( n ) ; y = MAX ( n ) ; if ( y - x == 0 ) break ; n *= ( y - x ) ; } Console . Write ( n ) ; } public static void Main ( String [ ] args ) { int N = 487 , D = 5 ; Find_value ( N , D ) ; } }

Accumulator variables: k, n
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isdecagonal ( int N ) { double n = ( 3 + Math . Sqrt ( 16 * N + 9 ) ) / 8 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int N = 10 ; if ( isdecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isOctadecagon ( int N ) { double n = ( 14 + Math . Sqrt ( 128 * N + 196 ) ) / 32 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( String [ ] args ) { int N = 18 ; if ( isOctadecagon ( N ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int fact ( int n ) { int res = 1 ; for ( int i = 2 ; i <= n ; i ++ ) res = res * i ; return res ; } static int nCr ( int n , int r ) { return fact ( n ) / ( fact ( r ) * fact ( n - r ) ) ; } static bool isPrime ( int n ) { if ( n <= 1 ) return false ; for ( int i = 2 ; i < n ; i ++ ) if ( n % i == 0 ) return false ; return true ; } static int countSubsequences ( int [ ] arr , int n , int k ) { int countPrime = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( isPrime ( arr [ i ] ) ) countPrime ++ ; } if ( countPrime < k ) return 0 ; return nCr ( countPrime , k ) * ( int ) Math . Pow ( 2 , ( n - countPrime ) ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; int K = 3 ; int n = arr . Length ; Console . WriteLine ( countSubsequences ( arr , n , K ) ) ; } }

Index/key variables: i
Accumulator variables: countPrime, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int longestEvenOddSubarray ( int [ ] a , int n ) { int longest = 1 ; int cnt = 1 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( ( a [ i ] + a [ i + 1 ] ) % 2 == 1 ) { cnt ++ ; } else { longest = Math . Max ( longest , cnt ) ; cnt = 1 ; } } if ( longest == 1 ) return 0 ; return Math . Max ( cnt , longest ) ; } static void Main ( ) { int [ ] a = { 1 , 2 , 3 , 4 , 5 , 7 , 8 } ; int n = a . Length ; Console . WriteLine ( longestEvenOddSubarray ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: cnt, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int digSum ( int a ) { int sum = 0 ; while ( a != 0 ) { sum += a % 10 ; a = a / 10 ; } return sum ; } static bool isPrime ( int r ) { bool s = true ; for ( int i = 2 ; i * i <= r ; i ++ ) { if ( r % i == 0 ) { s = false ; break ; } } return s ; } static void moranNo ( int n ) { int dup = n ; int sum = digSum ( dup ) ; if ( n % sum == 0 ) { int c = n / sum ; if ( isPrime ( c ) ) { Console . Write ( " Yes " ) ; return ; } } Console . Write ( " No " ) ; } public static void Main ( ) { int n = 21 ; moranNo ( n ) ; } }

Accumulator variables: i, sum
Iterator variables: i
Boolean variables: s
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool ishendecagonal ( int N ) { double n = ( 7 + Math . Sqrt ( 72 * N + 49 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 11 ; if ( ishendecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No STRNEWLINE " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool ishexadecagonal ( int N ) { double n = ( 12 + Math . Sqrt ( 112 * N + 144 ) ) / 28 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 16 ; if ( ishexadecagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isnonagonal ( int N ) { double n = ( 5 + Math . Sqrt ( 56 * N + 25 ) ) / 14 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( string [ ] args ) { int N = 9 ; if ( isnonagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void divParts ( int N ) { if ( N % 2 == 0 ) Console . WriteLine ( ( N / 2 ) - 1 ) ; else Console . WriteLine ( ( N / 2 ) ) ; } public static void Main ( ) { int N = 8 ; divParts ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int getMinSteps ( int n , int jump ) { int quotient = n / jump ; int remainder = n % jump ; int steps = quotient + remainder ; return steps ; } public static void Main ( string [ ] args ) { int N = 6 , K = 3 ; Console . Write ( getMinSteps ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void constructArray ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { Console . Write ( i + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 5 ; constructArray ( N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCentereddecagonal ( int N ) { double n = ( 5 + Math . Sqrt ( 20 * N + 5 ) ) / 10 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int n = 11 ; if ( isCentereddecagonal ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { 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 += 6 ) { if ( n % i == 0 || n % ( i + 6 ) == 0 ) { return false ; } } return true ; } static bool SexyPrime ( int n1 , int n2 ) { return ( isPrime ( n1 ) && isPrime ( n2 ) && Math . Abs ( n1 - n2 ) == 6 ) ; } static int countSexyPairs ( int [ ] arr , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( SexyPrime ( arr [ i ] , arr [ j ] ) ) { count ++ ; } } } return count ; } public static void Main ( String [ ] args ) { int [ ] arr = { 6 , 7 , 5 , 11 , 13 } ; int n = arr . Length ; Console . Write ( countSexyPairs ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findFirstNumIndex ( int k , int n ) { if ( n == 1 ) return 0 ; n -- ; int first_num_index ; int n_partial_fact = n ; while ( k >= n_partial_fact && n > 1 ) { n_partial_fact = n_partial_fact * ( n - 1 ) ; n -- ; } first_num_index = k / n_partial_fact ; k = k % n_partial_fact ; return first_num_index ; } static String findKthPermutation ( int n , int k ) { String ans = " " ; HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) s . Add ( i ) ; List < int > v = new List < int > ( s ) ; int itr = v [ 0 ] ; k = k - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int index = findFirstNumIndex ( k , n - i ) ; if ( index < v . Count ) { ans += ( ( v [ index ] . ToString ( ) ) ) ; v . RemoveAt ( index ) ; } else ans += String . Join ( " " , itr + 2 ) ; itr = v [ 0 ] ; } return ans ; } public static void Main ( String [ ] args ) { int n = 3 , k = 4 ; String kth_perm_seq = findKthPermutation ( n , k ) ; Console . Write ( kth_perm_seq + " STRNEWLINE " ) ; } }

Index/key variables: index
Accumulator variables: ans, i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static double nDigitPerfectSquares ( int n , int b ) { double largest = Math . Pow ( Math . Ceiling ( Math . Sqrt ( Math . Pow ( b , n ) ) ) - 1 , 2 ) ; return largest ; } public static void Main ( String [ ] args ) { int N = 1 , B = 8 ; Console . WriteLine ( nDigitPerfectSquares ( N , B ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double cubeRoot ( double n ) { double ans = Math . Pow ( 3 , ( ( 1.0 / 3 ) * ( Math . Log ( n ) / Math . Log ( 3 ) ) ) ) ; return ans ; } public static void Main ( String [ ] args ) { double N = 8 ; Console . Write ( " { 0 : F2 } " , cubeRoot ( N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int floorMax ( int A , int B , int N ) { int x = Math . Min ( B - 1 , N ) ; return ( A * x ) / B ; } public static void Main ( string [ ] args ) { int A = 11 , B = 10 , N = 9 ; Console . Write ( floorMax ( A , B , N ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int calculateMoves ( int n ) { int count = 0 ; int layers = n / 2 ; for ( int k = 1 ; k < layers + 1 ; k ++ ) { count += 8 * k * k ; } return count ; } public static void Main ( ) { int N = 5 ; Console . Write ( calculateMoves ( N ) ) ; } }

Accumulator variables: count, k
Iterator variables: k
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isSumSquare ( int N ) { double n = ( 2 + Math . Sqrt ( 8 * N - 4 ) ) / 2 ; return ( n - ( int ) n ) == 0 ; } public static void Main ( String [ ] args ) { int i = 13 ; if ( isSumSquare ( i ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCenteredheptagonal ( int N ) { double n = ( 7 + Math . Sqrt ( 56 * N - 7 ) ) / 14 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int n = 8 ; if ( isCenteredheptagonal ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCenterednonadecagonal ( int N ) { float n = ( float ) ( ( 19 + Math . Sqrt ( 152 * N + 209 ) ) / 38 ) ; return ( n - ( int ) n ) == 0 ; } public static void Main ( ) { int n = 20 ; if ( isCenterednonadecagonal ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCenteredOctadecagonal ( int N ) { double n = ( 9 + Math . Sqrt ( 36 * N + 45 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int n = 19 ; if ( isCenteredOctadecagonal ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { static double kthRoot ( double n , int k ) { return Math . Pow ( k , ( 1.0 / k ) * ( Math . Log ( n ) / Math . Log ( k ) ) ) ; } public static void Main ( ) { double N = 8.0 ; int K = 3 ; Console . Write ( kthRoot ( N , K ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPower ( int N , int K ) { int res1 = ( int ) ( Math . Log ( N ) / Math . Log ( K ) ) ; double res2 = Math . Log ( N ) / Math . Log ( K ) ; return ( res1 == res2 ) ; } public static void Main ( ) { int N = 8 ; int K = 2 ; if ( isPower ( N , K ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static void cntArray ( int [ ] A , int N ) { int result = 0 ; int [ ] frequency = new int [ N + 1 ] ; for ( int i = 0 ; i < N ; i ++ ) { frequency [ A [ i ] ] ++ ; } for ( int i = 1 ; i <= N ; i ++ ) { int frequency_of_i = frequency [ i ] ; result += ( ( frequency_of_i ) * ( frequency_of_i + 1 ) ) / 2 ; } Console . Write ( result ) ; } public static void Main ( ) { int [ ] A = { 1 , 5 , 6 , 1 , 9 , 5 , 8 , 10 , 8 , 9 } ; int N = A . Length ; cntArray ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections ; class GFG { static int findMaxSize ( int [ ] a , int n ) { ArrayList frq = new ArrayList ( n + 1 ) ; for ( int i = 0 ; i <= n ; i ++ ) frq . Add ( 0 ) ; for ( int i = 0 ; i < n ; ++ i ) frq [ a [ i ] ] = ( int ) frq [ a [ i ] ] + 1 ; int maxfrq = int . MinValue ; for ( int i = 0 ; i < frq . Count ; i ++ ) { if ( maxfrq < ( int ) frq [ i ] ) { maxfrq = ( int ) frq [ i ] ; } } int dist = n + 1 ; for ( int i = 0 ; i < frq . Count ; i ++ ) { if ( ( int ) frq [ i ] == 0 ) { dist -- ; } } int ans1 = Math . Min ( maxfrq - 1 , dist ) ; int ans2 = Math . Min ( maxfrq , dist - 1 ) ; int ans = Math . Max ( ans1 , ans2 ) ; return ans ; } public static void Main ( string [ ] args ) { int [ ] arr = { 4 , 2 , 4 , 1 , 4 , 3 , 4 } ; int n = arr . Length ; Console . Write ( findMaxSize ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: dist, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int subarray ( int [ ] arr , int n ) { int ans = 1 , temp = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] == arr [ i - 1 ] ) { ++ temp ; } else { ans = Math . Max ( ans , temp ) ; temp = 1 ; } } ans = Math . Max ( ans , temp ) ; return ans ; } public static void Main ( ) { int [ ] arr = { 2 , 2 , 1 , 1 , 2 , 2 , 2 , 3 , 3 } ; int n = arr . Length ; Console . Write ( subarray ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMaxMinSubArray ( int [ ] arr , int K , int n ) { int min = n ; int max = 0 ; int left ; int right ; int tmp ; for ( int i = 0 ; i < n ; i ++ ) { tmp = 1 ; left = i ; while ( left - 1 >= 0 && Math . Abs ( arr [ left ] - arr [ left - 1 ] ) <= K ) { left -- ; tmp ++ ; } right = i ; while ( right + 1 <= n - 1 && Math . Abs ( arr [ right ] - arr [ right + 1 ] ) <= K ) { right ++ ; tmp ++ ; } if ( min > tmp ) min = tmp ; if ( max < tmp ) max = tmp ; } Console . Write ( min ) ; Console . Write ( " , ▁ " ) ; Console . Write ( max ) ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 5 , 6 , 7 } ; int K = 2 ; int n = arr . Length ; findMaxMinSubArray ( arr , K , n ) ; } }

Index/key variables: left, right
Accumulator variables: i, left, right, tmp
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countElement ( int [ ] arr , int n ) { int [ ] freq = new int [ n + 1 ] ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { freq [ arr [ i ] ] ++ ; } for ( int i = 0 ; i < n - 1 ; i ++ ) { int tmpsum = arr [ i ] ; for ( int j = i + 1 ; j < n ; j ++ ) { tmpsum += arr [ j ] ; if ( tmpsum <= n ) { ans += freq [ tmpsum ] ; freq [ tmpsum ] = 0 ; } } } return ans ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; int n = arr . Length ; Console . WriteLine ( countElement ( arr , n ) ) ; } }

Index/key variables: i, j, tmpsum
Accumulator variables: ans, i, j, tmpsum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static double kthRoot ( double n , int k ) { return Math . Pow ( k , ( ( 1.0 / k ) * ( Math . Log ( n ) / Math . Log ( k ) ) ) ) ; } public static void Main ( String [ ] args ) { double n = 81 ; int k = 4 ; Console . Write ( " { 0 : F6 } " , kthRoot ( n , k ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void distributeN ( int A , int B , int C , int n ) { int max1 = Math . Max ( A , B ) ; int max2 = Math . Max ( B , C ) ; int maximum = Math . Max ( max1 , max2 ) ; int sum = A + B + C ; int p = ( 3 * maximum ) - sum ; int diff = n - p ; if ( diff < 0 diff % 3 == 0 ) Console . Write ( " No " ) ; else Console . Write ( " Yes " ) ; } public static void Main ( String [ ] args ) { int A = 10 , B = 20 ; int C = 15 , n = 14 ; distributeN ( A , B , C , n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void sumOddNumbers ( int N , int K ) { int check = N - ( K - 1 ) ; if ( check > 0 && check % 2 == 1 ) { for ( int i = 0 ; i < K - 1 ; i ++ ) { Console . Write ( "1 ▁ " ) ; } Console . Write ( + check ) ; } else Console . WriteLine ( " - 1 ▁ " ) ; } public static void Main ( ) { int N = 5 ; int K = 3 ; sumOddNumbers ( N , K ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int minimumSteps ( int a , int b , int c ) { if ( a < 1 b < 1 ) return - 1 ; if ( a == 1 && b == 1 ) return c ; if ( a < b ) { a = a + b ; b = a - b ; a = a - b ; } return minimumSteps ( a - b , b , c + 1 ) ; } public static void Main ( ) { int a = 75 ; int b = 17 ; Console . WriteLine ( minimumSteps ( a , b , 0 ) ) ; } }

Class/struct names: GFG