dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; class GFG { static long mod = 1000000007 ; static long max = 1001 ; static long [ , ] nCr = new long [ 1003 , 1003 ] ; static void preComputeCoeff ( ) { for ( int i = 0 ; i < max ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { if ( j == 0 j == i ) nCr [ i , j ] = 1 ; else nCr [ i , j ] = ( nCr [ i - 1 , j - 1 ] + nCr [ i - 1 , j ] ) % mod ; } } } static long computeStringCount ( int N ) { int n = N / 2 ; long ans = 0 ; for ( int i = 2 ; i <= n ; i += 2 ) ans = ( ans + ( ( nCr [ n , i ] * nCr [ n , i / 2 ] ) % mod ) ) % mod ; return ans ; } public static void Main ( ) { preComputeCoeff ( ) ; int N = 3 ; Console . Write ( computeStringCount ( N ) ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static void countSubsequence ( string s , int n ) { int cntG = 0 , cntF = 0 , result = 0 , C = 0 ; for ( int i = 0 ; i < n ; i ++ ) { switch ( s [ i ] ) { case ' G ' : cntG ++ ; result += C ; break ; case ' F ' : cntF ++ ; C += cntG ; break ; default : continue ; } } Console . WriteLine ( result ) ; } public static void Main ( ) { string s = " GFGFG " ; int n = s . Length ; countSubsequence ( s , n ) ; } }

Index/key variables: i
Accumulator variables: C, cntF, cntG, i, result
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { static String LexicographicalMaxString ( String str ) { String mx = " " ; for ( int i = 0 ; i < str . Length ; ++ i ) { if ( mx . CompareTo ( str . Substring ( i ) ) <= 0 ) { mx = str . Substring ( i ) ; } } return mx ; } public static void Main ( ) { String str = " ababaa " ; Console . WriteLine ( LexicographicalMaxString ( str ) ) ; } }

Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string LexicographicalMaxString ( string str ) { char maxchar = ' a ' ; List < int > index = new List < int > ( ) ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] >= maxchar ) { maxchar = str [ i ] ; index . Add ( i ) ; } } string maxstring = " " ; for ( int i = 0 ; i < index . Count ; i ++ ) { if ( str . Substring ( index [ i ] ) . CompareTo ( maxstring ) > 0 ) { maxstring = str . Substring ( index [ i ] ) ; } } return maxstring ; } static public void Main ( ) { string str = " acbacbc " ; Console . Write ( LexicographicalMaxString ( str ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool checkPalin ( string word ) { int n = word . Length ; word = word . ToLower ( ) ; for ( int i = 0 ; i < n ; i ++ , n -- ) if ( word [ i ] != word [ n - 1 ] ) return false ; return true ; } static string longestPalin ( string str ) { str = str + " ▁ " ; string longestword = " " , word = " " ; int length , length1 = 0 ; for ( int i = 0 ; i < str . Length ; i ++ ) { char ch = str [ i ] ; if ( ch != ' ▁ ' ) word = word + ch ; else { length = word . Length ; if ( checkPalin ( word ) && length > length1 ) { length1 = length ; longestword = word ; } word = " " ; } } return longestword ; } public static void Main ( ) { string s = " My ▁ name ▁ is ▁ ava ▁ and ▁ i " + " ▁ love ▁ Geeksforgeeks " ; if ( longestPalin ( s ) == " " ) Console . Write ( " No ▁ Palindrome ▁ Word " ) ; else Console . Write ( longestPalin ( s ) ) ; } }

Index/key variables: i
Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCommonBase ( String Base , String s1 , String s2 ) { for ( int j = 0 ; j < s1 . Length ; ++ j ) { if ( Base [ j % Base . Length ] != s1 [ j ] ) { return false ; } } for ( int j = 0 ; j < s2 . Length ; ++ j ) { if ( Base [ j % Base . Length ] != s2 [ j ] ) { return false ; } } return true ; } static int countCommonBases ( String s1 , String s2 ) { int n1 = s1 . Length , n2 = s2 . Length ; int count = 0 ; for ( int i = 1 ; i <= Math . Min ( n1 , n2 ) ; i ++ ) { String Base = s1 . Substring ( 0 , i ) ; if ( isCommonBase ( Base , s1 , s2 ) ) { count ++ ; } } return count ; } public static void Main ( ) { String s1 = " pqrspqrs " ; String s2 = " pqrspqrspqrspqrs " ; Console . Write ( countCommonBases ( s1 , s2 ) ) ; } }

Index/key variables: j
Accumulator variables: count, i
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static string findstring ( string s ) { int n = s . Length ; string st = " " ; for ( int i = 1 ; i < n - 1 ; i ++ ) { if ( ( s [ i - 1 ] == '0' && s [ i + 1 ] == '0' ) ) { st = s . Remove ( i , 1 ) ; s = st ; i -- ; if ( i > 0 && s [ i - 1 ] == '0' ) i -- ; n = s . Length ; } } return s ; } static void Main ( ) { Console . Write ( findstring ( "100100" ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isPerfectSquareString ( string str ) { int sum = 0 ; int len = str . Length ; for ( int i = 0 ; i < len ; i ++ ) sum += ( int ) str [ i ] ; double squareRoot = Math . Sqrt ( sum ) ; double F = Math . Floor ( squareRoot ) ; return ( ( squareRoot - F ) == 0 ) ; } public static void Main ( ) { string str = " d " ; if ( isPerfectSquareString ( str ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i, sum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int find_sub ( string s , int k ) { int len = s . Length ; int lp = 0 , rp = 0 ; int ans = 0 ; int [ ] hash_char = new int [ 26 ] ; for ( ; rp < len ; rp ++ ) { hash_char [ s [ rp ] - ' a ' ] ++ ; while ( hash_char [ s [ rp ] - ' a ' ] > k ) { hash_char [ s [ lp ] - ' a ' ] -- ; lp ++ ; } ans += rp - lp + 1 ; } return ans ; } static public void Main ( ) { String S = " aaabb " ; int k = 2 ; Console . WriteLine ( find_sub ( S , k ) ) ; } }

Index/key variables: lp, rp
Accumulator variables: ans, lp, rp
Class/struct names: GFG
C# program:
using System ; class GFG { static bool is_vow ( char c ) { return ( c == ' a ' ) || ( c == ' e ' ) || ( c == ' i ' ) || ( c == ' o ' ) || ( c == ' u ' ) ; } static void removeVowels ( string str ) { Console . Write ( str [ 0 ] ) ; for ( int i = 1 ; i < str . Length ; i ++ ) if ( ( ! is_vow ( str [ i - 1 ] ) ) || ( ! is_vow ( str [ i ] ) ) ) Console . Write ( str [ i ] ) ; } static void Main ( ) { string str = " geeks ▁ for ▁ geeks " ; removeVowels ( str ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void printNumbers ( int n , int d ) { String st = " " + d ; char ch = st [ 0 ] ; for ( int i = 0 ; i < n ; i ++ ) { st = " " ; st = st + i ; if ( i == d || st . IndexOf ( ch ) >= 0 ) Console . Write ( i + " ▁ " ) ; } } public static void Main ( ) { int n = 100 , d = 5 ; printNumbers ( n , d ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Text ; using System . Collections . Generic ; class GFG { static bool transformString ( ref StringBuilder s ) { char ch = ' a ' ; if ( s . Length < 26 ) return false ; for ( int i = 0 ; i < s . Length ; i ++ ) { if ( ( int ) ch > 122 ) break ; if ( s [ i ] <= ch ) { s [ i ] = ch ; ch = ( char ) ( ( int ) ch + 1 ) ; } } if ( ch <= ' z ' ) return false ; return true ; } public static void Main ( ) { StringBuilder str = new StringBuilder ( " aaaaaaaaaaaaaaaaaaaaaaaaaa " ) ; if ( transformString ( ref str ) ) Console . WriteLine ( str + " STRNEWLINE " ) ; else Console . WriteLine ( " Not ▁ Possible " + " STRNEWLINE " ) ; } }

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 isPanDigital ( string s ) { int [ ] digits = new int [ 10 ] ; Array . Clear ( digits , 0 , 10 ) ; for ( int i = 0 ; i < s . Length ; i ++ ) digits [ s [ i ] - ( int ) '0' ] = 1 ; for ( int i = 0 ; i <= 9 ; i ++ ) if ( digits [ i ] == 0 ) return 0 ; return 1 ; } static int countPandigitalPairs ( ref List < string > v ) { int pairs = 0 ; for ( int i = 0 ; i < v . Count ; i ++ ) for ( int j = i + 1 ; j < v . Count ; j ++ ) if ( isPanDigital ( v [ i ] + v [ j ] ) == 1 ) pairs ++ ; return pairs ; } static void Main ( ) { List < string > v = new List < string > { "123567" , "098234" , "14765" , "19804" } ; Console . WriteLine ( countPandigitalPairs ( ref v ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j, pairs
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int pandigitalMask = ( ( 1 << 10 ) - 1 ) ; static void computeMaskFrequencies ( List < String > v , Dictionary < int , int > freq ) { for ( int i = 0 ; i < v . Count ; i ++ ) { int mask = 0 ; HashSet < int > digits = new HashSet < int > ( ) ; for ( int j = 0 ; j < v [ i ] . Length ; j ++ ) digits . Add ( v [ i ] [ j ] - '0' ) ; foreach ( int it in digits ) { int digit = ( it ) ; mask += ( 1 << digit ) ; } if ( freq . ContainsKey ( mask ) ) { freq [ mask ] ++ ; } else { freq . Add ( mask , 1 ) ; } } } static int pandigitalConcatenations ( Dictionary < int , int > freq ) { int ans = 0 ; for ( int i = 1 ; i <= 1023 ; i ++ ) { for ( int j = 1 ; j <= 1023 ; j ++ ) { if ( ( i j ) == pandigitalMask && freq . ContainsKey ( j ) && freq . ContainsKey ( i ) ) { if ( i == j ) ans += ( freq [ i ] * ( freq [ i ] - 1 ) ) ; else ans += ( freq [ i ] * freq [ j ] ) ; } } } return ans / 2 ; } static int countPandigitalPairs ( List < String > v ) { Dictionary < int , int > freq = new Dictionary < int , int > ( ) ; computeMaskFrequencies ( v , freq ) ; return pandigitalConcatenations ( freq ) ; } public static void Main ( String [ ] args ) { List < String > v = new List < String > ( ) ; v . Add ( "123567" ) ; v . Add ( "098234" ) ; v . Add ( "14765" ) ; v . Add ( "19804" ) ; Console . Write ( countPandigitalPairs ( v ) + " STRNEWLINE " ) ; } }

Index/key variables: i, j, mask
Accumulator variables: ans, i, j, mask
Iterator variables: i, it, j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX = 256 ; static void printPalindromePos ( String str ) { List < int > [ ] pos = new List < int > [ MAX ] ; for ( int i = 0 ; i < MAX ; i ++ ) pos [ i ] = new List < int > ( ) ; int n = str . Length ; for ( int i = 0 ; i < n ; i ++ ) pos [ str [ i ] ] . Add ( i + 1 ) ; int oddCount = 0 ; char oddChar = ( char ) 0 ; for ( int i = 0 ; i < MAX ; i ++ ) { if ( pos [ i ] . Count % 2 != 0 ) { oddCount ++ ; oddChar = ( char ) i ; } } if ( oddCount > 1 ) Console . Write ( " NO ▁ PALINDROME " ) ; for ( int i = 0 ; i < MAX ; i ++ ) { int mid = pos [ i ] . Count / 2 ; for ( int j = 0 ; j < mid ; j ++ ) Console . Write ( pos [ i ] [ j ] + " ▁ " ) ; } if ( oddCount > 0 ) { int last = pos [ oddChar ] . Count - 1 ; Console . Write ( pos [ oddChar ] [ last ] + " ▁ " ) ; pos [ oddChar ] . RemoveAt ( pos [ oddChar ] . Count - 1 ) ; } for ( int i = MAX - 1 ; i >= 0 ; i -- ) { int count = pos [ i ] . Count ; for ( int j = count / 2 ; j < count ; j ++ ) Console . Write ( pos [ i ] [ j ] + " ▁ " ) ; } } public static void Main ( String [ ] args ) { String s = " geeksgk " ; printPalindromePos ( s ) ; } }

Index/key variables: MAX, i, j, last, oddChar
Accumulator variables: i, j, oddCount
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; class GFG { static int MAX_CHAR = 26 ; public static int minChanges ( string str ) { int n = str . Length ; if ( n > MAX_CHAR ) return - 1 ; int dist_count = 0 ; int [ ] count = new int [ MAX_CHAR ] ; for ( int i = 0 ; i < MAX_CHAR ; i ++ ) count [ i ] = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( count [ str [ i ] - ' a ' ] == 0 ) dist_count ++ ; count [ str [ i ] - ' a ' ] ++ ; } return ( n - dist_count ) ; } public static void Main ( ) { string str = " aebaecedabbee " ; Console . WriteLine ( minChanges ( str ) ) ; } }

Index/key variables: MAX_CHAR, i
Accumulator variables: dist_count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public String c ; public Node next ; } ; static Node newNode ( String c ) { Node temp = new Node ( ) ; temp . c = c ; temp . next = null ; return temp ; } static String reverse_word ( String str ) { String s = " " ; for ( int i = 0 ; i < str . Length ; i ++ ) s = str [ i ] + s ; return s ; } static Node reverse ( Node head ) { Node ptr = head ; while ( ptr != null ) { ptr . c = reverse_word ( ptr . c ) ; ptr = ptr . next ; } return head ; } static void printList ( Node head ) { while ( head != null ) { Console . Write ( head . c + " ▁ " ) ; head = head . next ; } } public static void Main ( String [ ] args ) { Node head = newNode ( " Geeksforgeeks " ) ; head . next = newNode ( " a " ) ; head . next . next = newNode ( " computer " ) ; head . next . next . next = newNode ( " science " ) ; head . next . next . next . next = newNode ( " portal " ) ; head . next . next . next . next . next = newNode ( " for " ) ; head . next . next . next . next . next . next = newNode ( " geeks " ) ; Console . Write ( " List ▁ before ▁ reverse : ▁ STRNEWLINE " ) ; printList ( head ) ; head = reverse ( head ) ; Console . Write ( " STRNEWLINE STRNEWLINE List ▁ after ▁ reverse : ▁ STRNEWLINE " ) ; printList ( head ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static int numofstring ( int n , int m ) { if ( n == 1 ) return m ; if ( n == 2 ) return m * ( m - 1 ) ; return m * ( m - 1 ) * ( int ) Math . Pow ( m - 2 , n - 2 ) ; } public static void Main ( ) { int n = 2 , m = 3 ; Console . Write ( numofstring ( n , m ) ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { public static int CountSpecialPalindrome ( String str ) { int n = str . Length ; int result = 0 ; int [ ] sameChar = new int [ n ] ; for ( int v = 0 ; v < n ; v ++ ) sameChar [ v ] = 0 ; int i = 0 ; while ( i < n ) { int sameCharCount = 1 ; int j = i + 1 ; while ( j < n && str [ i ] == str [ j ] ) { sameCharCount ++ ; j ++ ; } result += ( sameCharCount * ( sameCharCount + 1 ) / 2 ) ; sameChar [ i ] = sameCharCount ; i = j ; } for ( int j = 1 ; j < n ; j ++ ) { if ( str [ j ] == str [ j - 1 ] ) sameChar [ j ] = sameChar [ j - 1 ] ; if ( j > 0 && j < ( n - 1 ) && ( str [ j - 1 ] == str [ j + 1 ] && str [ j ] != str [ j - 1 ] ) ) result += Math . Min ( sameChar [ j - 1 ] , sameChar [ j + 1 ] ) ; } return result - n ; } public static void Main ( ) { String str = " abccba " ; Console . Write ( CountSpecialPalindrome ( str ) ) ; } }

Index/key variables: i, j, n, v
Accumulator variables: j, result, sameCharCount, v
Iterator variables: j, v
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static void printBracketNumber ( string exp , int n ) { int left_bnum = 1 ; Stack < int > right_bnum = new Stack < int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( exp [ i ] == ' ( ' ) { Console . Write ( left_bnum + " ▁ " ) ; right_bnum . Push ( left_bnum ) ; left_bnum ++ ; } else if ( exp [ i ] == ' ) ' ) { Console . Write ( right_bnum . Peek ( ) + " ▁ " ) ; right_bnum . Pop ( ) ; } } } static void Main ( ) { string exp = " ( a + ( b * c ) ) + ( d / e ) " ; int n = exp . Length ; printBracketNumber ( exp , n ) ; } }

Index/key variables: i
Accumulator variables: i, left_bnum
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isCornerPresent ( string str , string corner ) { int n = str . Length ; int cl = corner . Length ; if ( n < cl ) return false ; return ( str . Substring ( 0 , cl ) . Equals ( corner ) && str . Substring ( n - cl , cl ) . Equals ( corner ) ) ; } static void Main ( ) { string str = " geeksforgeeks " ; string corner = " geeks " ; if ( isCornerPresent ( str , corner ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Class/struct names: GFG
C# program:
using System ; class GFG { static string ReverseString ( string s ) { char [ ] arr = s . ToCharArray ( ) ; Array . Reverse ( arr ) ; return new string ( arr ) ; } static void binary_conversion ( ref string s , int m ) { while ( m != 0 ) { int tmp = m % 2 ; s += tmp . ToString ( ) ; m = ( int ) ( m / 2 ) ; } s = ReverseString ( s ) ; } static int find_character ( int n , int m , int i ) { string s = " " ; binary_conversion ( ref s , m ) ; string s1 = " " ; for ( int x = 0 ; x < n ; x ++ ) { for ( int y = 0 ; y < s . Length ; y ++ ) { if ( s [ y ] == '1' ) s1 += "10" ; else s1 += "01" ; } s = s1 ; s1 = " " ; } return s [ i ] - '0' ; } static void Main ( ) { int m = 5 , n = 2 , i = 8 ; Console . Write ( find_character ( n , m , i ) ) ; } }

Index/key variables: i, y
Accumulator variables: s, s1, x, y
Iterator variables: x, y
Class/struct names: GFG
C# program:
using System ; class GFG { static int findMaxSegment ( string s , int k ) { int seg_len = s . Length - k ; int res = 0 ; for ( int i = 0 ; i < seg_len ; i ++ ) res = res * 10 + ( s [ i ] - '0' ) ; int seg_len_pow = ( int ) Math . Pow ( 10 , seg_len - 1 ) ; int curr_val = res ; for ( int i = 1 ; i <= ( s . Length - seg_len ) ; i ++ ) { curr_val = curr_val - ( s [ i - 1 ] - '0' ) * seg_len_pow ; curr_val = curr_val * 10 + ( s [ i + seg_len - 1 ] - '0' ) ; res = Math . Max ( res , curr_val ) ; } return res ; } public static void Main ( ) { String s = "8754" ; int k = 2 ; Console . WriteLine ( " Maximum ▁ number ▁ = ▁ " + findMaxSegment ( s , k ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int isConsecutive ( String str ) { int start ; int length = str . Length ; for ( int i = 0 ; i < length / 2 ; i ++ ) { String new_str = str . Substring ( 0 , i + 1 ) ; int num = int . Parse ( new_str ) ; start = num ; while ( new_str . Length < length ) { num ++ ; new_str = new_str + String . Join ( " " , num ) ; } if ( new_str . Equals ( str ) ) return start ; } return - 1 ; } public static void Main ( String [ ] args ) { String str = "99100" ; Console . WriteLine ( " String : ▁ " + str ) ; int start = isConsecutive ( str ) ; if ( start != - 1 ) Console . WriteLine ( " Yes ▁ STRNEWLINE " + start ) ; else Console . WriteLine ( " No " ) ; String str1 = "121315" ; Console . WriteLine ( " String : " start = isConsecutive ( str1 ) ; if ( start != - 1 ) Console . WriteLine ( " Yes ▁ STRNEWLINE " + start ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: i, num
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static bool isConvertible ( string str1 , string str2 , int k ) { if ( ( str1 . Length + str2 . Length ) < k ) return true ; int commonLength = 0 ; for ( int i = 0 ; i < Math . Min ( str1 . Length , str2 . Length ) ; i ++ ) { if ( str1 == str2 ) commonLength ++ ; else break ; } if ( ( k - str1 . Length - str2 . Length + 2 * commonLength ) % 2 == 0 ) return true ; return false ; } public static void Main ( ) { string str1 = " geek " ; string str2 = " geek " ; int k = 7 ; if ( isConvertible ( str1 , str2 , k ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; str1 = " geeks " ; str2 = " geek " ; k = 5 ; if ( isConvertible ( str1 , str2 , k ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Accumulator variables: commonLength, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int MAX_CHAR = 26 ; static int maxLower ( String str ) { int n = str . Length ; int i = 0 ; for ( ; i < n ; i ++ ) { if ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) { i ++ ; break ; } } int maxCount = 0 ; int [ ] count = new int [ MAX_CHAR ] ; for ( ; i < n ; i ++ ) { if ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) { int currCount = 0 ; for ( int j = 0 ; j < MAX_CHAR ; j ++ ) { if ( count [ j ] > 0 ) { currCount ++ ; } } maxCount = Math . Max ( maxCount , currCount ) ; Array . Fill ( count , 0 ) ; } if ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) { count [ str [ i ] - ' a ' ] ++ ; } } return maxCount ; } public static void Main ( String [ ] args ) { String str = " zACaAbbaazzC " ; Console . WriteLine ( maxLower ( str ) ) ; } }

Index/key variables: MAX_CHAR, i, j
Accumulator variables: currCount, i, j
Iterator variables: j
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int maxLower ( char [ ] str ) { int n = str . Length ; int i = 0 ; for ( ; i < n ; i ++ ) { if ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) { i ++ ; break ; } } int maxCount = 0 ; HashSet < int > s = new HashSet < int > ( ) ; for ( ; i < n ; i ++ ) { if ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) { maxCount = Math . Max ( maxCount , ( int ) s . Count ) ; s . Clear ( ) ; } if ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) s . Add ( ( int ) str [ i ] ) ; } return maxCount ; } public static void Main ( String [ ] args ) { String str = " zACaAbbaazzC " ; Console . WriteLine ( maxLower ( str . ToCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static char first ( string str ) { for ( int i = 0 ; i < str . Length ; i ++ ) if ( char . IsUpper ( str [ i ] ) ) return str [ i ] ; return '0' ; } public static void Main ( ) { string str = " geeksforGeeKS " ; char res = first ( str ) ; if ( res == '0' ) Console . WriteLine ( " No ▁ uppercase " + " ▁ letter " ) ; else Console . WriteLine ( res ) ; } }

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 fact ( int n ) { int ans = 1 ; for ( int i = 1 ; i <= n ; i ++ ) ans = ans * i ; return ( ans ) ; } static int numberOfPossiblePallindrome ( String str , int n ) { Dictionary < char , int > mp = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . ContainsKey ( str [ i ] ) ) { var val = mp [ str [ i ] ] ; mp . Remove ( str [ i ] ) ; mp . Add ( str [ i ] , val + 1 ) ; } else { mp . Add ( str [ i ] , 1 ) ; } } int fi ; foreach ( KeyValuePair < char , int > it in mp ) { if ( it . Value % 2 == 0 ) fi = it . Value / 2 ; else { fi = ( it . Value - 1 ) / 2 ; k ++ ; } num = num + fi ; den = den * fact ( fi ) ; } if ( num != 0 ) num = fact ( num ) ; int ans = num / den ; if ( k != 0 ) { ans = ans * k ; } return ( ans ) ; } public static void Main ( String [ ] args ) { String str = " ababab " ; int n = str . Length ; Console . WriteLine ( numberOfPossiblePallindrome ( str , n ) ) ; } }

Index/key variables: i
Accumulator variables: i, k
Iterator variables: i, it
Class/struct names: GFG
C# program:
using System ; class GFG { static int evenDecimalValue ( string str , int n ) { int result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { int decimalValue = 0 ; int powerOf2 = 1 ; for ( int k = i ; k <= j ; k ++ ) { decimalValue += ( ( str [ k ] - '0' ) * powerOf2 ) ; powerOf2 *= 2 ; } if ( decimalValue % 2 == 0 ) result ++ ; } } return result ; } public static void Main ( ) { String str = "10010" ; int n = 5 ; Console . WriteLine ( evenDecimalValue ( str , n ) ) ; } }

Index/key variables: k
Accumulator variables: decimalValue, i, j, k, powerOf2, result
Iterator variables: i, j, k
Class/struct names: GFG
C# program:
using System ; class GFG { public static void solve ( string s ) { int l = s . Length ; int x = l / 2 ; int y = l ; string p = " " ; while ( x > 0 && y > l / 2 ) { char ch = s [ x - 1 ] ; p += ch ; x -- ; ch = s [ y - 1 ] ; p += ch ; y -- ; } if ( y > l / 2 ) { char ch = s [ x - 1 ] ; p += ch ; y -- ; } Console . WriteLine ( p ) ; } public static void Main ( ) { string s = " sunshine " ; solve ( s ) ; } }

Accumulator variables: p, x, y
Class/struct names: GFG
C# program:
using System ; public class GFG { private static int recLen ( string str ) { if ( str . Equals ( " " ) ) return 0 ; else return recLen ( str . Substring ( 1 ) ) + 1 ; } public static void Main ( ) { string str = " GeeksforGeeks " ; Console . WriteLine ( recLen ( str ) ) ; } }

Class/struct names: GFG