dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Linq ; class GFG { static bool isPossible ( int [ ] A , int n , int H , int K ) { int time = 0 ; for ( int i = 0 ; i < n ; ++ i ) time += ( A [ i ] - 1 ) / K + 1 ; return time <= H ; } static int minJobSpeed ( int [ ] A , int n , int H ) { if ( H < n ) return - 1 ; int max = A . Max ( ) ; int lo = 1 , hi = max ; while ( lo < hi ) { int mi = lo + ( hi - lo ) / 2 ; if ( ! isPossible ( A , n , H , mi ) ) lo = mi + 1 ; else hi = mi ; } return lo ; } public static void Main ( ) { int [ ] A = { 3 , 6 , 7 , 11 } ; int H = 8 ; int n = A . Length ; Console . WriteLine ( minJobSpeed ( A , n , H ) ) ; } }

Index/key variables: i
Accumulator variables: time
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAXN = 11 ; static int ver = 2 ; static int [ , ] hashtable = new int [ ver , MAXN ] ; static int [ ] pos = new int [ ver ] ; static void initTable ( ) { for ( int j = 0 ; j < MAXN ; j ++ ) for ( int i = 0 ; i < ver ; i ++ ) hashtable [ i , j ] = int . MinValue ; } static int hash ( int function , int key ) { switch ( function ) { case 1 : return key % MAXN ; case 2 : return ( key / MAXN ) % MAXN ; } return int . MinValue ; } static void place ( int key , int tableID , int cnt , int n ) { if ( cnt == n ) { Console . Write ( " { 0 } ▁ unpositioned STRNEWLINE " , key ) ; Console . Write ( " Cycle ▁ present . ▁ REHASH . STRNEWLINE " ) ; return ; } for ( int i = 0 ; i < ver ; i ++ ) { pos [ i ] = hash ( i + 1 , key ) ; if ( hashtable [ i , pos [ i ] ] == key ) return ; } if ( hashtable [ tableID , pos [ tableID ] ] != int . MinValue ) { int dis = hashtable [ tableID , pos [ tableID ] ] ; hashtable [ tableID , pos [ tableID ] ] = key ; place ( dis , ( tableID + 1 ) % ver , cnt + 1 , n ) ; } else hashtable [ tableID , pos [ tableID ] ] = key ; } static void printTable ( ) { Console . Write ( " Final ▁ hash ▁ tables : STRNEWLINE " ) ; for ( int i = 0 ; i < ver ; i ++ , Console . Write ( " STRNEWLINE " ) ) for ( int j = 0 ; j < MAXN ; j ++ ) if ( hashtable [ i , j ] == int . MinValue ) Console . Write ( " - ▁ " ) ; else Console . Write ( " { 0 } ▁ " , hashtable [ i , j ] ) ; Console . Write ( " STRNEWLINE " ) ; } static void cuckoo ( int [ ] keys , int n ) { initTable ( ) ; for ( int i = 0 , cnt = 0 ; i < n ; i ++ , cnt = 0 ) place ( keys [ i ] , 0 , cnt , n ) ; printTable ( ) ; } public static void Main ( String [ ] args ) { int [ ] keys_1 = { 20 , 50 , 53 , 75 , 100 , 67 , 105 , 3 , 36 , 39 } ; int n = keys_1 . Length ; cuckoo ( keys_1 , n ) ; int [ ] keys_2 = { 20 , 50 , 53 , 75 , 100 , 67 , 105 , 3 , 36 , 39 , 6 } ; int m = keys_2 . Length ; cuckoo ( keys_2 , m ) ; } }

Index/key variables: i, tableID, ver
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int countAnomalies ( int [ ] a , int n , int k ) { Array . Sort ( a ) ; int res = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int u = upper_bound ( a , 0 , n , a [ i ] ) ; if ( u < n && a [ u ] - a [ i ] <= k ) continue ; int s = lower_bound ( a , 0 , n , a [ i ] ) ; if ( u - s > 1 ) continue ; if ( s > 0 && a [ s - 1 ] - a [ i ] <= k ) continue ; res ++ ; } return res ; } static int lower_bound ( int [ ] a , int low , int high , int element ) { while ( low < high ) { int middle = low + ( high - low ) / 2 ; if ( element > a [ middle ] ) low = middle + 1 ; else high = middle ; } return low ; } static int upper_bound ( int [ ] a , int low , int high , int element ) { while ( low < high ) { int middle = low + ( high - low ) / 2 ; if ( a [ middle ] > element ) high = middle ; else low = middle + 1 ; } return low ; } public static void Main ( String [ ] args ) { int [ ] arr = { 7 , 1 , 8 } ; int k = 5 ; int n = arr . Length ; Console . Write ( countAnomalies ( arr , n , k ) ) ; } }

