dhyuti-n/xlcost-variable-roles huggingface dataset:
C# program:
using System ; using System . Collections . Generic ; class GFG { public static bool solve ( String n , int l ) { if ( l < 3 ) { if ( int . Parse ( n ) % 8 == 0 ) return true ; n = reverse ( n ) ; if ( int . Parse ( n ) % 8 == 0 ) return true ; return false ; } int [ ] hash = new int [ 10 ] ; for ( int i = 0 ; i < l ; i ++ ) hash [ n [ i ] - '0' ] ++ ; for ( int i = 104 ; i < 1000 ; i += 8 ) { int dup = i ; int [ ] freq = new int [ 10 ] ; freq [ dup % 10 ] ++ ; dup = dup / 10 ; freq [ dup % 10 ] ++ ; dup = dup / 10 ; freq [ dup % 10 ] ++ ; dup = i ; if ( freq [ dup % 10 ] > hash [ dup % 10 ] ) continue ; dup = dup / 10 ; if ( freq [ dup % 10 ] > hash [ dup % 10 ] ) continue ; dup = dup / 10 ; if ( freq [ dup % 10 ] > hash [ dup % 10 ] ) continue ; return true ; } return false ; } static String reverse ( String input ) { char [ ] a = input . ToCharArray ( ) ; int l , r = 0 ; r = a . Length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return String . Join ( " " , a ) ; } public static void Main ( String [ ] args ) { String number = "31462708" ; int l = number . Length ; if ( solve ( number , l ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }

Index/key variables: i, l, r
Accumulator variables: i, l, r
Iterator variables: i, l
Class/struct names: GFG
C# program:
using System ; class GFG { static String newString ( String s , int k ) { String X = " " ; while ( s . Length > 0 ) { char temp = s [ 0 ] ; for ( int i = 1 ; i < k && i < s . Length ; i ++ ) { if ( s [ i ] < temp ) { temp = s [ i ] ; } } X = X + temp ; for ( int i = 0 ; i < k ; i ++ ) { if ( s [ i ] == temp ) { s = s . Substring ( 0 , i ) + s . Substring ( i + 1 ) ; break ; } } } return X ; } public static void Main ( String [ ] args ) { String s = " gaurang " ; int k = 3 ; Console . Write ( newString ( s , k ) ) ; } }

Index/key variables: i
Accumulator variables: 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 printInorder ( Node node ) { if ( node != null ) { printInorder ( node . left ) ; Console . Write ( node . data + " ▁ " ) ; printInorder ( node . right ) ; } } public virtual Node RemoveHalfNodes ( Node node ) { if ( node == null ) { return null ; } node . left = RemoveHalfNodes ( node . left ) ; node . right = RemoveHalfNodes ( node . right ) ; if ( node . left == null && node . right == null ) { return node ; } if ( node . left == null ) { Node new_root = node . right ; return new_root ; } if ( node . right == null ) { Node new_root = node . left ; return new_root ; } return node ; } public static void Main ( string [ ] args ) { BinaryTree tree = new BinaryTree ( ) ; Node NewRoot = null ; tree . root = new Node ( 2 ) ; tree . root . left = new Node ( 7 ) ; tree . root . right = new Node ( 5 ) ; tree . root . left . right = new Node ( 6 ) ; tree . root . left . right . left = new Node ( 1 ) ; tree . root . left . right . right = new Node ( 11 ) ; tree . root . right . right = new Node ( 9 ) ; tree . root . right . right . left = new Node ( 4 ) ; Console . WriteLine ( " the ▁ inorder ▁ traversal ▁ of ▁ tree ▁ is ▁ " ) ; tree . printInorder ( tree . root ) ; NewRoot = tree . RemoveHalfNodes ( tree . root ) ; Console . Write ( " STRNEWLINE Inorder ▁ traversal ▁ of ▁ the ▁ modified ▁ tree ▁ STRNEWLINE " ) ; tree . printInorder ( NewRoot ) ; } }

Class/struct names: BinaryTree, Node
C# program:
using System ; class GFG { public static bool isPalindromePossible ( String input ) { int len = input . Length , i ; char [ ] charStr = input . ToCharArray ( ) ; int diffCount = 0 ; char [ , ] diff = new char [ 2 , 2 ] ; for ( i = 0 ; i < len / 2 ; i ++ ) { if ( charStr [ i ] != charStr [ len - i - 1 ] ) { if ( diffCount == 2 ) return false ; diff [ diffCount , 0 ] = charStr [ i ] ; diff [ diffCount ++ , 1 ] = charStr [ len - i - 1 ] ; } } switch ( diffCount ) { case 0 : return true ; case 1 : char midChar = charStr [ i ] ; if ( len % 2 != 0 && ( diff [ 0 , 0 ] == midChar diff [ 0 , 1 ] == midChar ) ) return true ; break ; case 2 : if ( ( diff [ 0 , 0 ] == diff [ 1 , 0 ] && diff [ 0 , 1 ] == diff [ 1 , 1 ] ) || ( diff [ 0 , 0 ] == diff [ 1 , 1 ] && diff [ 0 , 1 ] == diff [ 1 , 0 ] ) ) return true ; break ; } return false ; } public static void Main ( String [ ] args ) { Console . WriteLine ( isPalindromePossible ( " bbg " ) ) ; Console . WriteLine ( isPalindromePossible ( " bdababd " ) ) ; Console . WriteLine ( isPalindromePossible ( " gcagac " ) ) ; } }

Index/key variables: i
Accumulator variables: diffCount, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class Node { static void strToBinary ( String s ) { int n = s . Length ; for ( int i = 0 ; i < n ; i ++ ) { int val = s [ i ] ; String bin = " " ; while ( val > 0 ) { if ( val % 2 == 1 ) { bin += '1' ; } else bin += '0' ; val /= 2 ; } bin = reverse ( bin ) ; Console . Write ( bin + " ▁ " ) ; } } static String reverse ( String input ) { char [ ] a = input . ToCharArray ( ) ; int l , r = 0 ; r = a . Length - 1 ; for ( l = 0 ; l < r ; l ++ , r -- ) { char temp = a [ l ] ; a [ l ] = a [ r ] ; a [ r ] = temp ; } return String . Join ( " " , a ) ; } public static void Main ( String [ ] args ) { String s = " geeks " ; strToBinary ( s ) ; } }

Index/key variables: i, l, r
Accumulator variables: bin, i, l, r, val
Iterator variables: i, l
Class/struct names: Node
C# program:
using System ; using System . Collections . Generic ; class GFG { static int binarySearch ( string [ ] arr , int low , int high , string x ) { if ( low > high ) return - 1 ; int mid = ( low + high ) / 2 ; if ( arr [ mid ] == " " ) { int left = mid - 1 ; int right = mid + 1 ; while ( true ) { if ( left < low && right > high ) return - 1 ; if ( left >= low && arr [ left ] != " " ) { mid = left ; break ; } else if ( right <= high && arr [ right ] != " " ) { mid = right ; break ; } left -- ; right ++ ; } } if ( arr [ mid ] == x ) return mid ; else if ( x . CompareTo ( arr [ mid ] ) < 0 ) return binarySearch ( arr , low , mid - 1 , x ) ; else return binarySearch ( arr , mid + 1 , high , x ) ; } static int sparseSearch ( string [ ] arr , string x , int n ) { return binarySearch ( arr , 0 , n - 1 , x ) ; } public static void Main ( string [ ] args ) { string [ ] arr = { " for " , " geeks " , " " , " " , " " , " " , " ide " , " practice " , " " , " " , " " , " quiz " } ; string x = " geeks " ; int n = x . Length ; int index = sparseSearch ( arr , x , n ) ; if ( index != - 1 ) Console . Write ( x + " ▁ found ▁ at ▁ index ▁ " + index ) ; else Console . Write ( x + " ▁ not ▁ found " ) ; } }

Index/key variables: left, mid, right
Accumulator variables: left, right
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int factorial ( int n ) { int f = 1 ; for ( int i = 1 ; i <= n ; i ++ ) f = f * i ; return f ; } static void print ( char [ ] temp ) { for ( int i = 0 ; i < temp . Length ; i ++ ) Console . Write ( temp [ i ] ) ; Console . WriteLine ( ) ; } static int calculateTotal ( char [ ] temp , int n ) { int f = factorial ( n ) ; Dictionary < char , int > hm = new Dictionary < char , int > ( ) ; for ( int i = 0 ; i < temp . Length ; i ++ ) { if ( hm . ContainsKey ( temp [ i ] ) ) hm [ temp [ i ] ] = hm [ temp [ i ] ] + 1 ; else hm . Add ( temp [ i ] , 1 ) ; } foreach ( KeyValuePair < char , int > e in hm ) { int x = e . Value ; if ( x > 1 ) { int temp5 = factorial ( x ) ; f = f / temp5 ; } } return f ; } static void nextPermutation ( char [ ] temp ) { int i ; for ( i = temp . Length - 1 ; i > 0 ; i -- ) if ( temp [ i ] > temp [ i - 1 ] ) break ; int min = i ; int j , x = temp [ i - 1 ] ; for ( j = i + 1 ; j < temp . Length ; j ++ ) if ( ( temp [ j ] < temp [ min ] ) && ( temp [ j ] > x ) ) min = j ; char temp_to_swap ; temp_to_swap = temp [ i - 1 ] ; temp [ i - 1 ] = temp [ min ] ; temp [ min ] = temp_to_swap ; Array . Sort ( temp , i , temp . Length - i ) ; print ( temp ) ; } static void printAllPermutations ( String s ) { char [ ] temp = s . ToCharArray ( ) ; Array . Sort ( temp ) ; print ( temp ) ; int total = calculateTotal ( temp , temp . Length ) ; for ( int i = 1 ; i < total ; i ++ ) nextPermutation ( temp ) ; } public static void Main ( String [ ] args ) { String s = " AAB " ; printAllPermutations ( s ) ; } }

Index/key variables: i, j, min
Accumulator variables: i, j
Iterator variables: e, i, j
Class/struct names: GFG
C# program:
using System ; class GFG { public class Node { public int data ; public Node left , right ; } ; static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = temp . right = null ; return temp ; } static void swapEveryKLevelUtil ( Node root , int level , int k ) { if ( root == null || ( root . left == null && root . right == null ) ) return ; if ( ( level + 1 ) % k == 0 ) { Node temp = root . left ; root . left = root . right ; root . right = temp ; } swapEveryKLevelUtil ( root . left , level + 1 , k ) ; swapEveryKLevelUtil ( root . right , level + 1 , k ) ; } static void swapEveryKLevel ( Node root , int k ) { swapEveryKLevelUtil ( root , 1 , k ) ; } static void inorder ( Node root ) { if ( root == null ) return ; inorder ( root . left ) ; Console . Write ( root . data + " ▁ " ) ; inorder ( root . right ) ; } public static void Main ( String [ ] args ) { Node root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 3 ) ; root . left . left = newNode ( 4 ) ; root . right . right = newNode ( 8 ) ; root . right . left = newNode ( 7 ) ; int k = 2 ; Console . WriteLine ( " Before ▁ swap ▁ node ▁ : " ) ; inorder ( root ) ; swapEveryKLevel ( root , k ) ; Console . WriteLine ( " STRNEWLINE After ▁ swap ▁ Node ▁ : " ) ; inorder ( root ) ; } }

