dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; public class GfG { static int preIndex = 0 ; class Node { public int data ; public Node left , right ; } static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = null ; temp . right = null ; return temp ; } static int search ( int [ ] arr , int strt , int end , int value ) { for ( int i = strt ; i <= end ; i ++ ) { if ( arr [ i ] == value ) return i ; } return - 1 ; } static Node buildTree ( int [ ] In , int [ ] pre , int inStrt , int inEnd ) { if ( inStrt > inEnd ) return null ; Node tNode = newNode ( pre [ preIndex ++ ] ) ; if ( inStrt == inEnd ) return tNode ; int inIndex = search ( In , inStrt , inEnd , tNode . data ) ; tNode . left = buildTree ( In , pre , inStrt , inIndex - 1 ) ; tNode . right = buildTree ( In , pre , inIndex + 1 , inEnd ) ; return tNode ; } static int checkPostorder ( Node node , int [ ] postOrder , int index ) { if ( node == null ) return index ; index = checkPostorder ( node . left , postOrder , index ) ; index = checkPostorder ( node . right , postOrder , index ) ; if ( node . data == postOrder [ index ] ) index ++ ; else return - 1 ; return index ; } public static void Main ( ) { int [ ] inOrder = { 4 , 2 , 5 , 1 , 3 } ; int [ ] preOrder = { 1 , 2 , 4 , 5 , 3 } ; int [ ] postOrder = { 4 , 5 , 2 , 3 , 1 } ; int len = inOrder . Length ; Node root = buildTree ( inOrder , preOrder , 0 , len - 1 ) ; int index = checkPostorder ( root , postOrder , 0 ) ; if ( index == len ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, index
Accumulator variables: i, index, preIndex
Iterator variables: i
Class/struct names: GfG, Node
C# program:
using System ; class GFG { static int isChangeable ( int [ ] notes , int n ) { int fiveCount = 0 ; int tenCount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( notes [ i ] == 5 ) fiveCount ++ ; else if ( notes [ i ] == 10 ) { if ( fiveCount > 0 ) { fiveCount -- ; tenCount ++ ; } else return 0 ; } else { if ( fiveCount > 0 && tenCount > 0 ) { fiveCount -- ; tenCount -- ; } else if ( fiveCount >= 3 ) { fiveCount -= 3 ; } else return 0 ; } } return 1 ; } public static void Main ( ) { int [ ] a = { 5 , 5 , 5 , 10 , 20 } ; int n = a . Length ; if ( isChangeable ( a , n ) > 0 ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: i
Accumulator variables: fiveCount, i, tenCount
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX = 1000 ; static bool [ , ] has = new bool [ MAX + 1 , 2 ] ; static bool search ( int X ) { if ( X >= 0 ) { if ( has [ X , 0 ] == true ) { return true ; } else { return false ; } } X = Math . Abs ( X ) ; if ( has [ X , 1 ] == true ) { return true ; } return false ; } static void insert ( int [ ] a , int n ) { for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] >= 0 ) { has [ a [ i ] , 0 ] = true ; } else { has [ Math . Abs ( a [ i ] ) , 1 ] = true ; } } } public static void Main ( ) { int [ ] a = { - 1 , 9 , - 5 , - 8 , - 5 , - 2 } ; int n = a . Length ; insert ( a , n ) ; int X = - 5 ; if ( search ( X ) == true ) { Console . WriteLine ( " Present " ) ; } else { Console . WriteLine ( " Not ▁ Present " ) ; } } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public static bool isMinHeap ( int [ ] level ) { int n = level . Length - 1 ; for ( int i = ( n / 2 - 1 ) ; i >= 0 ; i -- ) { if ( level [ i ] > level [ 2 * i + 1 ] ) { return false ; } if ( 2 * i + 2 < n ) { if ( level [ i ] > level [ 2 * i + 2 ] ) { return false ; } } } return true ; } public static void Main ( string [ ] args ) { int [ ] level = new int [ ] { 10 , 15 , 14 , 25 , 30 } ; if ( isMinHeap ( level ) ) { Console . WriteLine ( " True " ) ; } else { Console . WriteLine ( " False " ) ; } } }

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 minDelete ( int [ ] arr , int n ) { Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) if ( freq . ContainsKey ( arr [ i ] ) ) { freq [ arr [ i ] ] = freq [ arr [ i ] ] + 1 ; } else { freq . Add ( arr [ i ] , 1 ) ; } int max_freq = int . MinValue ; foreach ( KeyValuePair < int , int > entry in freq ) max_freq = Math . Max ( max_freq , entry . Value ) ; return n - max_freq + 1 ; } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 3 , 4 , 4 , 2 , 4 } ; int n = arr . Length ; Console . Write ( minDelete ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: entry, i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static int minOperation ( int [ ] arr , int n ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( m . ContainsKey ( arr [ i ] ) ) { var val = m [ arr [ i ] ] ; m . Remove ( arr [ i ] ) ; m . Add ( arr [ i ] , val + 1 ) ; } else { m . Add ( arr [ i ] , 1 ) ; } } int max_count = 0 ; HashSet < int > s = new HashSet < int > ( m . Keys ) ; foreach ( int i in s ) if ( max_count < m [ i ] ) max_count = m [ i ] ; return ( n - max_count ) ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 5 , 2 , 1 , 3 , 2 , 1 } ; int n = arr . Length ; Console . Write ( minOperation ( arr , 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 int maxDistance ( int [ ] arr , int n ) { Dictionary < int , int > map = new Dictionary < int , int > ( ) ; int max_dist = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! map . ContainsKey ( arr [ i ] ) ) map . Add ( arr [ i ] , i ) ; else max_dist = Math . Max ( max_dist , i - map [ arr [ i ] ] ) ; } return max_dist ; } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 2 , 1 , 2 , 1 , 4 , 5 , 8 , 6 , 7 , 4 , 2 } ; int n = arr . Length ; Console . WriteLine ( maxDistance ( arr , 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 checkDuplicatesWithinK ( int [ ] arr , int k ) { HashSet < int > set = new HashSet < int > ( ) ; for ( int i = 0 ; i < arr . Length ; i ++ ) { if ( set . Contains ( arr [ i ] ) ) return true ; set . Add ( arr [ i ] ) ; if ( i >= k ) set . Remove ( arr [ i - k ] ) ; } return false ; } public static void Main ( String [ ] args ) { int [ ] arr = { 10 , 5 , 3 , 4 , 3 , 5 , 6 } ; if ( checkDuplicatesWithinK ( arr , 3 ) ) 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 ; using System . Collections . Generic ; class GFG { static void findDuplicates ( int [ ] arr , int len ) { bool ifPresent = false ; List < int > al = new List < int > ( ) ; for ( int i = 0 ; i < len - 1 ; i ++ ) { for ( int j = i + 1 ; j < len ; j ++ ) { if ( arr [ i ] == arr [ j ] ) { if ( al . Contains ( arr [ i ] ) ) { break ; } else { al . Add ( arr [ i ] ) ; ifPresent = true ; } } } } if ( ifPresent == true ) { Console . Write ( " [ " + al [ 0 ] + " , ▁ " ) ; for ( int i = 1 ; i < al . Count - 1 ; i ++ ) { Console . Write ( al [ i ] + " , ▁ " ) ; } Console . Write ( al [ al . Count - 1 ] + " ] " ) ; } else { Console . Write ( " No ▁ duplicates ▁ present ▁ in ▁ arrays " ) ; } } static void Main ( ) { int [ ] arr = { 12 , 11 , 40 , 12 , 5 , 6 , 5 , 12 , 11 } ; int n = arr . Length ; findDuplicates ( arr , n ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Boolean variables: ifPresent
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class Node { public int data ; public Node left , right ; public Node ( int x ) { data = x ; left = right = null ; } public virtual bool Leaf { get { return ( left == null && right == null ) ; } } } class GFG { public static bool isSame ( Node root1 , Node root2 ) { Stack < Node > s1 = new Stack < Node > ( ) ; Stack < Node > s2 = new Stack < Node > ( ) ; s1 . Push ( root1 ) ; s2 . Push ( root2 ) ; while ( s1 . Count > 0 s2 . Count > 0 ) { if ( s1 . Count == 0 s2 . Count == 0 ) { return false ; } Node temp1 = s1 . Pop ( ) ; while ( temp1 != null && ! temp1 . Leaf ) { if ( temp1 . right != null ) { s1 . Push ( temp1 . right ) ; } if ( temp1 . left != null ) { s1 . Push ( temp1 . left ) ; } temp1 = s1 . Pop ( ) ; } Node temp2 = s2 . Pop ( ) ; while ( temp2 != null && ! temp2 . Leaf ) { if ( temp2 . right != null ) { s2 . Push ( temp2 . right ) ; } if ( temp2 . left != null ) { s2 . Push ( temp2 . left ) ; } temp2 = s2 . Pop ( ) ; } if ( temp1 == null && temp2 != null ) { return false ; } if ( temp1 != null && temp2 == null ) { return false ; } if ( temp1 != null && temp2 != null ) { if ( temp1 . data != temp2 . data ) { return false ; } } } return true ; } public static void Main ( string [ ] args ) { Node root1 = new Node ( 1 ) ; root1 . left = new Node ( 2 ) ; root1 . right = new Node ( 3 ) ; root1 . left . left = new Node ( 4 ) ; root1 . right . left = new Node ( 6 ) ; root1 . right . right = new Node ( 7 ) ; Node root2 = new Node ( 0 ) ; root2 . left = new Node ( 1 ) ; root2 . right = new Node ( 5 ) ; root2 . left . right = new Node ( 4 ) ; root2 . right . left = new Node ( 6 ) ; root2 . right . right = new Node ( 7 ) ; if ( isSame ( root1 , root2 ) ) { Console . WriteLine ( " Same " ) ; } else { Console . WriteLine ( " Not ▁ Same " ) ; } } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int mostFrequent ( int [ ] arr , int n ) { Array . Sort ( arr ) ; int max_count = 1 , res = arr [ 0 ] ; int curr_count = 1 ; for ( int i = 1 ; i < n ; i ++ ) { if ( arr [ i ] == arr [ i - 1 ] ) curr_count ++ ; else { if ( curr_count > max_count ) { max_count = curr_count ; res = arr [ i - 1 ] ; } curr_count = 1 ; } } if ( curr_count > max_count ) { max_count = curr_count ; res = arr [ n - 1 ] ; } return res ; } public static void Main ( ) { int [ ] arr = { 1 , 5 , 2 , 1 , 3 , 2 , 1 } ; int n = arr . Length ; Console . WriteLine ( mostFrequent ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: curr_count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int mostFrequent ( int [ ] arr , int n ) { Dictionary < int , int > hp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int key = arr [ i ] ; if ( hp . ContainsKey ( key ) ) { int freq = hp [ key ] ; freq ++ ; hp [ key ] = freq ; } else hp . Add ( key , 1 ) ; } int min_count = 0 , res = - 1 ; foreach ( KeyValuePair < int , int > pair in hp ) { if ( min_count < pair . Value ) { res = pair . Key ; min_count = pair . Value ; } } return res ; } static void Main ( ) { int [ ] arr = new int [ ] { 1 , 5 , 2 , 1 , 3 , 2 , 1 } ; int n = arr . Length ; Console . Write ( mostFrequent ( arr , n ) ) ; } }

Index/key variables: i, key
Accumulator variables: freq, i
Iterator variables: i, pair
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GfG { static void smallestSubsegment ( int [ ] a , int n ) { Dictionary < int , int > left = new Dictionary < int , int > ( ) ; Dictionary < int , int > count = new Dictionary < int , int > ( ) ; int mx = 0 ; int mn = - 1 , strindex = - 1 ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; if ( ! count . ContainsKey ( x ) ) { left . Add ( x , i ) ; count . Add ( x , 1 ) ; } else count [ x ] = count [ x ] + 1 ; if ( count [ x ] > mx ) { mx = count [ x ] ; mn = i - left [ x ] + 1 ; strindex = left [ x ] ; } else if ( ( count [ x ] == mx ) && ( i - left [ x ] + 1 < mn ) ) { mn = i - left [ x ] + 1 ; strindex = left [ x ] ; } } for ( int i = strindex ; i < strindex + mn ; i ++ ) Console . Write ( a [ i ] + " ▁ " ) ; } public static void Main ( String [ ] args ) { int [ ] A = { 1 , 2 , 2 , 2 , 1 } ; int n = A . Length ; smallestSubsegment ( A , n ) ; } }

Index/key variables: i, x
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; using System . Collections . Generic ; public class SymmetricPairs { static void findSymPairs ( int [ , ] arr ) { Dictionary < int , int > hM = new Dictionary < int , int > ( ) ; int val = 0 ; for ( int i = 0 ; i < arr . GetLength ( 0 ) ; i ++ ) { int first = arr [ i , 0 ] ; int sec = arr [ i , 1 ] ; if ( hM . ContainsKey ( sec ) ) val = hM [ sec ] ; if ( val != 0 && val == first ) Console . WriteLine ( " ( " + sec + " , ▁ " + first + " ) " ) ; else hM . Add ( first , sec ) ; } } public static void Main ( String [ ] arg ) { int [ , ] arr = new int [ 5 , 2 ] ; arr [ 0 , 0 ] = 11 ; arr [ 0 , 1 ] = 20 ; arr [ 1 , 0 ] = 30 ; arr [ 1 , 1 ] = 40 ; arr [ 2 , 0 ] = 5 ; arr [ 2 , 1 ] = 10 ; arr [ 3 , 0 ] = 40 ; arr [ 3 , 1 ] = 30 ; arr [ 4 , 0 ] = 10 ; arr [ 4 , 1 ] = 5 ; findSymPairs ( arr ) ; } }

Index/key variables: sec
Accumulator variables: i
Iterator variables: i
Class/struct names: SymmetricPairs
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findRepeatingNumber ( int [ ] arr , int n ) { int sq = ( int ) Math . Sqrt ( n ) ; int range = ( n / sq ) + 1 ; int [ ] count = new int [ range ] ; for ( int i = 0 ; i <= n ; i ++ ) { count [ ( arr [ i ] - 1 ) / sq ] ++ ; } int selected_block = range - 1 ; for ( int i = 0 ; i < range - 1 ; i ++ ) { if ( count [ i ] > sq ) { selected_block = i ; break ; } } Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i <= n ; i ++ ) { if ( ( ( selected_block * sq ) < arr [ i ] ) && ( arr [ i ] <= ( ( selected_block + 1 ) * sq ) ) ) { m . Add ( arr [ i ] , 1 ) ; if ( m [ arr [ i ] ] == 1 ) return arr [ i ] ; } } return - 1 ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 1 , 2 , 3 , 5 , 4 } ; int n = 5 ; Console . WriteLine ( " One ▁ of ▁ the ▁ numbers ▁ repeated ▁ in ▁ the ▁ array ▁ is : ▁ " + findRepeatingNumber ( arr , n ) ) ; } }

Index/key variables: i, range
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void groupElements ( int [ ] arr , int n ) { bool [ ] visited = new bool [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { visited [ i ] = false ; } for ( int i = 0 ; i < n ; i ++ ) { if ( ! visited [ i ] ) { Console . Write ( arr [ i ] + " ▁ " ) ; for ( int j = i + 1 ; j < n ; j ++ ) { if ( arr [ i ] == arr [ j ] ) { Console . Write ( arr [ i ] + " ▁ " ) ; visited [ j ] = true ; } } } } } public static void Main ( String [ ] args ) { int [ ] arr = { 4 , 6 , 9 , 2 , 3 , 4 , 9 , 6 , 10 , 4 } ; int n = arr . Length ; groupElements ( arr , n ) ; } }

Index/key variables: i, j, n
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void orderedGroup ( int [ ] arr ) { Dictionary < int , int > hM = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < arr . Length ; i ++ ) { int prevCount = 0 ; if ( hM . ContainsKey ( arr [ i ] ) ) prevCount = hM [ arr [ i ] ] ; if ( hM . ContainsKey ( arr [ i ] ) ) hM [ arr [ i ] ] = prevCount + 1 ; else hM . Add ( arr [ i ] , prevCount + 1 ) ; } for ( int i = 0 ; i < arr . Length ; i ++ ) { int count = 0 ; if ( hM . ContainsKey ( arr [ i ] ) ) count = hM [ arr [ i ] ] ; if ( count != 0 ) { for ( int j = 0 ; j < count ; j ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; hM . Remove ( arr [ i ] ) ; } } } public static void Main ( String [ ] args ) { int [ ] arr = { 10 , 5 , 3 , 10 , 10 , 4 , 1 , 3 } ; orderedGroup ( arr ) ; } }

Index/key variables: i
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public virtual bool aredisjoint ( int [ ] set1 , int [ ] set2 ) { for ( int i = 0 ; i < set1 . Length ; i ++ ) { for ( int j = 0 ; j < set2 . Length ; j ++ ) { if ( set1 [ i ] == set2 [ j ] ) { return false ; } } } return true ; } public static void Main ( string [ ] args ) { GFG dis = new GFG ( ) ; int [ ] set1 = new int [ ] { 12 , 34 , 11 , 9 , 3 } ; int [ ] set2 = new int [ ] { 7 , 2 , 1 , 5 } ; bool result = dis . aredisjoint ( set1 , set2 ) ; if ( result ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class disjoint1 { Boolean aredisjoint ( int [ ] set1 , int [ ] set2 ) { int i = 0 , j = 0 ; Array . Sort ( set1 ) ; Array . Sort ( set2 ) ; while ( i < set1 . Length && j < set2 . Length ) { if ( set1 [ i ] < set2 [ j ] ) i ++ ; else if ( set1 [ i ] > set2 [ j ] ) j ++ ; else return false ; } return true ; } public static void Main ( String [ ] args ) { disjoint1 dis = new disjoint1 ( ) ; int [ ] set1 = { 12 , 34 , 11 , 9 , 3 } ; int [ ] set2 = { 7 , 2 , 1 , 5 } ; Boolean result = dis . aredisjoint ( set1 , set2 ) ; if ( result ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Class/struct names: disjoint1
C# program:
using System ; using System . Collections . Generic ; public class GFG { public static bool areDisjoint ( int [ ] set1 , int [ ] set2 ) { HashSet < int > set = new HashSet < int > ( ) ; for ( int i = 0 ; i < set1 . Length ; i ++ ) { set . Add ( set1 [ i ] ) ; } for ( int i = 0 ; i < set2 . Length ; i ++ ) { if ( set . Contains ( set2 [ i ] ) ) { return false ; } } return true ; } public static void Main ( string [ ] args ) { int [ ] set1 = new int [ ] { 10 , 5 , 3 , 4 , 6 } ; int [ ] set2 = new int [ ] { 8 , 7 , 9 , 3 } ; if ( areDisjoint ( set1 , set2 ) ) { 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 ; using System . Collections . Generic ; class GFG { static int findSum ( int [ ] A , int [ ] B , int n ) { Dictionary < int , int > hash = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( hash . ContainsKey ( A [ i ] ) ) { var v = hash [ A [ i ] ] ; hash . Remove ( A [ i ] ) ; hash . Add ( A [ i ] , 1 + v ) ; } else hash . Add ( A [ i ] , 1 ) ; if ( hash . ContainsKey ( B [ i ] ) ) { var v = hash [ B [ i ] ] ; hash . Remove ( B [ i ] ) ; hash . Add ( B [ i ] , 1 + v ) ; } else hash . Add ( B [ i ] , 1 ) ; } int sum = 0 ; foreach ( KeyValuePair < int , int > entry in hash ) { if ( ( entry . Value ) == 1 ) sum += entry . Key ; } return sum ; } public static void Main ( String [ ] args ) { int [ ] A = { 5 , 4 , 9 , 2 , 3 } ; int [ ] B = { 2 , 8 , 7 , 6 , 3 } ; int n = A . Length ; Console . WriteLine ( findSum ( A , B , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: entry, i
Class/struct names: GFG
C# program:
using System ; class GFG { static void findMissing ( int [ ] a , int [ ] b , int n , int m ) { for ( int i = 0 ; i < n ; i ++ ) { int j ; for ( j = 0 ; j < m ; j ++ ) if ( a [ i ] == b [ j ] ) break ; if ( j == m ) Console . Write ( a [ i ] + " ▁ " ) ; } } public static void Main ( ) { int [ ] a = { 1 , 2 , 6 , 3 , 4 , 5 } ; int [ ] b = { 2 , 4 , 3 , 1 , 0 } ; int n = a . Length ; int m = b . Length ; findMissing ( a , b , n , m ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GfG { static void findMissing ( int [ ] a , int [ ] b , int n , int m ) { HashSet < int > s = new HashSet < int > ( ) ; for ( int i = 0 ; i < m ; i ++ ) s . Add ( b [ i ] ) ; for ( int i = 0 ; i < n ; i ++ ) if ( ! s . Contains ( a [ i ] ) ) Console . Write ( a [ i ] + " ▁ " ) ; } public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 6 , 3 , 4 , 5 } ; int [ ] b = { 2 , 4 , 3 , 1 , 0 } ; int n = a . Length ; int m = b . Length ; findMissing ( a , b , n , m ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
C# program:
using System ; class GFG { public static bool areEqual ( int [ ] arr1 , int [ ] arr2 ) { int n = arr1 . Length ; int m = arr2 . Length ; if ( n != m ) return false ; Array . Sort ( arr1 ) ; Array . Sort ( arr2 ) ; for ( int i = 0 ; i < n ; i ++ ) if ( arr1 [ i ] != arr2 [ i ] ) return false ; return true ; } public static void Main ( ) { int [ ] arr1 = { 3 , 5 , 2 , 5 , 2 } ; int [ ] arr2 = { 2 , 3 , 5 , 5 , 2 } ; if ( areEqual ( arr1 , arr2 ) ) 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 ; using System . Collections . Generic ; class GFG { static void makePermutation ( int [ ] a , int n ) { Dictionary < int , int > count = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( count . ContainsKey ( a [ i ] ) ) { count [ a [ i ] ] = count [ a [ i ] ] + 1 ; } else { count . Add ( a [ i ] , 1 ) ; } } } static int find_maximum ( int [ ] a , int n , int k ) { Dictionary < int , int > b = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; int d = Math . Min ( 1 + i , n - i ) ; if ( ! b . ContainsKey ( x ) ) b . Add ( x , d ) ; else { b [ x ] = Math . Min ( d , b [ x ] ) ; } } int ans = int . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) { int x = a [ i ] ; if ( x != k - x && b . ContainsKey ( k - x ) ) ans = Math . Min ( Math . Max ( b [ x ] , b [ k - x ] ) , ans ) ; } return ans ; } public static void Main ( String [ ] args ) { int [ ] a = { 3 , 5 , 8 , 6 , 7 } ; int K = 11 ; int n = a . Length ; Console . WriteLine ( find_maximum ( a , n , K ) ) ; } }

Index/key variables: i, x
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isProduct ( int [ ] arr , int n , int x ) { for ( int i = 0 ; i < n - 1 ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( arr [ i ] * arr [ j ] == x ) return true ; return false ; } static void Main ( ) { int [ ] arr = { 10 , 20 , 9 , 40 } ; int x = 400 ; int n = arr . Length ; if ( isProduct ( arr , n , x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; x = 190 ; if ( isProduct ( arr , n , x ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public static bool isProduct ( int [ ] arr , int n , int x ) { HashSet < int > hset = new HashSet < int > ( ) ; if ( n < 2 ) { return false ; } for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == 0 ) { if ( x == 0 ) { return true ; } else { continue ; } } if ( x % arr [ i ] == 0 ) { if ( hset . Contains ( x / arr [ i ] ) ) { return true ; } hset . Add ( arr [ i ] ) ; } } return false ; } public static void Main ( string [ ] args ) { int [ ] arr = new int [ ] { 10 , 20 , 9 , 40 } ; int x = 400 ; int n = arr . Length ; if ( isProduct ( arr , arr . Length , x ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } x = 190 ; if ( isProduct ( arr , arr . Length , x ) ) { 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 findGreatest ( int [ ] arr , int n ) { int result = - 1 ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n - 1 ; j ++ ) for ( int k = j + 1 ; k < n ; k ++ ) if ( arr [ j ] * arr [ k ] == arr [ i ] ) result = Math . Max ( result , arr [ i ] ) ; return result ; } static public void Main ( ) { int [ ] arr = { 30 , 10 , 9 , 3 , 35 } ; int n = arr . Length ; Console . WriteLine ( findGreatest ( arr , n ) ) ; } }

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