Index/key variables: i, middle, u
Accumulator variables: i, res
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class geeks { public static int sumoflength ( int [ ] arr , int n ) { HashSet < int > s = new HashSet < int > ( ) ; int j = 0 , ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { while ( j < n && ! s . Contains ( arr [ j ] ) ) { s . Add ( arr [ i ] ) ; j ++ ; } ans += ( ( j - i ) * ( j - i + 1 ) ) / 2 ; s . Remove ( arr [ i ] ) ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 4 } ; int n = arr . Length ; Console . WriteLine ( sumoflength ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: ans, i, j
Iterator variables: i
Class/struct names: geeks
C# program:
using System ; using System . Collections . Generic ; class Test { static int countDistictSubarray ( int [ ] arr , int n ) { Dictionary < int , int > vis = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; ++ i ) if ( ! vis . ContainsKey ( arr [ i ] ) ) vis . Add ( arr [ i ] , 1 ) ; int k = vis . Count ; vis . Clear ( ) ; int ans = 0 , right = 0 , window = 0 ; for ( int left = 0 ; left < n ; ++ left ) { while ( right < n && window < k ) { if ( vis . ContainsKey ( arr [ right ] ) ) vis [ arr [ right ] ] = vis [ arr [ right ] ] + 1 ; else vis . Add ( arr [ right ] , 1 ) ; if ( vis [ arr [ right ] ] == 1 ) ++ window ; ++ right ; } if ( window == k ) ans += ( n - right + 1 ) ; if ( vis . ContainsKey ( arr [ left ] ) ) vis [ arr [ left ] ] = vis [ arr [ left ] ] - 1 ; if ( vis [ arr [ left ] ] == 0 ) -- window ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 1 , 3 , 2 , 3 } ; Console . WriteLine ( countDistictSubarray ( arr , arr . Length ) ) ; } }

Index/key variables: i, left, right
Accumulator variables: ans
Iterator variables: i, left
Class/struct names: Test
C# program:
using System ; class GFG { static int countSubarrays ( int [ ] arr , int n ) { int difference = 0 ; int ans = 0 ; int [ ] hash_positive = new int [ n + 1 ] ; int [ ] hash_negative = new int [ n + 1 ] ; Array . Clear ( hash_positive , 0 , n + 1 ) ; Array . Clear ( hash_negative , 0 , n + 1 ) ; hash_positive [ 0 ] = 1 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( arr [ i ] & 1 ) == 1 ) difference ++ ; else difference -- ; if ( difference < 0 ) { ans += hash_negative [ - difference ] ; hash_negative [ - difference ] ++ ; } else { ans += hash_positive [ difference ] ; hash_positive [ difference ] ++ ; } } return ans ; } static void Main ( ) { int [ ] arr = new int [ ] { 3 , 4 , 6 , 8 , 1 , 10 , 5 , 7 } ; int n = arr . Length ; Console . Write ( " Total ▁ Number ▁ of ▁ Even - Odd " + " ▁ subarrays ▁ are ▁ " + countSubarrays ( arr , n ) ) ; } }

Index/key variables: difference, i
Accumulator variables: ans, difference, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class Node { public int data ; public Node left , right ; public Node ( int item ) { data = item ; left = right = null ; } } public class BinaryTree { public Node root ; public virtual void printPaths ( Node node ) { int [ ] path = new int [ 1000 ] ; printPathsRecur ( node , path , 0 ) ; } public virtual void printPathsRecur ( Node node , int [ ] path , int pathLen ) { if ( node == null ) { return ; } path [ pathLen ] = node . data ; pathLen ++ ; if ( node . left == null && node . right == null ) { printArray ( path , pathLen ) ; } else { printPathsRecur ( node . left , path , pathLen ) ; printPathsRecur ( node . right , path , pathLen ) ; } } public virtual void printArray ( int [ ] ints , int len ) { int i ; for ( i = 0 ; i < len ; i ++ ) { Console . Write ( ints [ i ] + " ▁ " ) ; } Console . WriteLine ( " " ) ; } public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; tree . root = new Node ( 1 ) ; tree . root . left = new Node ( 2 ) ; tree . root . right = new Node ( 3 ) ; tree . root . left . left = new Node ( 4 ) ; tree . root . left . right = new Node ( 5 ) ; tree . printPaths ( tree . root ) ; } }