Class/struct names: GFG, Node
C# program:
using System ; class GFG { static String printSequence ( string [ ] arr , string input ) { string output = " " ; int n = input . Length ; for ( int i = 0 ; i < n ; i ++ ) { if ( input [ i ] == ' ▁ ' ) output = output + "0" ; else { int position = input [ i ] - ' A ' ; output = output + arr [ position ] ; } } return output ; } public static void Main ( ) { string [ ] str = { "2" , "22" , "222" , "3" , "33" , "333" , "4" , "44" , "444" , "5" , "55" , "555" , "6" , "66" , "666" , "7" , "77" , "777" , "7777" , "8" , "88" , "888" , "9" , "99" , "999" , "9999" } ; string input = " GEEKSFORGEEKS " ; Console . WriteLine ( printSequence ( str , input ) ) ; } }

Index/key variables: i, position
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static int findLUSlength ( string a , string b ) { Dictionary < string , int > map = new Dictionary < string , int > ( ) ; List < string > strArr = new List < string > ( ) ; strArr . Add ( a ) ; strArr . Add ( b ) ; foreach ( string s in strArr ) { for ( int i = 0 ; i < ( 1 << s . Length ) ; i ++ ) { string t = " " ; for ( int j = 0 ; j < s . Length ; j ++ ) { if ( ( ( i >> j ) & 1 ) != 0 ) t += s [ j ] ; } if ( map . ContainsKey ( t ) ) { int value = map [ t ] + 1 ; map . Remove ( t ) ; map . Add ( t , value ) ; } else map . Add ( t , 1 ) ; } } int res = 0 ; foreach ( KeyValuePair < string , int > entry in map ) { if ( entry . Value == 1 ) res = Math . Max ( res , entry . Key . Length ) ; } return res ; } static void Main ( ) { string a = " abcdabcd " , b = " abcabc " ; Console . Write ( findLUSlength ( a , b ) ) ; } }

