dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static int countCompletePairs ( String [ ] set1 , String [ ] set2 , int n , int m ) { int result = 0 ; int [ ] con_s1 = new int [ n ] ; int [ ] con_s2 = new int [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { con_s1 [ i ] = 0 ; for ( int j = 0 ; j < set1 [ i ] . Length ; j ++ ) { con_s1 [ i ] = con_s1 [ i ] | ( 1 << ( set1 [ i ] [ j ] - ' a ' ) ) ; } } for ( int i = 0 ; i < m ; i ++ ) { con_s2 [ i ] = 0 ; for ( int j = 0 ; j < set2 [ i ] . Length ; j ++ ) { con_s2 [ i ] = con_s2 [ i ] | ( 1 << ( set2 [ i ] [ j ] - ' a ' ) ) ; } } long complete = ( 1 << 26 ) - 1 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { if ( ( con_s1 [ i ] con_s2 [ j ] ) == complete ) { result ++ ; } } } return result ; } public static void Main ( String [ ] args ) { String [ ] set1 = { " abcdefgh " , " geeksforgeeks " , " lmnopqrst " , " abc " } ; String [ ] set2 = { " ijklmnopqrstuvwxyz " , " abcdefghijklmnopqrstuvwxyz " , " defghijklmnopqrstuvwxyz " } ; int n = set1 . Length ; int m = set2 . Length ; Console . WriteLine ( countCompletePairs ( set1 , set2 , n , m ) ) ; } }

Index/key variables: i, j, m, n
Accumulator variables: i, j, result
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; public class GFG { static String encodeString ( String str ) { Dictionary < char , int > map = new Dictionary < char , int > ( ) ; String res = " " ; int i = 0 ; char ch ; for ( int j = 0 ; j < str . Length ; j ++ ) { ch = str [ j ] ; if ( ! map . ContainsKey ( ch ) ) map . Add ( ch , i ++ ) ; res += map [ ch ] ; } return res ; } static void findMatchedWords ( String [ ] dict , String pattern ) { int len = pattern . Length ; String hash = encodeString ( pattern ) ; foreach ( String word in dict ) { if ( word . Length == len && encodeString ( word ) . Equals ( hash ) ) Console . Write ( word + " ▁ " ) ; } } public static void Main ( String [ ] args ) { String [ ] dict = { " abb " , " abc " , " xyz " , " xyy " } ; String pattern = " foo " ; findMatchedWords ( dict , pattern ) ; } }