Index/key variables: i, pathLen
Accumulator variables: i, pathLen
Iterator variables: i
Class/struct names: BinaryTree, Node
C# program:
using System ; class GFG { static bool search ( int [ , ] mat , int m , int n , int x ) { int i = m - 1 , j = 0 ; while ( i >= 0 && j < n ) { if ( mat [ i , j ] == x ) return true ; if ( mat [ i , j ] > x ) i -- ; else j ++ ; } return false ; } public static void Main ( ) { int [ , ] mat = { { 10 , 20 , 30 , 40 } , { 15 , 25 , 35 , 45 } , { 27 , 29 , 37 , 48 } , { 32 , 33 , 39 , 50 } , { 50 , 60 , 70 , 80 } } ; if ( search ( mat , 5 , 4 , 29 ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int distinctIds ( int [ ] arr , int n , int mi ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; int count = 0 ; int size = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . ContainsKey ( arr [ i ] ) == false ) { m [ arr [ i ] ] = 1 ; size ++ ; } else { m [ arr [ i ] ] ++ ; } } foreach ( KeyValuePair < int , int > mp in m ) { if ( mp . Key <= mi ) { mi -= mp . Key ; count ++ ; } } return size - count ; } static void Main ( ) { int [ ] arr = { 2 , 3 , 1 , 2 , 3 , 3 } ; int m = 3 ; Console . WriteLine ( distinctIds ( arr , arr . Length , m ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, mi, size
Iterator variables: i, mp
Class/struct names: GFG
C# program:
using System ; public class GFG { static void printGreaterCount ( String str ) { int len = str . Length ; int [ ] right = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { for ( int j = i + 1 ; j < len ; j ++ ) { if ( str [ i ] < str [ j ] ) { right [ i ] ++ ; } } } for ( int i = 0 ; i < len ; i ++ ) { Console . Write ( right [ i ] + " ▁ " ) ; } } public static void Main ( ) { String str = " abcd " ; printGreaterCount ( str ) ; } }

Index/key variables: i, j, len
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static int findLongestConseqSubseq ( int [ ] arr , int n ) { HashSet < int > S = new HashSet < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) S . Add ( arr [ i ] ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( S . Contains ( arr [ i ] ) ) { int j = arr [ i ] ; while ( S . Contains ( j ) ) j ++ ; ans = Math . Max ( ans , j - arr [ i ] ) ; } } return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 94 , 93 , 1000 , 5 , 92 , 78 } ; int n = arr . Length ; Console . WriteLine ( findLongestConseqSubseq ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static int appearsNBy3 ( int [ ] arr , int n ) { int count1 = 0 , count2 = 0 ; int first = int . MaxValue ; int second = int . MaxValue ; for ( int i = 1 ; i < n ; i ++ ) { if ( first == arr [ i ] ) count1 ++ ; else if ( second == arr [ i ] ) count2 ++ ; else if ( count1 == 0 ) { count1 ++ ; first = arr [ i ] ; } else if ( count2 == 0 ) { count2 ++ ; second = arr [ i ] ; } else { count1 -- ; count2 -- ; } } count1 = 0 ; count2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == first ) count1 ++ ; else if ( arr [ i ] == second ) count2 ++ ; } if ( count1 > n / 3 ) return first ; if ( count2 > n / 3 ) return second ; return - 1 ; } static public void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 3 , 1 , 1 } ; int n = arr . Length ; Console . WriteLine ( appearsNBy3 ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: count1, count2, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class Count { public static int count4Divisibiles ( int [ ] arr , int n ) { int [ ] freq = { 0 , 0 , 0 , 0 } ; int i = 0 ; int ans ; for ( i = 0 ; i < n ; i ++ ) ++ freq [ arr [ i ] % 4 ] ; ans = freq [ 0 ] * ( freq [ 0 ] - 1 ) / 2 ; ans += freq [ 2 ] * ( freq [ 2 ] - 1 ) / 2 ; ans += freq [ 1 ] * freq [ 3 ] ; return ( ans ) ; } public static void Main ( ) { int [ ] arr = { 2 , 2 , 1 , 7 , 5 } ; int n = 5 ; Console . WriteLine ( count4Divisibiles ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: ans, i
Iterator variables: i
Class/struct names: Count
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findSubarraySum ( int [ ] arr , int n ) { int i , j ; int [ ] cArray = new int [ n + 1 ] ; for ( i = 0 ; i < n ; i ++ ) cArray [ i + 1 ] = cArray [ i ] + arr [ i ] ; List < int > subArrSum = new List < int > ( ) ; for ( i = 1 ; i <= n ; i ++ ) for ( j = i ; j <= n ; j ++ ) subArrSum . Add ( cArray [ j ] - cArray [ i - 1 ] ) ; subArrSum . Sort ( ) ; int totalSum = 0 ; for ( i = 0 ; i < subArrSum . Count - 1 ; i ++ ) { if ( subArrSum [ i ] == subArrSum [ i + 1 ] ) { j = i + 1 ; while ( subArrSum [ j ] == subArrSum [ i ] && j < subArrSum . Count ) { subArrSum [ j ] = 0 ; j ++ ; } subArrSum [ i ] = 0 ; } } for ( i = 0 ; i < subArrSum . Count ; i ++ ) totalSum += subArrSum [ i ] ; return totalSum ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 2 , 3 , 1 , 4 } ; int n = arr . Length ; Console . Write ( findSubarraySum ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, totalSum
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class gfg { static int countMaxSetBits ( int left , int right ) { int max_count = - 1 , num = 0 ; for ( int i = left ; i <= right ; ++ i ) { int temp = i , cnt = 0 ; while ( temp > 0 ) { if ( temp % 2 == 1 ) ++ cnt ; temp >>= 1 ; } if ( cnt > max_count ) { max_count = cnt ; num = i ; } } return num ; } public static void Main ( String [ ] args ) { int l = 1 , r = 5 ; Console . WriteLine ( countMaxSetBits ( l , r ) ) ; l = 1 ; r = 10 ; Console . Write ( countMaxSetBits ( l , r ) ) ; } }

Iterator variables: i
Class/struct names: gfg
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findSubarraySum ( int [ ] arr , int n ) { int res = 0 ; Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int sum = 0 ; for ( int j = i ; j < n ; j ++ ) { sum += arr [ j ] ; if ( m . ContainsKey ( sum ) ) { m [ sum ] = m [ sum ] + 1 ; } else { m . Add ( sum , 1 ) ; } } } foreach ( KeyValuePair < int , int > x in m ) if ( x . Value == 1 ) res += x . Key ; return res ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 2 , 3 , 1 , 4 } ; int n = arr . Length ; Console . WriteLine ( findSubarraySum ( arr , n ) ) ; } }

Index/key variables: j, sum
Accumulator variables: i, j, res, sum
Iterator variables: i, j, x
Class/struct names: GFG
C# program:
using System ; class GFG { static int partitions ( int [ ] arr , int low , int high ) { int pivot = arr [ high ] , pivotloc = low , temp ; for ( int i = low ; i <= high ; i ++ ) { if ( arr [ i ] < pivot ) { temp = arr [ i ] ; arr [ i ] = arr [ pivotloc ] ; arr [ pivotloc ] = temp ; pivotloc ++ ; } } temp = arr [ high ] ; arr [ high ] = arr [ pivotloc ] ; arr [ pivotloc ] = temp ; return pivotloc ; } static int kthSmallest ( int [ ] arr , int low , int high , int k ) { int partition = partitions ( arr , low , high ) ; if ( partition == k ) return arr [ partition ] ; else if ( partition < k ) return kthSmallest ( arr , partition + 1 , high , k ) ; else return kthSmallest ( arr , low , partition - 1 , k ) ; } public static void Main ( String [ ] args ) { int [ ] array = { 10 , 4 , 5 , 8 , 6 , 11 , 26 } ; int [ ] arraycopy = { 10 , 4 , 5 , 8 , 6 , 11 , 26 } ; int kPosition = 3 ; int length = array . Length ; if ( kPosition > length ) { Console . WriteLine ( " Index ▁ out ▁ of ▁ bound " ) ; } else { Console . WriteLine ( " K - th ▁ smallest ▁ element ▁ in ▁ array ▁ : ▁ " + kthSmallest ( arraycopy , 0 , length - 1 , kPosition - 1 ) ) ; } } }

Index/key variables: high, i, partition, pivotloc
Accumulator variables: i, pivotloc
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void recaman ( int n ) { int [ ] arr = new int [ n ] ; arr [ 0 ] = 0 ; Console . Write ( arr [ 0 ] + " ▁ , " ) ; for ( int i = 1 ; i < n ; i ++ ) { int curr = arr [ i - 1 ] - i ; int j ; for ( j = 0 ; j < i ; j ++ ) { if ( ( arr [ j ] == curr ) curr < 0 ) { curr = arr [ i - 1 ] + i ; break ; } } arr [ i ] = curr ; Console . Write ( arr [ i ] + " , ▁ " ) ; } } public static void Main ( ) { int n = 17 ; recaman ( n ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class Node { public int data ; public Node left , right ; public Node ( int val ) { data = val ; left = right = null ; } } public class GFG { static int ans , lh , rh , f ; static Node k ; public static Node Root ; static int height ( Node root ) { if ( root == null ) return 0 ; int left_height = height ( root . left ) ; int right_height = height ( root . right ) ; if ( ans < 1 + left_height + right_height ) { ans = 1 + left_height + right_height ; k = root ; lh = left_height ; rh = right_height ; } return 1 + Math . Max ( left_height , right_height ) ; } static void printArray ( int [ ] ints , int len ) { int i ; if ( f == 0 ) { for ( i = len - 1 ; i >= 0 ; i -- ) { Console . Write ( ints [ i ] + " ▁ " ) ; } } else if ( f == 1 ) { for ( i = 0 ; i < len ; i ++ ) { Console . Write ( ints [ i ] + " ▁ " ) ; } } } static void printPathsRecur ( Node node , int [ ] path , int pathLen , int max ) { if ( node == null ) return ; path [ pathLen ] = node . data ; pathLen ++ ; if ( node . left == null && node . right == null ) { if ( pathLen == max && ( f == 0 f == 1 ) ) { printArray ( path , pathLen ) ; f = 2 ; } } else { printPathsRecur ( node . left , path , pathLen , max ) ; printPathsRecur ( node . right , path , pathLen , max ) ; } } static void diameter ( Node root ) { if ( root == null ) return ; ans = Int32 . MinValue ; lh = 0 ; rh = 0 ; f = 0 ; int height_of_tree = height ( root ) ; int [ ] lPath = new int [ 100 ] ; int pathlen = 0 * height_of_tree ; printPathsRecur ( k . left , lPath , pathlen , lh ) ; Console . Write ( k . data + " ▁ " ) ; int [ ] rPath = new int [ 100 ] ; f = 1 ; printPathsRecur ( k . right , rPath , pathlen , rh ) ; } static public void Main ( ) { GFG . Root = new Node ( 1 ) ; GFG . Root . left = new Node ( 2 ) ; GFG . Root . right = new Node ( 3 ) ; GFG . Root . left . left = new Node ( 4 ) ; GFG . Root . left . right = new Node ( 5 ) ; GFG . Root . left . right . left = new Node ( 6 ) ; GFG . Root . left . right . right = new Node ( 7 ) ; GFG . Root . left . left . right = new Node ( 8 ) ; GFG . Root . left . left . right . left = new Node ( 9 ) ; diameter ( Root ) ; } }

Index/key variables: i, pathLen
Accumulator variables: i, pathLen
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; using System . Collections . Generic ; class GFG { static void recaman ( int n ) { if ( n <= 0 ) return ; Console . Write ( " { 0 } , ▁ " , 0 ) ; HashSet < int > s = new HashSet < int > ( ) ; s . Add ( 0 ) ; int prev = 0 ; for ( int i = 1 ; i < n ; i ++ ) { int curr = prev - i ; if ( curr < 0 || s . Contains ( curr ) ) curr = prev + i ; s . Add ( curr ) ; Console . Write ( " { 0 } , ▁ " , curr ) ; prev = curr ; } } public static void Main ( String [ ] args ) { int n = 17 ; recaman ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int find_extra_element_index ( int [ ] arrA , int [ ] arrB ) { int extra_element = sum ( arrA ) - sum ( arrB ) ; return indexOf ( arrA , extra_element ) ; } static int sum ( int [ ] arr ) { int sum = 0 ; for ( int i = 0 ; i < arr . Length ; i ++ ) { sum += arr [ i ] ; } return sum ; } static int indexOf ( int [ ] arr , int element ) { for ( int i = 0 ; i < arr . Length ; i ++ ) { if ( arr [ i ] == element ) { return i ; } } return - 1 ; } public static void Main ( String [ ] args ) { int [ ] arrA = { 2 , 4 , 6 , 8 , 10 , 12 , 13 } ; int [ ] arrB = { 2 , 4 , 6 , 8 , 10 , 12 } ; Console . WriteLine ( find_extra_element_index ( arrA , arrB ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Linq ; using System . Collections . Generic ; class GFG { public static void findFibSubset ( int [ ] x ) { List < int > fib = new List < int > ( ) ; List < int > result = new List < int > ( ) ; int max = x . Max ( ) ; int a = 0 ; int b = 1 ; while ( b < max ) { int c = a + b ; a = b ; b = c ; fib . Add ( c ) ; } for ( int i = 0 ; i < x . Length ; i ++ ) { if ( fib . Contains ( x [ i ] ) ) { result . Add ( x [ i ] ) ; } } foreach ( int i in result ) Console . Write ( i + " ▁ " ) ; } public static void Main ( String [ ] args ) { int [ ] a = { 4 , 2 , 8 , 5 , 20 , 1 , 40 , 13 , 23 } ; findFibSubset ( a ) ; } }

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 sumOfDiv ( int x ) { int sum = 1 ; for ( int i = 2 ; i <= Math . Sqrt ( x ) ; i ++ ) { if ( x % i == 0 ) { sum += i ; if ( x / i != i ) sum += x / i ; } } return sum ; } static Boolean isAmicable ( int a , int b ) { return ( sumOfDiv ( a ) == b && sumOfDiv ( b ) == a ) ; } static int countPairs ( int [ ] arr , int n ) { HashSet < int > s = new HashSet < int > ( ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) s . Add ( arr [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . Contains ( sumOfDiv ( arr [ i ] ) ) ) { int sum = sumOfDiv ( arr [ i ] ) ; if ( isAmicable ( arr [ i ] , sum ) ) count ++ ; } } return count / 2 ; } public static void Main ( String [ ] args ) { int [ ] arr1 = { 220 , 284 , 1184 , 1210 , 2 , 5 } ; int n1 = arr1 . Length ; Console . WriteLine ( countPairs ( arr1 , n1 ) ) ; int [ ] arr2 = { 2620 , 2924 , 5020 , 5564 , 6232 , 6368 } ; int n2 = arr2 . Length ; Console . WriteLine ( countPairs ( arr2 , n2 ) ) ; } }

Index/key variables: i
Accumulator variables: count, i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System . Collections . Generic ; using System ; class GFG { static int minimumDeletion ( string s , int n ) { Dictionary < char , int > countMap = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( countMap . ContainsKey ( s [ i ] ) == true ) { countMap [ s [ i ] ] += 1 ; } else { countMap [ s [ i ] ] = 1 ; } } List < int > countMultiset = new List < int > ( ) ; foreach ( var values in countMap . Values ) { countMultiset . Add ( values ) ; } countMultiset . Sort ( ) ; int ans = 100000000 ; int index = 0 ; int m = countMultiset . Count ; foreach ( var j in countMultiset ) { ans = Math . Min ( ans , n - ( m - index ) * j ) ; index ++ ; } return ans ; } public static void Main ( String [ ] args ) { string S = " geeksforgeeks " ; int N = S . Length ; Console . WriteLine ( minimumDeletion ( S , N ) ) ; } }

Index/key variables: i
Accumulator variables: i, index
Iterator variables: i, j, values
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void sortArr ( int [ ] arr , int N ) { for ( int i = 0 ; i < N ; i ++ ) { int num = arr [ i ] ; string s = num . ToString ( ) ; char [ ] temp = s . ToCharArray ( ) ; Array . Sort ( temp ) ; int st = 0 ; int ed = temp . Length - 1 ; while ( st < ed ) { char ch = temp [ st ] ; temp [ st ] = temp [ ed ] ; temp [ ed ] = ch ; st ++ ; ed -- ; } string charsStr = new string ( temp ) ; sort ( s . begin ( ) , s . end ( ) , greater < char > ( ) ) ; arr [ i ] = Int32 . Parse ( charsStr ) ; int sr = ( int ) Math . Sqrt ( arr [ i ] ) ; int a = sr * sr ; int b = ( sr + 1 ) * ( sr + 1 ) ; if ( ( arr [ i ] - a ) < ( b - arr [ i ] ) ) arr [ i ] = a ; else arr [ i ] = b ; } Array . Sort ( arr ) ; for ( int i = 0 ; i < N ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } } public static void Main ( ) { int [ ] arr = { 29 , 43 , 28 , 12 } ; int N = arr . Length ; sortArr ( arr , N ) ; } }

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