Index/key variables: j, t
Accumulator variables: i, j, t
Iterator variables: entry, i, j, s
Class/struct names: GFG
C# program:
using System ; class GFG { static string round ( string s , int n ) { char [ ] c = s . ToCharArray ( ) ; if ( c [ n - 1 ] == '0' ) return s ; else if ( c [ n - 1 ] == '1' c [ n - 1 ] == '2' c [ n - 1 ] == '3' c [ n - 1 ] == '4' c [ n - 1 ] == '5' ) { c [ n - 1 ] = '0' ; return new string ( c ) ; } else { c [ n - 1 ] = '0' ; for ( int i = n - 2 ; i >= 0 ; i -- ) { if ( c [ i ] == '9' ) c [ i ] = '0' ; else { int t = c [ i ] - '0' + 1 ; c [ i ] = ( char ) ( 48 + t ) ; break ; } } } string s1 = new string ( c ) ; if ( s1 [ 0 ] == '0' ) s1 = "1" + s1 ; return s1 ; } static void Main ( ) { string s = "5748965412485599999874589965999" ; int n = s . Length ; Console . WriteLine ( round ( s , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GfG { public static bool isEven ( string s1 ) { int l = s1 . Length ; bool dotSeen = false ; for ( int i = l - 1 ; i >= 0 ; i -- ) { if ( s1 [ i ] == '0' && dotSeen == false ) continue ; if ( s1 [ i ] == ' . ' ) { dotSeen = true ; continue ; } if ( ( s1 [ i ] - '0' ) % 2 == 0 ) return true ; return false ; } return false ; } public static void Main ( ) { string s1 = "100.70" ; if ( isEven ( s1 ) ) Console . WriteLine ( " Even " ) ; else Console . WriteLine ( " Odd " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Boolean variables: dotSeen
Class/struct names: GfG
C# program:
using System ; class GFG { static int minCost ( char [ ] s ) { bool [ ] alphabets = new bool [ 26 ] ; for ( int i = 0 ; i < s . Length ; i ++ ) { alphabets [ ( int ) s [ i ] - 97 ] = true ; } int count = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( alphabets [ i ] ) { count ++ ; } } return count ; } public static void Main ( String [ ] args ) { String s = " geeksforgeeks " ; Console . WriteLine ( " Total ▁ cost ▁ to ▁ construct ▁ " + s + " ▁ is ▁ " + minCost ( s . ToCharArray ( ) ) ) ; } }

Index/key variables: i
Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { public class Node { public int data ; public Node left , right ; } ; static Node newnode ( int data ) { Node node = new Node ( ) ; node . data = data ; node . left = node . right = null ; return ( node ) ; } static void pathCountUtil ( Node node , Dictionary < int , int > m , int path_len ) { if ( node == null ) return ; if ( node . left == null && node . right == null ) { if ( ! m . ContainsKey ( path_len ) ) m . Add ( path_len , 1 ) ; else m [ path_len ] = m [ path_len ] + 1 ; return ; } pathCountUtil ( node . right , m , path_len + 1 ) ; pathCountUtil ( node . left , m , path_len + 1 ) ; } static void pathCounts ( Node root ) { Dictionary < int , int > m = new Dictionary < int , int > ( ) ; pathCountUtil ( root , m , 1 ) ; foreach ( KeyValuePair < int , int > entry in m ) { Console . WriteLine ( entry . Value + " ▁ paths ▁ have ▁ length ▁ " + entry . Key ) ; } } public static void Main ( String [ ] args ) { Node root = newnode ( 8 ) ; root . left = newnode ( 5 ) ; root . right = newnode ( 4 ) ; root . left . left = newnode ( 9 ) ; root . left . right = newnode ( 7 ) ; root . right . right = newnode ( 11 ) ; root . right . right . left = newnode ( 3 ) ; pathCounts ( root ) ; } }

Index/key variables: path_len
Iterator variables: entry
Class/struct names: GFG, Node
C# program:
using System ; class GFG { static void checkingPossibility ( int [ ] a , int n , String s ) { int [ ] mark = new int [ a [ 0 ] * n ] ; int start = 0 ; int possible = 1 ; while ( start >= 0 && start < n ) { if ( s == " < " ) { if ( mark [ start ] == 0 ) { mark [ start ] = 1 ; start -= a [ start ] ; } else { possible = 0 ; break ; } } else { if ( mark [ start ] == 0 ) { mark [ start ] = 1 ; start += a [ start ] ; } else { possible = 0 ; break ; } } } if ( possible == 0 ) Console . Write ( " it ▁ stays ▁ " + " inside ▁ forever " ) ; else Console . Write ( " comes ▁ out " ) ; } public static void Main ( ) { int n = 2 ; String s = " > < " ; int [ ] a = { 1 , 2 } ; checkingPossibility ( a , n , s ) ; } }

Index/key variables: start
Accumulator variables: start
Class/struct names: GFG
C# program:
using System ; class GFG { static void removeDuplicates ( char [ ] S ) { int n = S . Length ; if ( n < 2 ) { return ; } int j = 0 ; for ( int i = 1 ; i < n ; i ++ ) { if ( S [ j ] != S [ i ] ) { j ++ ; S [ j ] = S [ i ] ; } } char [ ] A = new char [ j + 1 ] ; Array . Copy ( S , 0 , A , 0 , j + 1 ) ; Console . WriteLine ( A ) ; } public static void Main ( String [ ] args ) { char [ ] S1 = " geeksforgeeks " . ToCharArray ( ) ; removeDuplicates ( S1 ) ; char [ ] S2 = " aabcca " . ToCharArray ( ) ; removeDuplicates ( S2 ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; using System . Collections . Generic ; class GFG { static string simplify ( string path ) { List < string > v = new List < string > ( ) ; int n = path . Length ; string ans = " " ; for ( int i = 0 ; i < n ; i ++ ) { string dir = " " ; while ( i < n && path [ i ] != ' / ' ) { dir += path [ i ] ; i ++ ; } if ( dir == " . . " ) { if ( v . Count != 0 ) v . RemoveAt ( v . Count - 1 ) ; } else if ( dir == " . " dir == " " ) { } else { v . Add ( dir ) ; } } foreach ( string i in v ) { ans += " / " + i ; } if ( ans == " " ) return " / " ; return ans ; } static void Main ( ) { string str = " / a / . / b / . . / . . / c / " ; string res = simplify ( str ) ; Console . Write ( res ) ; } }

Index/key variables: i
Accumulator variables: ans, dir, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static int NO_OF_CHARS = 256 ; static int max_distinct_char ( String str , int n ) { int [ ] count = new int [ NO_OF_CHARS ] ; for ( int i = 0 ; i < n ; i ++ ) { count [ str [ i ] ] ++ ; } int max_distinct = 0 ; for ( int i = 0 ; i < NO_OF_CHARS ; i ++ ) { if ( count [ i ] != 0 ) { max_distinct ++ ; } } return max_distinct ; } static int smallesteSubstr_maxDistictChar ( String str ) { int n = str . Length ; int max_distinct = max_distinct_char ( str , n ) ; int minl = n ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { String subs = null ; if ( i < j ) subs = str . Substring ( i , str . Length - j ) ; else subs = str . Substring ( j , str . Length - i ) ; int subs_lenght = subs . Length ; int sub_distinct_char = max_distinct_char ( subs , subs_lenght ) ; if ( subs_lenght < minl && max_distinct == sub_distinct_char ) { minl = subs_lenght ; } } } return minl ; } static public void Main ( String [ ] args ) { String str = " AABBBCBB " ; int len = smallesteSubstr_maxDistictChar ( str ) ; Console . WriteLine ( " ▁ The ▁ length ▁ of ▁ the ▁ smallest ▁ substring " + " ▁ consisting ▁ of ▁ maximum ▁ distinct ▁ " + " characters ▁ : ▁ " + len ) ; } }

Index/key variables: NO_OF_CHARS, i
Accumulator variables: i, j, max_distinct
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; using System . Text ; class GFG { public static int evaluateBoolExpr ( StringBuilder s ) { int n = s . Length ; for ( int i = 0 ; i < n ; i += 2 ) { if ( i + 1 < n && i + 2 < n ) { if ( s [ i + 1 ] == ' A ' ) { if ( s [ i + 2 ] == '0' s [ i ] == 0 ) { s [ i + 2 ] = '0' ; } else { s [ i + 2 ] = '1' ; } } else if ( ( i + 1 ) < n && s [ i + 1 ] == ' B ' ) { if ( s [ i + 2 ] == '1' s [ i ] == '1' ) { s [ i + 2 ] = '1' ; } else { s [ i + 2 ] = '0' ; } } else { if ( s [ i + 2 ] == s [ i ] ) { s [ i + 2 ] = '0' ; } else { s [ i + 2 ] = '1' ; } } } } return s [ n - 1 ] - '0' ; } public static void Main ( string [ ] args ) { string s = "1C1B1B0A0" ; StringBuilder sb = new StringBuilder ( s ) ; Console . WriteLine ( evaluateBoolExpr ( sb ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class First_Repeated_char { static int FirstRepeated ( string str ) { int checker = 0 ; for ( int i = 0 ; i < str . Length ; ++ i ) { int val = ( str [ i ] - ' a ' ) ; if ( ( checker & ( 1 << val ) ) > 0 ) return i ; checker |= ( 1 << val ) ; } return - 1 ; } public static void Main ( ) { string s = " abcfdeacf " ; int i = FirstRepeated ( s ) ; if ( i != - 1 ) Console . WriteLine ( " Char ▁ = ▁ " + s [ i ] + " ▁ and ▁ Index ▁ = ▁ " + i ) ; else Console . WriteLine ( " No ▁ repeated ▁ Char " ) ; } }

Index/key variables: i
Accumulator variables: checker
Iterator variables: i
Class/struct names: First_Repeated_char
C# program:
using System ; class GFG { static String alphabets = " abcdefghijklmnopqrstuvwxyz " ; static void panLipogramChecker ( char [ ] s ) { for ( int i = 0 ; i < s . Length ; i ++ ) { s [ i ] = char . ToLower ( s [ i ] ) ; } int counter = 0 ; for ( int i = 0 ; i < 26 ; i ++ ) { int pos = find ( s , alphabets [ i ] ) ; if ( pos < 0 pos > s . Length ) counter += 1 ; } if ( counter == 0 ) Console . WriteLine ( " Pangram " ) ; else if ( counter >= 2 ) Console . WriteLine ( " Not ▁ a ▁ pangram ▁ but ▁ might ▁ a ▁ lipogram " ) ; else Console . WriteLine ( " Pangrammatic ▁ Lipogram " ) ; } static int find ( char [ ] arr , char c ) { for ( int i = 0 ; i < arr . Length ; i ++ ) { if ( c == arr [ i ] ) return 1 ; } return - 1 ; } public static void Main ( String [ ] args ) { char [ ] str = " The ▁ quick ▁ brown ▁ fox ▁ jumped ▁ over ▁ the ▁ lazy ▁ dog " . ToCharArray ( ) ; panLipogramChecker ( str ) ; str = " The ▁ quick ▁ brown ▁ fox ▁ jumps ▁ over ▁ the ▁ lazy ▁ dog " . ToCharArray ( ) ; panLipogramChecker ( str ) ; str = " The ▁ quick ▁ brown ▁ fox ▁ jum ▁ over ▁ the ▁ lazy ▁ dog " . ToCharArray ( ) ; panLipogramChecker ( str ) ; } }

Index/key variables: i
Accumulator variables: counter, i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; class GFG { static void nPermute ( char [ ] str , int n ) { Array . Sort ( str ) ; int i = 1 ; do { if ( i == n ) break ; i ++ ; } while ( next_permutation ( str ) ) ; Console . WriteLine ( String . Join ( " " , str ) ) ; } static bool next_permutation ( char [ ] p ) { for ( int a = p . Length - 2 ; a >= 0 ; -- a ) if ( p [ a ] < p [ a + 1 ] ) for ( int b = p . Length - 1 ; ; -- b ) if ( p [ b ] > p [ a ] ) { char t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; for ( ++ a , b = p . Length - 1 ; a < b ; ++ a , -- b ) { t = p [ a ] ; p [ a ] = p [ b ] ; p [ b ] = t ; } return true ; } return false ; } public static void Main ( ) { String str = " GEEKSFORGEEKS " ; int n = 100 ; nPermute ( str . ToCharArray ( ) , n ) ; } }

Index/key variables: a, b
Accumulator variables: i
Iterator variables: a, b
Class/struct names: GFG
C# program:
using System ; using System . Text ; class GFG { static void splitString ( string str ) { StringBuilder alpha = new StringBuilder ( ) ; StringBuilder num = new StringBuilder ( ) ; StringBuilder special = new StringBuilder ( ) ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( Char . IsDigit ( str [ i ] ) ) num . Append ( str [ i ] ) ; else if ( ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) || ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) ) alpha . Append ( str [ i ] ) ; else special . Append ( str [ i ] ) ; } Console . WriteLine ( alpha ) ; Console . WriteLine ( num ) ; Console . WriteLine ( special ) ; } public static void Main ( ) { string str = " geeks01 $ $ for02geeks03 ! @ ! ! " ; splitString ( str ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
C# program:
using System ; public class GFG { public static void SubString ( String str , int n ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = 1 ; j <= n - i ; j ++ ) Console . WriteLine ( str . Substring ( i , j ) ) ; } public static void Main ( ) { String str = " abcd " ; SubString ( str , str . Length ) ; } }

Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
C# program:
using System ; public class GFG { public static void printSubstrings ( String str ) { int n = str . Length ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i ; j < n ; j ++ ) { for ( int k = i ; k <= j ; k ++ ) { Console . Write ( str [ k ] ) ; } Console . WriteLine ( ) ; } } } public static void Main ( String [ ] args ) { String str = " abcd " ; printSubstrings ( str ) ; } }

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