Index/key variables: ch, j
Accumulator variables: i, j, res
Iterator variables: j, word
Class/struct names: GFG
C# program:
using System ; using System . Collections ; using System . Collections . Generic ; class GFG { static bool check ( string pattern , string word ) { if ( pattern . Length != word . Length ) return false ; int [ ] ch = new int [ 128 ] ; int Len = word . Length ; for ( int i = 0 ; i < Len ; i ++ ) { if ( ch [ ( int ) pattern [ i ] ] == 0 ) { ch [ ( int ) pattern [ i ] ] = word [ i ] ; } else if ( ch [ ( int ) pattern [ i ] ] != word [ i ] ) { return false ; } } return true ; } static void findMatchedWords ( HashSet < string > dict , string pattern ) { int Len = pattern . Length ; string result = " ▁ " ; foreach ( string word in dict ) { if ( check ( pattern , word ) ) { result = word + " ▁ " + result ; } } Console . Write ( result ) ; } static void Main ( ) { HashSet < string > dict = new HashSet < string > ( new string [ ] { " abb " , " abc " , " xyz " , " xyy " } ) ; string pattern = " foo " ; findMatchedWords ( dict , pattern ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, word
Class/struct names: GFG
C# program:
using System ; public class GFG { static int countWords ( String str ) { if ( str == null ) { return 0 ; } int wordCount = 0 ; bool isWord = false ; int endOfLine = str . Length - 1 ; char [ ] ch = str . ToCharArray ( ) ; for ( int i = 0 ; i < ch . Length ; i ++ ) { if ( Char . IsLetter ( ch [ i ] ) && i != endOfLine ) { isWord = true ; } else if ( ! Char . IsLetter ( ch [ i ] ) && isWord ) { wordCount ++ ; isWord = false ; } else if ( Char . IsLetter ( ch [ i ] ) && i == endOfLine ) { wordCount ++ ; } } return wordCount ; } static public void Main ( ) { string str = " One ▁ two TABSYMBOL three STRNEWLINE ▁ four TABSYMBOL five ▁ " ; Console . WriteLine ( " No ▁ of ▁ words ▁ : ▁ " + countWords ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i, wordCount
Iterator variables: i
Boolean variables: isWord
Class/struct names: GFG
C# program:
using System ; class GFG { public static String [ ] RevString ( String [ ] s , int l ) { if ( l % 2 == 0 ) { int j = l / 2 ; while ( j <= l - 1 ) { String temp ; temp = s [ l - j - 1 ] ; s [ l - j - 1 ] = s [ j ] ; s [ j ] = temp ; j += 1 ; } } else { int j = ( l / 2 ) + 1 ; while ( j <= l - 1 ) { String temp ; temp = s [ l - j - 1 ] ; s [ l - j - 1 ] = s [ j ] ; s [ j ] = temp ; j += 1 ; } } return s ; } public static void Main ( String [ ] args ) { String s = " getting ▁ good ▁ at ▁ coding ▁ " + " needs ▁ a ▁ lot ▁ of ▁ practice " ; String [ ] words = s . Split ( " \\ s " ) ; words = RevString ( words , words . Length ) ; s = String . Join ( " ▁ " , words ) ; Console . WriteLine ( s ) ; } }

Index/key variables: j
Accumulator variables: j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printPath ( List < int > res , int nThNode , int kThNode ) { if ( kThNode > nThNode ) return ; res . Add ( kThNode ) ; for ( int i = 0 ; i < res . Count ; i ++ ) Console . Write ( res [ i ] + " ▁ " ) ; Console . Write ( " STRNEWLINE " ) ; printPath ( res , nThNode , kThNode * 2 ) ; printPath ( res , nThNode , kThNode * 2 + 1 ) ; res . RemoveAt ( res . Count - 1 ) ; } static void printPathToCoverAllNodeUtil ( int nThNode ) { List < int > res = new List < int > ( ) ; printPath ( res , nThNode , 1 ) ; } public static void Main ( String [ ] args ) { int nThNode = 7 ; printPathToCoverAllNodeUtil ( nThNode ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int getMid ( int s , int e ) { return s + ( e - s ) / 2 ; } static bool isArmstrong ( int x ) { int n = String . Join ( " " , x ) . Length ; int sum1 = 0 ; int temp = x ; while ( temp > 0 ) { int digit = temp % 10 ; sum1 += ( int ) Math . Pow ( digit , n ) ; temp /= 10 ; } if ( sum1 == x ) return true ; return false ; } static int MaxUtil ( int [ ] st , int ss , int se , int l , int r , int node ) { if ( l <= ss && r >= se ) return st [ node ] ; if ( se < l ss > r ) return - 1 ; int mid = getMid ( ss , se ) ; return Math . Max ( MaxUtil ( st , ss , mid , l , r , 2 * node ) , MaxUtil ( st , mid + 1 , se , l , r , 2 * node + 1 ) ) ; } static void updateValue ( int [ ] arr , int [ ] st , int ss , int se , int index , int value , int node ) { if ( index < ss index > se ) { Console . Write ( " Invalid ▁ Input " + " STRNEWLINE " ) ; return ; } if ( ss == se ) { arr [ index ] = value ; if ( isArmstrong ( value ) ) st [ node ] = value ; else st [ node ] = - 1 ; } else { int mid = getMid ( ss , se ) ; if ( index >= ss && index <= mid ) updateValue ( arr , st , ss , mid , index , value , 2 * node ) ; else updateValue ( arr , st , mid + 1 , se , index , value , 2 * node + 1 ) ; st [ node ] = Math . Max ( st [ 2 * node + 1 ] , st [ 2 * node + 2 ] ) ; } return ; } static int getMax ( int [ ] st , int n , int l , int r ) { if ( l < 0 r > n - 1 l > r ) { Console . Write ( " Invalid ▁ Input " ) ; return - 1 ; } return MaxUtil ( st , 0 , n - 1 , l , r , 0 ) ; } static int constructSTUtil ( int [ ] arr , int ss , int se , int [ ] st , int si ) { if ( ss == se ) { if ( isArmstrong ( arr [ ss ] ) ) st [ si ] = arr [ ss ] ; else st [ si ] = - 1 ; return st [ si ] ; } int mid = getMid ( ss , se ) ; st [ si ] = Math . Max ( constructSTUtil ( arr , ss , mid , st , si * 2 ) , constructSTUtil ( arr , mid + 1 , se , st , si * 2 + 1 ) ) ; return st [ si ] ; } static int [ ] constructST ( int [ ] arr , int n ) { int x = ( int ) ( Math . Ceiling ( Math . Log ( n ) ) ) ; int max_size = 2 * ( int ) Math . Pow ( 2 , x ) - 1 ; int [ ] st = new int [ max_size ] ; constructSTUtil ( arr , 0 , n - 1 , st , 0 ) ; return st ; } public static void Main ( String [ ] args ) { int [ ] arr = { 192 , 113 , 535 , 7 , 19 , 111 } ; int n = arr . Length ; int [ ] st = constructST ( arr , n ) ; Console . Write ( " Maximum ▁ armstrong ▁ " + " number ▁ in ▁ given ▁ range ▁ = ▁ " + getMax ( st , n , 1 , 3 ) + " STRNEWLINE " ) ; updateValue ( arr , st , 0 , n - 1 , 1 , 153 , 0 ) ; Console . Write ( " Updated ▁ Maximum ▁ armstrong ▁ " + " number ▁ in ▁ given ▁ range ▁ = ▁ " + getMax ( st , n , 1 , 3 ) + " STRNEWLINE " ) ; } }

Index/key variables: index, max_size, node, si, ss
Accumulator variables: sum1, temp
Class/struct names: GFG
C# program:
using System ; class GFG { static void maxRegions ( int n ) { int num ; num = n * ( n + 1 ) / 2 + 1 ; Console . WriteLine ( num ) ; } public static void Main ( String [ ] args ) { int n = 10 ; maxRegions ( n ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkSolveable ( int n , int m ) { if ( n == 1 m == 1 ) Console . WriteLine ( " YES " ) ; else if ( m == 2 && n == 2 ) Console . WriteLine ( " YES " ) ; else Console . WriteLine ( " NO " ) ; } public static void Main ( ) { int n = 1 , m = 3 ; checkSolveable ( n , m ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int GCD ( int a , int b ) { if ( b == 0 ) return a ; else return GCD ( b , a % b ) ; } static void check ( int x , int y ) { if ( GCD ( x , y ) == 1 ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } public static void Main ( ) { int X = 2 , Y = 7 ; check ( X , Y ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static readonly int size = 1000001 ; static void seiveOfEratosthenes ( int [ ] prime ) { prime [ 0 ] = 1 ; prime [ 1 ] = 0 ; for ( int i = 2 ; i * i < 1000001 ; i ++ ) { if ( prime [ i ] == 0 ) { for ( int j = i * i ; j < 1000001 ; j += i ) { prime [ j ] = 1 ; } } } } static float probabiltyEuler ( int [ ] prime , int L , int R , int M ) { int [ ] arr = new int [ size ] ; int [ ] eulerTotient = new int [ size ] ; int count = 0 ; for ( int i = L ; i <= R ; i ++ ) { eulerTotient [ i - L ] = i ; arr [ i - L ] = i ; } for ( int i = 2 ; i < 1000001 ; i ++ ) { if ( prime [ i ] == 0 ) { for ( int j = ( L / i ) * i ; j <= R ; j += i ) { if ( j - L >= 0 ) { eulerTotient [ j - L ] = eulerTotient [ j - L ] / i * ( i - 1 ) ; while ( arr [ j - L ] % i == 0 ) { arr [ j - L ] /= i ; } } } } } for ( int i = L ; i <= R ; i ++ ) { if ( arr [ i - L ] > 1 ) { eulerTotient [ i - L ] = ( eulerTotient [ i - L ] / arr [ i - L ] ) * ( arr [ i - L ] - 1 ) ; } } for ( int i = L ; i <= R ; i ++ ) { if ( ( eulerTotient [ i - L ] % M ) == 0 ) { count ++ ; } } return ( float ) ( 1.0 * count / ( R + 1 - L ) ) ; } public static void Main ( String [ ] args ) { int [ ] prime = new int [ size ] ; seiveOfEratosthenes ( prime ) ; int L = 1 , R = 7 , M = 3 ; Console . Write ( probabiltyEuler ( prime , L , R , M ) ) ; } }

Index/key variables: i, j, size
Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public static void findWinner ( int n , int k ) { int cnt = 0 ; if ( n == 1 ) Console . Write ( " No " ) ; else if ( ( n & 1 ) != 0 n == 2 ) Console . Write ( " Yes " ) ; else { int tmp = n ; int val = 1 ; while ( tmp > k && tmp % 2 == 0 ) { tmp /= 2 ; val *= 2 ; } for ( int i = 3 ; i <= Math . Sqrt ( tmp ) ; i ++ ) { while ( tmp % i == 0 ) { cnt ++ ; tmp /= i ; } } if ( tmp > 1 ) cnt ++ ; if ( val == n ) Console . Write ( " No " ) ; else if ( n / tmp == 2 && cnt == 1 ) Console . Write ( " No " ) ; else Console . Write ( " Yes " ) ; } } public static void Main ( string [ ] args ) { int n = 1 , k = 1 ; findWinner ( n , k ) ; } }

Accumulator variables: cnt, i, tmp, val
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void pen_hex ( long n ) { long pn = 1 ; for ( long i = 1 ; ; i ++ ) { pn = i * ( 3 * i - 1 ) / 2 ; if ( pn > n ) break ; double seqNum = ( 1 + Math . Sqrt ( 8 * pn + 1 ) ) / 4 ; if ( seqNum == ( long ) ( seqNum ) ) { Console . Write ( pn + " , ▁ " ) ; } } } public static void Main ( string [ ] args ) { long N = 1000000 ; pen_hex ( N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPal ( int [ , ] a , int n , int m ) { for ( int i = 0 ; i < n / 2 ; i ++ ) { for ( int j = 0 ; j < m - 1 ; j ++ ) { if ( a [ i , j ] != a [ n - 1 - i , m - 1 - j ] ) return false ; } } return true ; } public static void Main ( String [ ] args ) { int n = 3 , m = 3 ; int [ , ] a = { { 1 , 2 , 3 } , { 4 , 5 , 4 } , { 3 , 2 , 1 } } ; if ( isPal ( a , n , m ) ) { Console . Write ( " YES " + " STRNEWLINE " ) ; } else { Console . Write ( " NO " + " STRNEWLINE " ) ; } } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int getSum ( int n ) { int sum = 0 ; while ( n != 0 ) { sum = sum + n % 10 ; n = n / 10 ; } return sum ; } static void smallestNumber ( int N ) { int i = 1 ; while ( 1 != 0 ) { if ( getSum ( i ) == N ) { Console . Write ( i ) ; break ; } i ++ ; } } public static void Main ( String [ ] args ) { int N = 10 ; smallestNumber ( N ) ; } }

Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int reversDigits ( int num ) { int rev_num = 0 ; while ( num > 0 ) { rev_num = rev_num * 10 + num % 10 ; num = num / 10 ; } return rev_num ; } static bool isPerfectSquare ( double x ) { double sr = Math . Sqrt ( x ) ; return ( ( sr - Math . Floor ( sr ) ) == 0 ) ; } static bool isRare ( int N ) { int reverseN = reversDigits ( N ) ; if ( reverseN == N ) return false ; return isPerfectSquare ( N + reverseN ) && isPerfectSquare ( N - reverseN ) ; } public static void Main ( String [ ] args ) { int n = 65 ; if ( isRare ( n ) ) { Console . WriteLine ( " Yes " ) ; } else { Console . WriteLine ( " No " ) ; } } }

Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void calc_ans ( int l , int r ) { List < int > power2 = new List < int > ( ) , power3 = new List < int > ( ) ; int mul2 = 1 ; while ( mul2 <= r ) { power2 . Add ( mul2 ) ; mul2 *= 2 ; } int mul3 = 1 ; while ( mul3 <= r ) { power3 . Add ( mul3 ) ; mul3 *= 3 ; } List < int > power23 = new List < int > ( ) ; for ( int x = 0 ; x < power2 . Count ; x ++ ) { for ( int y = 0 ; y < power3 . Count ; y ++ ) { int mul = power2 [ x ] * power3 [ y ] ; if ( mul == 1 ) continue ; if ( mul <= r ) power23 . Add ( mul ) ; } } int ans = 0 ; foreach ( int x in power23 ) { if ( x >= l && x <= r ) ans ++ ; } Console . Write ( ans + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int l = 1 , r = 10 ; calc_ans ( l , r ) ; } }

Index/key variables: x, y
Accumulator variables: ans, mul2, mul3, x, y
Iterator variables: x, y
Class/struct names: GFG
C# program:
using System ; class GFG { static int nCr ( int n , int r ) { if ( r > n ) return 0 ; 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 countSubsequences ( int [ ] arr , int n , int k ) { int countOdd = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] % 2 == 1 ) countOdd ++ ; } int ans = nCr ( n , k ) - nCr ( countOdd , k ) ; return ans ; } public static void Main ( String [ ] args ) { int [ ] arr = { 2 , 4 } ; int K = 1 ; int N = arr . Length ; Console . WriteLine ( countSubsequences ( arr , N , K ) ) ; } }

Index/key variables: i
Accumulator variables: countOdd, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void first_digit ( int x , int y ) { int length = ( int ) ( Math . Log ( x ) / Math . Log ( y ) + 1 ) ; int first_digit = ( int ) ( x / Math . Pow ( y , length - 1 ) ) ; Console . Write ( first_digit ) ; } public static void Main ( ) { int X = 55 , Y = 3 ; first_digit ( X , Y ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void checkIfCurzonNumber ( long N ) { double powerTerm , productTerm ; powerTerm = Math . Pow ( 2 , N ) + 1 ; productTerm = 2 * N + 1 ; if ( powerTerm % productTerm == 0 ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } static public void Main ( ) { long N = 5 ; checkIfCurzonNumber ( N ) ; N = 10 ; checkIfCurzonNumber ( N ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static int minCount ( int n ) { int [ ] hasharr = { 10 , 3 , 6 , 9 , 2 , 5 , 8 , 1 , 4 , 7 } ; if ( n > 69 ) return hasharr [ n % 10 ] ; else { if ( n >= hasharr [ n % 10 ] * 7 ) return ( hasharr [ n % 10 ] ) ; else return - 1 ; } } public static void Main ( String [ ] args ) { int n = 38 ; Console . WriteLine ( minCount ( n ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static void modifiedBinaryPattern ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { if ( j == 1 j == i ) Console . Write ( 1 ) ; else Console . Write ( 0 ) ; } Console . WriteLine ( ) ; } } public static void Main ( ) { int n = 7 ; modifiedBinaryPattern ( n ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void findRealAndImag ( String s ) { int l = s . Length ; int i ; if ( s . IndexOf ( ' + ' ) != - 1 ) { i = s . IndexOf ( ' + ' ) ; } else { i = s . IndexOf ( ' - ' ) ; } String real = s . Substring ( 0 , i ) ; String imaginary = s . Substring ( i + 1 , l - i - 2 ) ; Console . WriteLine ( " Real ▁ part : ▁ " + real ) ; Console . WriteLine ( " Imaginary ▁ part : ▁ " + imaginary ) ; } public static void Main ( String [ ] args ) { String s = "3 + 4i " ; findRealAndImag ( s ) ; } }

Class/struct names: GFG
C# program:
using System ; public class GFG { static int highestPower ( int n , int k ) { int i = 0 ; int a = ( int ) Math . Pow ( n , i ) ; while ( a <= k ) { i += 1 ; a = ( int ) Math . Pow ( n , i ) ; } return i - 1 ; } static int [ ] b = new int [ 50 ] ; static int PowerArray ( int n , int k ) { while ( k > 0 ) { int t = highestPower ( n , k ) ; if ( b [ t ] > 0 ) { Console . Write ( - 1 ) ; return 0 ; } else b [ t ] = 1 ; k -= ( int ) Math . Pow ( n , t ) ; } for ( int i = 0 ; i < 50 ; i ++ ) { if ( b [ i ] > 0 ) { Console . Write ( i + " , ▁ " ) ; } } return 0 ; } public static void Main ( String [ ] args ) { int N = 3 ; int K = 40 ; PowerArray ( N , K ) ; } }

Index/key variables: i, t
Accumulator variables: i, k
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static readonly int N = 10005 ; static void SieveOfEratosthenes ( List < Boolean > composite ) { for ( int i = 0 ; i < N ; i ++ ) { composite . Insert ( i , false ) ; } for ( int p = 2 ; p * p < N ; p ++ ) { if ( ! composite [ p ] ) { for ( int i = p * 2 ; i < N ; i += p ) { composite . Insert ( i , true ) ; } } } } static int sumOfElements ( int [ ] arr , int n ) { List < Boolean > composite = new List < Boolean > ( ) ; for ( int i = 0 ; i < N ; i ++ ) composite . Add ( false ) ; SieveOfEratosthenes ( composite ) ; Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] = mp [ arr [ i ] ] + 1 ; } else { mp . Add ( arr [ i ] , 1 ) ; } int sum = 0 ; foreach ( KeyValuePair < int , int > it in mp ) { if ( composite [ it . Value ] ) { sum += ( it . Key ) ; } } return sum ; } public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 1 , 1 , 1 , 3 , 3 , 2 , 4 } ; int n = arr . Length ; Console . Write ( sumOfElements ( arr , n ) ) ; } }

Index/key variables: i, p
Accumulator variables: i, p, sum
Iterator variables: i, it, p
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void remove ( int [ ] arr , int n ) { Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( arr [ i ] ) ) { mp [ arr [ i ] ] = mp [ arr [ i ] ] + 1 ; } else { mp . Add ( arr [ i ] , 1 ) ; } } for ( int i = 0 ; i < n ; i ++ ) { if ( ( mp . ContainsKey ( arr [ i ] ) && mp [ arr [ i ] ] % 2 == 1 ) ) continue ; Console . Write ( arr [ i ] + " , ▁ " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 3 , 3 , 3 , 2 , 2 , 4 , 7 , 7 } ; int n = arr . Length ; remove ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void getmax ( int [ ] arr , int n , int x ) { int s = 0 ; for ( int i = 0 ; i < n ; i ++ ) { s = s + arr [ i ] ; } Console . WriteLine ( Math . Min ( s , x ) ) ; } static void Main ( ) { int [ ] arr = new int [ ] { 1 , 2 , 3 , 4 } ; int x = 5 ; int arr_size = arr . Length ; getmax ( arr , arr_size , x ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void shortestLength ( int n , int [ ] x , int [ ] y ) { int answer = 0 ; int i = 0 ; while ( n != 0 && i < x . Length ) { if ( x [ i ] + y [ i ] > answer ) answer = x [ i ] + y [ i ] ; i ++ ; } Console . WriteLine ( " Length ▁ - > ▁ " + answer ) ; Console . WriteLine ( " Path ▁ - > ▁ " + " ( ▁ 1 , ▁ " + answer + " ▁ ) " + " and ▁ ( ▁ " + answer + " , ▁ 1 ▁ ) " ) ; } static public void Main ( ) { int n = 4 ; int [ ] x = new int [ ] { 1 , 4 , 2 , 1 } ; int [ ] y = new int [ ] { 4 , 1 , 1 , 2 } ; shortestLength ( n , x , y ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void FindPoints ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 , int x4 , int y4 ) { int x5 = Math . Max ( x1 , x3 ) ; int y5 = Math . Max ( y1 , y3 ) ; int x6 = Math . Min ( x2 , x4 ) ; int y6 = Math . Min ( y2 , y4 ) ; if ( x5 > x6 y5 > y6 ) { Console . WriteLine ( " No ▁ intersection " ) ; return ; } Console . Write ( " ( " + x5 + " , ▁ " + y5 + " ) ▁ " ) ; Console . Write ( " ( " + x6 + " , ▁ " + y6 + " ) ▁ " ) ; int x7 = x5 ; int y7 = y6 ; Console . Write ( " ( " + x7 + " , ▁ " + y7 + " ) ▁ " ) ; int x8 = x6 ; int y8 = y5 ; Console . Write ( " ( " + x8 + " , ▁ " + y8 + " ) ▁ " ) ; } public static void Main ( ) { int x1 = 0 , y1 = 0 , x2 = 10 , y2 = 8 ; int x3 = 2 , y3 = 3 , x4 = 7 , y4 = 9 ; FindPoints ( x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public class Point { public float x , y ; public Point ( ) { x = y = 0 ; } public Point ( float a , float b ) { x = a ; y = b ; } } ; static void printCorners ( Point p , Point q , float l ) { Point a = new Point ( ) , b = new Point ( ) , c = new Point ( ) , d = new Point ( ) ; if ( p . x == q . x ) { a . x = ( float ) ( p . x - ( l / 2.0 ) ) ; a . y = p . y ; d . x = ( float ) ( p . x + ( l / 2.0 ) ) ; d . y = p . y ; b . x = ( float ) ( q . x - ( l / 2.0 ) ) ; b . y = q . y ; c . x = ( float ) ( q . x + ( l / 2.0 ) ) ; c . y = q . y ; } else if ( p . y == q . y ) { a . y = ( float ) ( p . y - ( l / 2.0 ) ) ; a . x = p . x ; d . y = ( float ) ( p . y + ( l / 2.0 ) ) ; d . x = p . x ; b . y = ( float ) ( q . y - ( l / 2.0 ) ) ; b . x = q . x ; c . y = ( float ) ( q . y + ( l / 2.0 ) ) ; c . x = q . x ; } else { float m = ( p . x - q . x ) / ( q . y - p . y ) ; float dx = ( float ) ( ( l / Math . Sqrt ( 1 + ( m * m ) ) ) * 0.5 ) ; float dy = m * dx ; a . x = p . x - dx ; a . y = p . y - dy ; d . x = p . x + dx ; d . y = p . y + dy ; b . x = q . x - dx ; b . y = q . y - dy ; c . x = q . x + dx ; c . y = q . y + dy ; } Console . Write ( ( int ) a . x + " , ▁ " + ( int ) a . y + " ▁ STRNEWLINE " + ( int ) b . x + " , ▁ " + ( int ) b . y + " STRNEWLINE " + ( int ) c . x + " , ▁ " + ( int ) c . y + " ▁ STRNEWLINE " + ( int ) d . x + " , ▁ " + ( int ) d . y + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { Point p1 = new Point ( 1 , 0 ) , q1 = new Point ( 1 , 2 ) ; printCorners ( p1 , q1 , 2 ) ; Point p = new Point ( 1 , 1 ) , q = new Point ( - 1 , - 1 ) ; printCorners ( p , q , ( float ) ( 2 * Math . Sqrt ( 2 ) ) ) ; } }

Class/struct names: GFG, Point