dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { static String findWord ( String [ ] arr ) { Dictionary < String , int > hs = new Dictionary < String , int > ( ) ; for ( int i = 0 ; i < arr . Length ; i ++ ) { if ( hs . ContainsKey ( arr [ i ] ) ) { hs [ arr [ i ] ] = hs [ arr [ i ] ] + 1 ; } else { hs . Add ( arr [ i ] , 1 ) ; } } String key = " " ; int value = 0 ; foreach ( KeyValuePair < String , int > me in hs ) { if ( me . Value > value ) { value = me . Value ; key = me . Key ; } } return key ; } public static void Main ( String [ ] args ) { String [ ] arr = { " geeks " , " for " , " geeks " , " a " , " portal " , " to " , " learn " , " can " , " be " , " computer " , " science " , " zoom " , " yup " , " fire " , " in " , " be " , " data " , " geeks " } ; String sol = findWord ( arr ) ; Console . WriteLine ( sol ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, me
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool almostSort ( int [ ] A , int n ) { for ( int i = 0 ; i < n - 1 ; i ++ ) { if ( A [ i ] > A [ i + 1 ] ) { int temp = A [ i ] ; A [ i ] = A [ i + 1 ] ; A [ i + 1 ] = temp ; i ++ ; } } for ( int i = 0 ; i < n - 1 ; i ++ ) if ( A [ i ] > A [ i + 1 ] ) return false ; return true ; } public static void Main ( ) { int [ ] A = { 1 , 3 , 2 , 4 , 6 , 5 } ; int n = A . Length ; if ( almostSort ( A , n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int nextGap ( int gap ) { if ( gap <= 1 ) return 0 ; return ( gap / 2 ) + ( gap % 2 ) ; } private static void merge ( int [ ] arr1 , int [ ] arr2 , int n , int m ) { int i , j , gap = n + m ; for ( gap = nextGap ( gap ) ; gap > 0 ; gap = nextGap ( gap ) ) { for ( i = 0 ; i + gap < n ; i ++ ) if ( arr1 [ i ] > arr1 [ i + gap ] ) { int temp = arr1 [ i ] ; arr1 [ i ] = arr1 [ i + gap ] ; arr1 [ i + gap ] = temp ; } for ( j = gap > n ? gap - n : 0 ; i < n && j < m ; i ++ , j ++ ) if ( arr1 [ i ] > arr2 [ j ] ) { int temp = arr1 [ i ] ; arr1 [ i ] = arr2 [ j ] ; arr2 [ j ] = temp ; } if ( j < m ) { for ( j = 0 ; j + gap < m ; j ++ ) if ( arr2 [ j ] > arr2 [ j + gap ] ) { int temp = arr2 [ j ] ; arr2 [ j ] = arr2 [ j + gap ] ; arr2 [ j + gap ] = temp ; } } } } public static void Main ( ) { int [ ] a1 = { 10 , 27 , 38 , 43 , 82 } ; int [ ] a2 = { 3 , 9 } ; merge ( a1 , a2 , a1 . Length , a2 . Length ) ; Console . Write ( " First ▁ Array : ▁ " ) ; for ( int i = 0 ; i < a1 . Length ; i ++ ) { Console . Write ( a1 [ i ] + " ▁ " ) ; } Console . WriteLine ( ) ; Console . Write ( " Second ▁ Array : ▁ " ) ; for ( int i = 0 ; i < a2 . Length ; i ++ ) { Console . Write ( a2 [ i ] + " ▁ " ) ; } } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: gap, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void mergeArrays ( int [ ] arr1 , int [ ] arr2 , int n1 , int n2 , int [ ] arr3 ) { int i = 0 , j = 0 , k = 0 ; while ( i < n1 && j < n2 ) { if ( arr1 [ i ] < arr2 [ j ] ) arr3 [ k ++ ] = arr1 [ i ++ ] ; else arr3 [ k ++ ] = arr2 [ j ++ ] ; } while ( i < n1 ) arr3 [ k ++ ] = arr1 [ i ++ ] ; while ( j < n2 ) arr3 [ k ++ ] = arr2 [ j ++ ] ; } public static void Main ( ) { int [ ] arr1 = { 1 , 3 , 5 , 7 } ; int n1 = arr1 . Length ; int [ ] arr2 = { 2 , 4 , 6 , 8 } ; int n2 = arr2 . Length ; int [ ] arr3 = new int [ n1 + n2 ] ; mergeArrays ( arr1 , arr2 , n1 , n2 , arr3 ) ; Console . Write ( " Array ▁ after ▁ merging STRNEWLINE " ) ; for ( int i = 0 ; i < n1 + n2 ; i ++ ) Console . Write ( arr3 [ i ] + " ▁ " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static void sortSquares ( int [ ] arr ) { int n = arr . Length ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = arr [ i ] * arr [ i ] ; Array . Sort ( arr ) ; } public static void Main ( ) { int [ ] arr = { - 6 , - 3 , - 1 , 2 , 4 , 5 } ; int n = arr . Length ; Console . WriteLine ( " Before ▁ sort ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; sortSquares ( arr ) ; Console . WriteLine ( " " ) ; Console . WriteLine ( " After ▁ Sort ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System class { static void mergeTwoHalf ( int [ ] A , int n ) { int half_i = 0 int int [ ] temp = new int [ n ] for ( i = 0 i < n - 1 i ++ ) { if ( A [ i ] > A [ i + 1 ] ) { half_i = i + 1 break } } if ( half_i == 0 ) return = 0 int = half_i int = 0 while ( i < half_i & & j < n ) { if ( A [ i ] < A [ j ] ) temp [ k ++ ] = A [ i ++ ] else [ k ++ ] = A [ j ++ ] } while ( i < half_i ) temp [ k ++ ] = A [ i ++ ] while ( j < n ) temp [ k ++ ] = A [ j ++ ] for ( i = 0 i < n i ++ ) A [ i ] = temp [ i ] } static public void ( ) { int [ ] A = { 2 , 3 , 8 , - 1 , 7 , 10 } int n = A . Length mergeTwoHalf ( A , n ) for ( int i = 0 i < n i ++ ) Console . Write ( A [ i ] + " ▁ " ) } }

Index/key variables: i, j, n
Accumulator variables: i, j, k
Iterator variables: i
C# program:
using System ; class GFG { static int findMinDiff ( int [ ] arr , int n , int m ) { if ( m == 0 n == 0 ) return 0 ; Array . Sort ( arr ) ; if ( n < m ) return - 1 ; int min_diff = int . MaxValue ; for ( int i = 0 ; i + m - 1 < n ; i ++ ) { int diff = arr [ i + m - 1 ] - arr [ i ] ; if ( diff < min_diff ) min_diff = diff ; } return min_diff ; } public static void Main ( ) { int [ ] arr = { 12 , 4 , 7 , 9 , 2 , 23 , 25 , 41 , 30 , 40 , 28 , 42 , 30 , 44 , 48 , 43 , 50 } ; int n = arr . Length ; Console . WriteLine ( " Minimum ▁ difference ▁ is ▁ " + findMinDiff ( arr , n , m ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int distinctCount ( int [ ] arr , int n ) { HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) s . Add ( Math . Abs ( arr [ i ] ) ) ; return s . Count ; } public static void Main ( ) { int [ ] arr = { - 2 , - 1 , 0 , 1 , 1 } ; int n = arr . Length ; Console . Write ( " Count ▁ of ▁ absolute ▁ distinct ▁ values ▁ : ▁ " + distinctCount ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int distinctCount ( int [ ] arr , int n ) { int count = n ; int i = 0 , j = n - 1 , sum = 0 ; while ( i < j ) { while ( i != j && arr [ i ] == arr [ i + 1 ] ) { count -- ; i ++ ; } while ( i != j && arr [ j ] == arr [ j - 1 ] ) { count -- ; j -- ; } if ( i == j ) break ; sum = arr [ i ] + arr [ j ] ; if ( sum == 0 ) { count -- ; i ++ ; j -- ; } else if ( sum < 0 ) i ++ ; else j -- ; } return count ; } public static void Main ( ) { int [ ] arr = { - 2 , - 1 , 0 , 1 , 1 } ; int n = arr . Length ; Console . WriteLine ( " Count ▁ of ▁ absolute ▁ distinct ▁ values ▁ : ▁ " + distinctCount ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: count, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 100 ; public static void sortStrings ( String [ ] arr , int n ) { String temp ; for ( int j = 0 ; j < n - 1 ; j ++ ) { for ( int i = j + 1 ; i < n ; i ++ ) { if ( arr [ j ] . CompareTo ( arr [ i ] ) > 0 ) { temp = arr [ j ] ; arr [ j ] = arr [ i ] ; arr [ i ] = temp ; } } } } public static void Main ( String [ ] args ) { String [ ] arr = { " GeeksforGeeks " , " Quiz " , " Practice " , " Gblogs " , " Coding " } ; int n = arr . Length ; sortStrings ( arr , n ) ; Console . WriteLine ( " Strings ▁ in ▁ sorted ▁ order ▁ are ▁ : ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . WriteLine ( " String ▁ " + ( i + 1 ) + " ▁ is ▁ " + arr [ i ] ) ; } }

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 sortByOneSwap ( int [ ] arr , int n ) { for ( int i = n - 1 ; i > 0 ; i -- ) { if ( arr [ i ] < arr [ i - 1 ] ) { int j = i - 1 ; while ( j >= 0 && arr [ i ] < arr [ j ] ) j -- ; int temp = arr [ i ] ; arr [ i ] = arr [ j + 1 ] ; arr [ j + 1 ] = temp ; break ; } } } static void printArray ( int [ ] arr , int n ) { int i ; for ( i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; } public static void Main ( ) { int [ ] arr = { 10 , 30 , 20 , 40 , 50 , 60 , 70 } ; int n = arr . Length ; Console . WriteLine ( " Given ▁ array ▁ is ▁ " ) ; printArray ( arr , n ) ; sortByOneSwap ( arr , n ) ; Console . WriteLine ( " Sorted ▁ array ▁ is ▁ " ) ; printArray ( arr , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void flip ( int [ ] arr , int i ) { int temp , start = 0 ; while ( start < i ) { temp = arr [ start ] ; arr [ start ] = arr [ i ] ; arr [ i ] = temp ; start ++ ; i -- ; } } static int findMax ( int [ ] arr , int n ) { int mi , i ; for ( mi = 0 , i = 0 ; i < n ; ++ i ) if ( arr [ i ] > arr [ mi ] ) mi = i ; return mi ; } static int pancakeSort ( int [ ] arr , int n ) { for ( int curr_size = n ; curr_size > 1 ; -- curr_size ) { int mi = findMax ( arr , curr_size ) ; if ( mi != curr_size - 1 ) { flip ( arr , mi ) ; flip ( arr , curr_size - 1 ) ; } } return 0 ; } static void printArray ( int [ ] arr , int arr_size ) { for ( int i = 0 ; i < arr_size ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; Console . Write ( " " ) ; } public static void Main ( ) { int [ ] arr = { 23 , 10 , 20 , 11 , 12 , 6 , 7 } ; int n = arr . Length ; pancakeSort ( arr , n ) ; Console . Write ( " Sorted ▁ Array : ▁ " ) ; printArray ( arr , n ) ; } }

Index/key variables: i, mi, start
Accumulator variables: i, start
Iterator variables: curr_size, i, mi
Class/struct names: GFG
C# program:
using System ; class GFG { static string genString ( int N ) { string ans = " " ; if ( N % 2 == 0 ) { for ( int i = 0 ; i < N - 1 ; i ++ ) ans += '1' ; ans += '2' ; } else { for ( int i = 0 ; i < N ; i ++ ) ans += '1' ; } return ans ; } public static void Main ( ) { int N = 5 ; Console . WriteLine ( genString ( N ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string performOperation ( string S , int N ) { for ( int i = 0 ; i < N ; i ++ ) { if ( i % 2 == 0 ) { if ( S [ i ] == ' a ' ) { S = S . Substring ( 0 , i ) + ' b ' + S . Substring ( i + 1 ) ; } else { S = S . Substring ( 0 , i ) + ' a ' + S . Substring ( i + 1 ) ; } } else { if ( S [ i ] == ' z ' ) { S = S . Substring ( 0 , i ) + ' y ' + S . Substring ( i + 1 ) ; } else { S = S . Substring ( 0 , i ) + ' z ' + S . Substring ( i + 1 ) ; } } } return S ; } public static void Main ( ) { string S = " giad " ; int N = S . Length ; Console . Write ( performOperation ( S , 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 { static bool check ( int x , int N ) { while ( true ) { N -= x ; if ( x < 10 ) break ; int temp2 = 0 ; while ( x > 0 ) { temp2 += ( x % 10 ) ; x = ( int ) x / 10 ; } x = temp2 ; } if ( ( x < 10 ) && ( N == 0 ) ) { return true ; } return false ; } static int countNoOfsuchX ( int N ) { int k = ( int ) ( Math . Log10 ( N ) ) + 1 ; int count = 1 ; for ( int x = ( N - ( k * ( k + 1 ) * 5 ) ) ; x <= N ; x ++ ) { if ( check ( x , N ) ) { count += 1 ; } } return count ; } public static void Main ( ) { int N = 9399 ; Console . Write ( countNoOfsuchX ( N ) ) ; } }

Accumulator variables: N, count, temp2, x
Iterator variables: x
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int find ( List < int > arr , int N ) { int Sum = 0 ; foreach ( int item in arr ) Sum += item ; if ( Sum % N == 1 ) return - 1 ; int k = Sum / N ; int ans = 0 ; int i = 0 ; while ( i < N ) { ans = ans + Math . Abs ( k - arr [ i ] ) ; i += 1 ; } return ans / 2 ; } public static void Main ( ) { List < int > arr = new List < int > ( ) { 5 , 4 , 1 , 10 } ; int N = arr . Count ; Console . Write ( find ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: Sum, i
Iterator variables: item
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int minimumSteps ( int a , int b ) { int cnt = 0 ; a = Math . Abs ( a - b ) ; cnt = ( a / 5 ) + ( a % 5 ) / 2 + ( a % 5 ) % 2 ; return cnt ; } public static void Main ( ) { int A = 3 , B = 9 ; Console . Write ( minimumSteps ( A , B ) ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int shortestDistance ( string s , int n ) { int [ ] visited = new int [ 128 ] ; for ( int i = 0 ; i < 128 ; i ++ ) visited [ i ] = - 1 ; int ans = int . MaxValue ; for ( int right = 0 ; right < n ; right ++ ) { char c = s [ right ] ; int left = visited ; if ( left != - 1 ) ans = Math . Min ( ans , right - left - 1 ) ; visited = right ; } return ans == int . MaxValue ? - 1 : ans ; } public static void Main ( String [ ] args ) { string s = " geeksforgeeks " ; int n = 13 ; Console . Write ( shortestDistance ( s , n ) ) ; } }

Index/key variables: i, right
Accumulator variables: i, right
Iterator variables: i, right
Class/struct names: GFG
C# program:
using System ; class GFG { static double Pi = 3.141592 ; static int MaxBuildingsCovered ( int [ ] arr , int N , int L ) { double curr_sum = 0 ; int start = 0 , curr_count = 0 , max_count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { curr_sum = curr_sum + ( ( double ) arr [ i ] * Pi ) ; if ( i != 0 ) curr_sum += 1 ; if ( curr_sum <= L ) { curr_count ++ ; } else if ( curr_sum > L ) { curr_sum = curr_sum - ( ( double ) arr [ start ] * Pi ) ; curr_sum -= 1 ; start ++ ; curr_count -- ; } max_count = Math . Max ( curr_count , max_count ) ; } return max_count ; } static void Main ( ) { int [ ] arr = { 4 , 1 , 6 , 2 } ; int L = 24 ; int N = arr . Length ; Console . Write ( MaxBuildingsCovered ( arr , N , L ) ) ; } }

Index/key variables: i, start
Accumulator variables: curr_count, curr_sum, i, start
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int countUnsetBits ( int N ) { int c = 0 ; while ( N != 0 ) { if ( N % 2 == 0 ) { c += 1 ; } N = N >> 1 ; } return c ; } static void countBitwiseZero ( int N ) { int unsetBits = countUnsetBits ( N ) ; Console . Write ( 1 << unsetBits ) ; } public static void Main ( String [ ] args ) { int N = 9 ; countBitwiseZero ( N ) ; } }

Accumulator variables: c
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPossible ( String s ) { int n = s . Length ; int count_0 = 0 , count_1 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] == '0' ) ++ count_0 ; else ++ count_1 ; if ( count_1 > count_0 ) return false ; } if ( count_0 != ( 2 * count_1 ) ) return false ; count_0 = 0 ; count_1 = 0 ; for ( int i = n - 1 ; i >= 0 ; -- i ) { if ( s [ i ] == '0' ) ++ count_0 ; else ++ count_1 ; if ( count_1 > count_0 ) return false ; } return true ; } static public void Main ( ) { String s = "010100" ; if ( isPossible ( s ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void leastBricks ( List < List < int > > wall ) { Dictionary < int , int > map = new Dictionary < int , int > ( ) ; int res = 0 ; foreach ( List < int > subList in wall ) { int width = 0 ; for ( int i = 0 ; i < subList . Count - 1 ; i ++ ) { width += subList [ i ] ; if ( map . ContainsKey ( width ) ) map [ width ] ++ ; else map . Add ( width , 1 ) ; res = Math . Max ( res , map [ width ] ) ; } } Console . Write ( wall . Count - res ) ; } public static void Main ( ) { List < List < int > > myList = new List < List < int > > ( ) ; myList . Add ( new List < int > { 1 , 2 , 2 , 1 } ) ; myList . Add ( new List < int > { 3 , 1 , 2 } ) ; myList . Add ( new List < int > { 1 , 3 , 2 } ) ; myList . Add ( new List < int > { 2 , 4 } ) ; myList . Add ( new List < int > { 3 , 1 , 2 } ) ; myList . Add ( new List < int > { 1 , 3 , 1 , 1 } ) ; leastBricks ( myList ) ; } }

Index/key variables: i, width
Accumulator variables: i, width
Iterator variables: i, subList
Class/struct names: GFG
C# program:
using System ; class GFG { static void findPermutation ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { int N = 5 ; findPermutation ( N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int numberOfWays ( int N , int X , int Y ) { int S1 = ( N - 1 ) * X + Y ; int S2 = ( N - 1 ) * Y + X ; return ( S2 - S1 + 1 ) ; } public static void Main ( ) { int N = 3 ; int X = 13 ; int Y = 15 ; Console . WriteLine ( numberOfWays ( N , X , Y ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int MinimumOperations ( int [ ] A , int N , int K ) { int Count = 0 ; int i = 0 ; while ( i < N - 1 ) { i = i + K - 1 ; Count ++ ; } return Count ; } public static void Main ( ) { int [ ] A = { 5 , 4 , 3 , 1 , 2 } ; int K = 3 ; int N = A . Length ; Console . WriteLine ( MinimumOperations ( A , N , K ) ) ; } }

Accumulator variables: Count
Class/struct names: GFG
C# program:
using System ; class GFG { static bool is_prime ( long n ) { if ( n == 1 ) { return false ; } for ( long i = 2 ; i <= ( long ) Math . Sqrt ( n ) ; i ++ ) { if ( n % i == 0 ) { return false ; } } return true ; } static void consecutive_primes ( long n ) { long first = - 1 , second = - 1 ; for ( long i = ( long ) Math . Sqrt ( n ) ; i >= 2 ; i -- ) { if ( is_prime ( i ) ) { first = i ; break ; } } for ( long i = ( long ) Math . Sqrt ( n ) + 1 ; i <= n / 2 ; i ++ ) { if ( is_prime ( i ) ) { second = i ; break ; } } if ( first * second >= n ) { Console . WriteLine ( first + " ▁ " + second ) ; } else { for ( long i = second + 1 ; i <= n ; i ++ ) { if ( is_prime ( i ) ) { Console . WriteLine ( second + " ▁ " + i ) ; return ; } } } } public static void Main ( ) { long n = 14 ; consecutive_primes ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string construct_digits ( string s ) { char [ ] k = { ' z ' , ' w ' , ' u ' , ' x ' , ' g ' , ' h ' , ' o ' , ' f ' , ' v ' , ' i ' } ; string [ ] l = { " zero " , " two " , " four " , " six " , " eight " , " three " , " one " , " five " , " seven " , " nine " } ; int [ ] c = { 0 , 2 , 4 , 6 , 8 , 3 , 1 , 5 , 7 , 9 } ; List < string > ans = new List < string > ( ) ; Dictionary < char , int > d = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ! d . ContainsKey ( s [ i ] ) ) d [ s [ i ] ] = 0 ; d [ s [ i ] ] += 1 ; } for ( int i = 0 ; i < k . Length ; i ++ ) { int x = 0 ; if ( d . ContainsKey ( k [ i ] ) ) x = d [ k [ i ] ] ; for ( int j = 0 ; j < l [ i ] . Length ; j ++ ) { if ( d . ContainsKey ( l [ i ] [ j ] ) ) d [ l [ i ] [ j ] ] -= x ; } ans . Add ( ( ( c [ i ] ) * x ) . ToString ( ) ) ; } ans . Sort ( ) ; string str = ( String . Join ( " " , ans . ToArray ( ) ) ) ; return str . Replace ( "0" , " " ) ; } public static void Main ( string [ ] args ) { string s = " fviefuro " ; Console . WriteLine ( construct_digits ( s ) ) ; } }

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 countDecrements ( long [ , ] arr ) { int n = arr . GetLength ( 0 ) ; int m = arr . GetLength ( 1 ) ; int count_1 = 0 ; int count_2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( ( i + j ) % 2 == arr [ i , j ] % 2 ) count_1 ++ ; if ( 1 - ( i + j ) % 2 == arr [ i , j ] % 2 ) count_2 ++ ; } } Console . WriteLine ( Math . Min ( count_1 , count_2 ) ) ; } public static void Main ( ) { long [ , ] arr = { { 1 , 2 , 3 } , { 1 , 2 , 3 } , { 1 , 2 , 3 } } ; countDecrements ( arr ) ; } }

Accumulator variables: count_1, count_2, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void check ( int X , int Y ) { if ( X > 3 ) { Console . WriteLine ( " Yes " ) ; } else if ( X == 1 && Y == 1 ) { Console . WriteLine ( " Yes " ) ; } else if ( X == 2 && Y <= 3 ) { Console . WriteLine ( " Yes " ) ; } else if ( X == 3 && Y <= 3 ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } public static void Main ( string [ ] args ) { int X = 6 , Y = 8 ; check ( X , Y ) ; } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int distIntegers ( int L , int R ) { return 2 * R - 2 * L + 1 ; } static public void Main ( ) { int L = 3 , R = 8 ; Console . Write ( distIntegers ( L , R ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void evenXorSubarray ( int [ ] arr , int n ) { int ans = 0 ; int [ ] freq = { 0 , 0 } ; int XOR = 0 ; for ( int i = 0 ; i < n ; i ++ ) { XOR = XOR ^ arr [ i ] ; if ( XOR % 2 == 0 ) { ans += freq [ 0 ] + 1 ; freq [ 0 ] ++ ; } else { ans += freq [ 1 ] ; freq [ 1 ] ++ ; } } Console . WriteLine ( ans ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int N = arr . Length ; evenXorSubarray ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countOccurrences ( int N , int X ) { int count = 0 ; for ( int i = 1 ; i < Math . Sqrt ( X ) ; i ++ ) { if ( X % i == 0 ) { int a = i ; int b = X / i ; if ( a <= N && b <= N ) { if ( a == b ) count += 1 ; else count += 2 ; } } } return count ; } public static void Main ( String [ ] args ) { int N = 7 ; int X = 12 ; Console . Write ( countOccurrences ( N , X ) ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findArrayWithMaxProduct ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) if ( arr [ i ] >= 0 ) { arr [ i ] = - arr [ i ] - 1 ; } if ( N % 2 == 1 ) { int max_element = - 1 ; int index = - 1 ; for ( int i = 0 ; i < N ; i ++ ) if ( Math . Abs ( arr [ i ] ) > max_element ) { max_element = Math . Abs ( arr [ i ] ) ; index = i ; } arr [ index ] = - arr [ index ] - 1 ; } for ( int i = 0 ; i < N ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; } static public void Main ( ) { int [ ] arr = { - 3 , 0 , 1 } ; int N = arr . Length ; findArrayWithMaxProduct ( arr , N ) ; } }

Index/key variables: i, index
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findPerfectIndex ( int N , int K ) { int i = 0 ; for ( ; i < K ; i ++ ) { Console . Write ( ( N - K + 1 ) + i + " ▁ " ) ; } for ( ; i < N ; i ++ ) { Console . Write ( i - K + 1 + " ▁ " ) ; } } public static void Main ( String [ ] args ) { int N = 10 , K = 3 ; findPerfectIndex ( N , K ) ; } }

Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static void countPairs ( long L , long R ) { long firstNum = 2 * L ; long lastNum = 2 * R ; long Cntpairs = lastNum - firstNum + 1 ; Console . WriteLine ( Cntpairs ) ; } static public void Main ( ) { long L = 2 , R = 3 ; countPairs ( L , R ) ; } }

Class/struct names: GFG