dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
public class GFG { static void printString ( String str , char ch , int count ) { int occ = 0 , i ; if ( count == 0 ) { System . out . println ( str ) ; return ; } for ( i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) == ch ) occ ++ ; if ( occ == count ) break ; } if ( i < str . length ( ) - 1 ) System . out . println ( str . substring ( i + 1 ) ) ; else System . out . println ( " Empty ▁ string " ) ; } public static void main ( String [ ] args ) { String str = " geeks ▁ for ▁ geeks " ; printString ( str , ' e ' , 2 ) ; } }

Accumulator variables: i, occ
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static boolean isVowel ( char c ) { return ( c == ' a ' c == ' A ' c == ' e ' c == ' E ' c == ' i ' c == ' I ' c == ' o ' c == ' O ' c == ' u ' c == ' U ' ) ; } static String reverseVowel ( String str ) { int i = 0 ; int j = str . length ( ) - 1 ; char [ ] str1 = str . toCharArray ( ) ; while ( i < j ) { if ( ! isVowel ( str1 [ i ] ) ) { i ++ ; continue ; } if ( ! isVowel ( str1 [ j ] ) ) { j -- ; continue ; } char t = str1 [ i ] ; str1 [ i ] = str1 [ j ] ; str1 [ j ] = t ; i ++ ; j -- ; } String str2 = String . copyValueOf ( str1 ) ; return str2 ; } public static void main ( String [ ] args ) { String str = " hello ▁ world " ; System . out . println ( reverseVowel ( str ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean isPalindrome ( String str ) { int l = 0 ; int h = str . length ( ) - 1 ; while ( h > l ) if ( str . charAt ( l ++ ) != str . charAt ( h -- ) ) return false ; return true ; } static int minRemovals ( String str ) { if ( str . charAt ( 0 ) == '') return 0 ; if ( isPalindrome ( str ) ) return 1 ; return 2 ; } public static void main ( String [ ] args ) { System . out . println ( minRemovals ( "010010" ) ) ; System . out . println ( minRemovals ( "0100101" ) ) ; } }

Accumulator variables: h, l
Class/struct names: GFG
Java program:
class GFG { static int power ( int x , int y , int p ) { int res = 1 ; x = x % p ; while ( y > 0 ) { if ( y % 2 == 1 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } static int findModuloByM ( int X , int N , int M ) { if ( N < 6 ) { String temp = " " ; for ( int i = 0 ; i < N ; i ++ ) temp = temp + ( char ) ( X + 48 ) ; int res = Integer . parseInt ( temp ) % M ; return res ; } if ( N % 2 == 0 ) { int half = findModuloByM ( X , N / 2 , M ) % M ; int res = ( half * power ( 10 , N / 2 , M ) + half ) % M ; return res ; } else { int half = findModuloByM ( X , N / 2 , M ) % M ; int res = ( half * power ( 10 , N / 2 + 1 , M ) + half * 10 + X ) % M ; return res ; } } public static void main ( String [ ] args ) { int X = 6 , N = 14 , M = 9 ; System . out . println ( findModuloByM ( X , N , M ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static class circle { double x ; double y ; double r ; public circle ( int x , int y , int r ) { this . x = x ; this . y = y ; this . r = r ; } } static boolean check ( circle C [ ] ) { double C1C2 = Math . sqrt ( ( C [ 1 ] . x - C [ 0 ] . x ) * ( C [ 1 ] . x - C [ 0 ] . x ) + ( C [ 1 ] . y - C [ 0 ] . y ) * ( C [ 1 ] . y - C [ 0 ] . y ) ) ; boolean flag = false ; if ( C1C2 < ( C [ 0 ] . r + C [ 1 ] . r ) ) { if ( ( C [ 0 ] . x + C [ 1 ] . x ) == 2 * C [ 2 ] . x && ( C [ 0 ] . y + C [ 1 ] . y ) == 2 * C [ 2 ] . y ) { flag = true ; } } return flag ; } static boolean IsFairTriplet ( circle c [ ] ) { boolean f = false ; f |= check ( c ) ; for ( int i = 0 ; i < 2 ; i ++ ) { swap ( c [ 0 ] , c [ 2 ] ) ; f |= check ( c ) ; } return f ; } static void swap ( circle circle1 , circle circle2 ) { circle temp = circle1 ; circle1 = circle2 ; circle2 = temp ; } public static void main ( String [ ] args ) { circle C [ ] = new circle [ 3 ] ; C [ 0 ] = new circle ( 0 , 0 , 8 ) ; C [ 1 ] = new circle ( 0 , 10 , 6 ) ; C [ 2 ] = new circle ( 0 , 5 , 5 ) ; if ( IsFairTriplet ( C ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Accumulator variables: f, i
Iterator variables: i
Boolean variables: f, flag
Class/struct names: GFG, circle
Java program:
import java . util . * ; class GFG { static double eccHyperbola ( double A , double B ) { double r = ( double ) B * B / A * A ; r += 1 ; return Math . sqrt ( r ) ; } public static void main ( String [ ] args ) { double A = 3.0 , B = 2.0 ; System . out . print ( eccHyperbola ( A , B ) ) ; } }

Accumulator variables: r
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static float calculateArea ( float A , float B , float C , float D ) { float S = ( A + B + C + D ) / 2 ; float area = ( float ) Math . sqrt ( ( S - A ) * ( S - B ) * ( S - C ) * ( S - D ) ) ; return area ; } public static void main ( String [ ] args ) { float A = 10 ; float B = 15 ; float C = 20 ; float D = 25 ; System . out . println ( calculateArea ( A , B , C , D ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void triangleArea ( int a , int b ) { double ratio = ( double ) b / a ; System . out . println ( ratio ) ; } public static void main ( String args [ ] ) { int a = 1 , b = 2 ; triangleArea ( a , b ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static class pair { float first , second ; pair ( float first , float second ) { this . first = first ; this . second = second ; } } static float distance ( int m , int n , int p , int q ) { return ( float ) Math . sqrt ( Math . pow ( n - m , 2 ) + Math . pow ( q - p , 2 ) * 1.0 ) ; } static void Excenters ( int x1 , int y1 , int x2 , int y2 , int x3 , int y3 ) { float a = distance ( x2 , x3 , y2 , y3 ) ; float b = distance ( x3 , x1 , y3 , y1 ) ; float c = distance ( x1 , x2 , y1 , y2 ) ; pair [ ] excenter = new pair [ 4 ] ; excenter [ 1 ] = new pair ( ( - ( a * x1 ) + ( b * x2 ) + ( c * x3 ) ) / ( - a + b + c ) , ( - ( a * y1 ) + ( b * y2 ) + ( c * y3 ) ) / ( - a + b + c ) ) ; excenter [ 2 ] = new pair ( ( ( a * x1 ) - ( b * x2 ) + ( c * x3 ) ) / ( a - b + c ) , ( ( a * y1 ) - ( b * y2 ) + ( c * y3 ) ) / ( a - b + c ) ) ; excenter [ 3 ] = new pair ( ( ( a * x1 ) + ( b * x2 ) - ( c * x3 ) ) / ( a + b - c ) , ( ( a * y1 ) + ( b * y2 ) - ( c * y3 ) ) / ( a + b - c ) ) ; for ( int i = 1 ; i <= 3 ; i ++ ) { System . out . println ( ( int ) excenter [ i ] . first + " ▁ " + ( int ) excenter [ i ] . second ) ; } } public static void main ( String [ ] args ) { int x1 , x2 , x3 , y1 , y2 , y3 ; x1 = 0 ; x2 = 3 ; x3 = 0 ; y1 = 0 ; y2 = 0 ; y3 = 4 ; Excenters ( x1 , y1 , x2 , y2 , x3 , y3 ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG, pair
Java program:
import java . util . * ; class GFG { static void findHeight ( float p1 , float p2 , float b , float c ) { float a = Math . max ( p1 , p2 ) - Math . min ( p1 , p2 ) ; float s = ( a + b + c ) / 2 ; float area = ( int ) Math . sqrt ( s * ( s - a ) * ( s - b ) * ( s - c ) ) ; float height = ( area * 2 ) / a ; System . out . print ( " Height ▁ is : ▁ " + height ) ; } public static void main ( String args [ ] ) { float p1 = 25 , p2 = 10 ; float a = 14 , b = 13 ; findHeight ( p1 , p2 , a , b ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int Icositetragonal_num ( int n ) { return ( 22 * n * n - 20 * n ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( Icositetragonal_num ( n ) ) ; n = 10 ; System . out . println ( Icositetragonal_num ( n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double area_of_circle ( int m , int n ) { int square_of_radius = ( m * n ) / 4 ; double area = ( 3.141 * square_of_radius ) ; return area ; } public static void main ( String [ ] args ) { int n = 10 ; int m = 30 ; System . out . println ( area_of_circle ( m , n ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double area ( int R ) { double base = 1.732 * R ; double height = ( 1.5 ) * R ; double area = 0.5 * base * height ; return area ; } public static void main ( String [ ] args ) { int R = 7 ; System . out . println ( area ( R ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static float circlearea ( float R ) { if ( R < 0 ) return - 1 ; float a = ( float ) ( ( 3.14 * R * R ) / 4 ) ; return a ; } public static void main ( String [ ] args ) { float R = 2 ; System . out . println ( circlearea ( R ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int countPairs ( int [ ] P , int [ ] Q , int N , int M ) { int [ ] A = new int [ 2 ] , B = new int [ 2 ] ; for ( int i = 0 ; i < N ; i ++ ) A [ P [ i ] % 2 ] ++ ; for ( int i = 0 ; i < M ; i ++ ) B [ Q [ i ] % 2 ] ++ ; return ( A [ 0 ] * B [ 0 ] + A [ 1 ] * B [ 1 ] ) ; } public static void main ( String [ ] args ) { int [ ] P = { 1 , 3 , 2 } ; int [ ] Q = { 3 , 0 } ; int N = P . length ; int M = Q . length ; System . out . print ( countPairs ( P , Q , N , M ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int countIntersections ( int n ) { return n * ( n - 1 ) / 2 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( countIntersections ( n ) ) ; } }

Class/struct names: GFG
Java program:
public class GFG { static double PI = 3.14159 ; static double areaOfTriangle ( float d ) { float c = ( float ) ( 1.618 * d ) ; float s = ( d + c + c ) / 2 ; double area = Math . sqrt ( s * ( s - c ) * ( s - c ) * ( s - d ) ) ; return 5 * area ; } static double areaOfRegPentagon ( float d ) { double cal = 4 * Math . tan ( PI / 5 ) ; double area = ( 5 * d * d ) / cal ; return area ; } static double areaOfPentagram ( float d ) { return areaOfRegPentagon ( d ) + areaOfTriangle ( d ) ; } public static void main ( String [ ] args ) { float d = 5 ; System . out . println ( areaOfPentagram ( d ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void anglequichord ( int z ) { System . out . println ( " The ▁ angle ▁ is ▁ " + z + " ▁ degrees " ) ; } public static void main ( String [ ] args ) { int z = 48 ; anglequichord ( z ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void convertToASCII ( int N ) { String num = Integer . toString ( N ) ; for ( char ch : num . toCharArray ( ) ) { System . out . print ( ch + " ▁ ( " + ( int ) ch + ")NEW_LINE"); } } public static void main ( String [ ] args ) { int N = 36 ; convertToASCII ( N ) ; } }

Iterator variables: ch
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void productExceptSelf ( int arr [ ] , int N ) { int product = 1 ; int z = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] != 0 ) product *= arr [ i ] ; if ( arr [ i ] == 0 ) z += 1 ; } int a = Math . abs ( product ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( z == 1 ) { if ( arr [ i ] != 0 ) arr [ i ] = 0 ; else arr [ i ] = product ; continue ; } else if ( z > 1 ) { arr [ i ] = 0 ; continue ; } int b = Math . abs ( arr [ i ] ) ; int curr = ( int ) Math . round ( Math . exp ( Math . log ( a ) - Math . log ( b ) ) ) ; if ( arr [ i ] < 0 && product < 0 ) arr [ i ] = curr ; else if ( arr [ i ] > 0 && product > 0 ) arr [ i ] = curr ; else arr [ i ] = - 1 * curr ; } for ( int i = 0 ; i < N ; i ++ ) { System . out . print ( arr [ i ] + " ▁ " ) ; } } public static void main ( String args [ ] ) { int arr [ ] = { 10 , 3 , 5 , 6 , 2 } ; int N = arr . length ; productExceptSelf ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, product, z
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static void singleDigitSubarrayCount ( int arr [ ] , int N ) { int res = 0 ; int count = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] <= 9 ) { count ++ ; res += count ; } else { count = 0 ; } } System . out . print ( res ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 0 , 1 , 14 , 2 , 5 } ; int N = arr . length ; singleDigitSubarrayCount ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: count, i, res
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int isPossible ( int N ) { return ( ( ( N & ( N - 1 ) ) & N ) ) ; } static void countElements ( int N ) { int count = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( isPossible ( i ) != 0 ) count ++ ; } System . out . println ( count ) ; } public static void main ( String [ ] args ) { int N = 15 ; countElements ( N ) ; } }

Accumulator variables: count, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void countElements ( int N ) { int Cur_Ele = 1 ; int Count = 0 ; while ( Cur_Ele <= N ) { Count ++ ; Cur_Ele = Cur_Ele * 2 ; } System . out . print ( N - Count ) ; } public static void main ( String [ ] args ) { int N = 15 ; countElements ( N ) ; } }

Accumulator variables: Count
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void maxAdjacent ( int [ ] arr , int N ) { Vector < Integer > res = new Vector < Integer > ( ) ; int arr_max = Integer . MIN_VALUE ; for ( int i = 1 ; i < N ; i ++ ) { arr_max = Math . max ( arr_max , Math . abs ( arr [ i - 1 ] - arr [ i ] ) ) ; } for ( int i = 1 ; i < N - 1 ; i ++ ) { int curr_max = Math . abs ( arr [ i - 1 ] - arr [ i + 1 ] ) ; int ans = Math . max ( curr_max , arr_max ) ; res . add ( ans ) ; } for ( int x : res ) System . out . print ( x + " ▁ " ) ; System . out . println ( ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 3 , 4 , 7 , 8 } ; int N = arr . length ; maxAdjacent ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i, x
Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; class GFG { static int minimumIncrement ( int arr [ ] , int N ) { if ( N % 2 != 0 ) { System . out . println ( " - 1" ) ; System . exit ( 0 ) ; } int cntEven = 0 ; int cntOdd = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 2 == 0 ) { cntEven += 1 ; } } cntOdd = N - cntEven ; return Math . abs ( cntEven - cntOdd ) / 2 ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 3 , 4 , 9 } ; int N = arr . length ; System . out . println ( minimumIncrement ( arr , N ) ) ; } }

Index/key variables: i
Accumulator variables: cntEven, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void cntWaysConsArray ( int A [ ] , int N ) { int total = 1 ; int oddArray = 1 ; for ( int i = 0 ; i < N ; i ++ ) { total = total * 3 ; if ( A [ i ] % 2 == 0 ) { oddArray *= 2 ; } } System . out . println ( total - oddArray ) ; } public static void main ( String [ ] args ) { int A [ ] = { 2 , 4 } ; int N = A . length ; cntWaysConsArray ( A , N ) ; } }

Index/key variables: i
Accumulator variables: i, oddArray
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static void countNumberHavingKthBitSet ( int N , int K ) { int numbers_rightmost_setbit_K = 0 ; for ( int i = 1 ; i <= K ; i ++ ) { int numbers_rightmost_bit_i = ( N + 1 ) / 2 ; N -= numbers_rightmost_bit_i ; if ( i == K ) { numbers_rightmost_setbit_K = numbers_rightmost_bit_i ; } } System . out . println ( numbers_rightmost_setbit_K ) ; } static public void main ( String args [ ] ) { int N = 15 ; int K = 2 ; countNumberHavingKthBitSet ( N , K ) ; } }

Accumulator variables: N, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int countSetBits ( int N ) { int count = 0 ; while ( N != 0 ) { N = N & ( N - 1 ) ; count ++ ; } return count ; } public static void main ( String [ ] args ) { int N = 4 ; int bits = countSetBits ( N ) ; System . out . println ( " Odd ▁ " + " : ▁ " + ( int ) ( Math . pow ( 2 , bits ) ) ) ; System . out . println ( " Even ▁ " + " : ▁ " + ( N + 1 - ( int ) ( Math . pow ( 2 , bits ) ) ) ) ; } }

Accumulator variables: count
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void minMoves ( int arr [ ] , int N ) { int odd_element_cnt = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( arr [ i ] % 2 != 0 ) { odd_element_cnt ++ ; } } int moves = ( odd_element_cnt ) / 2 ; if ( odd_element_cnt % 2 != 0 ) moves += 2 ; System . out . print ( moves ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 5 , 6 , 3 , 7 , 20 } ; int N = arr . length ; minMoves ( arr , N ) ; } }

Index/key variables: i
Accumulator variables: i, moves, odd_element_cnt
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static void minimumSubsetDifference ( int N ) { int blockOfSize8 = N / 8 ; String str = " ABBABAAB " ; int subsetDifference = 0 ; String partition = " " ; while ( blockOfSize8 -- > 0 ) { partition += str ; } int A [ ] = new int [ N ] ; int B [ ] = new int [ N ] ; int x = 0 , y = 0 ; for ( int i = 0 ; i < N ; i ++ ) { if ( partition . charAt ( i ) == ' A ' ) { A [ x ++ ] = ( ( i + 1 ) * ( i + 1 ) ) ; } else { B [ y ++ ] = ( ( i + 1 ) * ( i + 1 ) ) ; } } System . out . println ( subsetDifference ) ; for ( int i = 0 ; i < x ; i ++ ) System . out . print ( A [ i ] + " ▁ " ) ; System . out . println ( ) ; for ( int i = 0 ; i < y ; i ++ ) System . out . print ( B [ i ] + " ▁ " ) ; } public static void main ( String [ ] args ) { int N = 8 ; minimumSubsetDifference ( N ) ; } }

Index/key variables: N, i
Accumulator variables: blockOfSize8, i, partition, x, y
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static void findTheGreatestX ( int P , int Q ) { HashMap < Integer , Integer > divisiors = new HashMap < > ( ) ; for ( int i = 2 ; i * i <= Q ; i ++ ) { while ( Q % i == 0 && Q > 1 ) { Q /= i ; if ( divisiors . containsKey ( i ) ) { divisiors . put ( i , divisiors . get ( i ) + 1 ) ; } else { divisiors . put ( i , 1 ) ; } } } if ( Q > 1 ) if ( divisiors . containsKey ( Q ) ) { divisiors . put ( Q , divisiors . get ( Q ) + 1 ) ; } else { divisiors . put ( Q , 1 ) ; } int ans = 0 ; for ( Map . Entry < Integer , Integer > i : divisiors . entrySet ( ) ) { int frequency = i . getValue ( ) ; int temp = P ; int cur = 0 ; while ( temp % i . getKey ( ) == 0 ) { temp /= i . getKey ( ) ; cur ++ ; } if ( cur < frequency ) { ans = P ; break ; } temp = P ; for ( int j = cur ; j >= frequency ; j -- ) { temp /= i . getKey ( ) ; } ans = Math . max ( temp , ans ) ; } System . out . print ( ans ) ; } public static void main ( String [ ] args ) { int P = 10 , Q = 4 ; findTheGreatestX ( P , Q ) ; } }

Accumulator variables: Q, cur, i, j, temp
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static String checkRearrangements ( int [ ] [ ] mat , int N , int M ) { for ( int i = 0 ; i < N ; i ++ ) { for ( int j = 1 ; j < M ; j ++ ) { if ( mat [ i ] [ 0 ] != mat [ i ] [ j ] ) { return " Yes " ; } } } return " No " ; } static String nonZeroXor ( int [ ] [ ] mat , int N , int M ) { int res = 0 ; for ( int i = 0 ; i < N ; i ++ ) { res = res ^ mat [ i ] [ 0 ] ; } if ( res != 0 ) return " Yes " ; else return checkRearrangements ( mat , N , M ) ; } public static void main ( String [ ] args ) { int [ ] [ ] mat = { { 1 , 1 , 2 } , { 2 , 2 , 2 } , { 3 , 3 , 3 } } ; int N = mat . length ; int M = mat [ 0 ] . length ; System . out . print ( nonZeroXor ( mat , N , M ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int size_int = 32 ; static int functionMax ( int arr [ ] , int n ) { Vector < Integer > [ ] setBit = new Vector [ 32 + 1 ] ; for ( int i = 0 ; i < setBit . length ; i ++ ) setBit [ i ] = new Vector < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < size_int ; j ++ ) { if ( ( arr [ i ] & ( 1 << j ) ) > 0 ) setBit [ j ] . add ( i ) ; } } for ( int i = size_int ; i >= 0 ; i -- ) { if ( setBit [ i ] . size ( ) == 1 ) { swap ( arr , 0 , setBit [ i ] . get ( 0 ) ) ; break ; } } int maxAnd = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { maxAnd = maxAnd & ( ~ arr [ i ] ) ; } return maxAnd ; } static int [ ] swap ( int [ ] arr , int i , int j ) { int temp = arr [ i ] ; arr [ i ] = arr [ j ] ; arr [ j ] = temp ; return arr ; } public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 4 , 8 , 16 } ; int n = arr . length ; System . out . print ( functionMax ( arr , n ) ) ; } }

Index/key variables: i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int nCr ( int n , int r ) { int res = 1 ; if ( r > n - r ) r = n - r ; for ( int i = 0 ; i < r ; ++ i ) { res *= ( n - i ) ; res /= ( i + 1 ) ; } return res ; } static int solve ( int n , int m , int k ) { int sum = 0 ; for ( int i = 0 ; i <= k ; i ++ ) sum += nCr ( n , i ) * nCr ( m , k - i ) ; return sum ; } public static void main ( String [ ] args ) { int n = 3 , m = 2 , k = 2 ; System . out . print ( solve ( n , m , k ) ) ; } }

Accumulator variables: i, res, sum
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static int powerOptimised ( int a , int n ) { int ans = 1 ; while ( n > 0 ) { int last_bit = ( n & 1 ) ; if ( last_bit > 0 ) { ans = ans * a ; } a = a * a ; n = n >> 1 ; } return ans ; } public static void main ( String [ ] args ) { int a = 3 , n = 5 ; System . out . print ( powerOptimised ( a , n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int findMaximumGcd ( int n ) { int max_gcd = 1 ; for ( int i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { if ( i > max_gcd ) max_gcd = i ; if ( ( n / i != i ) && ( n / i != n ) && ( ( n / i ) > max_gcd ) ) max_gcd = n / i ; } } return max_gcd ; } public static void main ( String [ ] args ) { int N = 10 ; System . out . print ( findMaximumGcd ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int x = 2000021 ; static int [ ] v = new int [ x ] ; static void sieve ( ) { v [ 1 ] = 1 ; for ( int i = 2 ; i < x ; i ++ ) v [ i ] = i ; for ( int i = 4 ; i < x ; i += 2 ) v [ i ] = 2 ; for ( int i = 3 ; i * i < x ; i ++ ) { if ( v [ i ] == i ) { for ( int j = i * i ; j < x ; j += i ) { if ( v [ j ] == j ) { v [ j ] = i ; } } } } } static int prime_factors ( int n ) { HashSet < Integer > s = new HashSet < Integer > ( ) ; while ( n != 1 ) { s . add ( v [ n ] ) ; n = n / v [ n ] ; } return s . size ( ) ; } static void distinctPrimes ( int m , int k ) { Vector < Integer > result = new Vector < Integer > ( ) ; for ( int i = 14 ; i < m + k ; i ++ ) { long count = prime_factors ( i ) ; if ( count == k ) { result . add ( i ) ; } } int p = result . size ( ) ; for ( int index = 0 ; index < p - 1 ; index ++ ) { long element = result . get ( index ) ; int count = 1 , z = index ; while ( z < p - 1 && count <= k && result . get ( z ) + 1 == result . get ( z + 1 ) ) { count ++ ; z ++ ; } if ( count >= k ) System . out . print ( element + " ▁ " ) ; } } public static void main ( String [ ] args ) { sieve ( ) ; int N = 1000 , K = 3 ; distinctPrimes ( N , K ) ; } }

Index/key variables: i, j, n, x
Accumulator variables: count, i, index, j, z
Iterator variables: i, index, j
Class/struct names: GFG
Java program:
class GFG { static void print_product ( int a , int b , int c , int d ) { int prod1 = a * c ; int prod2 = b * d ; int prod3 = ( a + b ) * ( c + d ) ; int real = prod1 - prod2 ; int imag = prod3 - ( prod1 + prod2 ) ; System . out . println ( real + " ▁ + ▁ " + imag + " i " ) ; } public static void main ( String [ ] args ) { int a = 2 ; int b = 3 ; int c = 4 ; int d = 5 ; print_product ( a , b , c , d ) ; } }

Class/struct names: GFG
Java program:
class GFG { static boolean isInsolite ( int n ) { int N = n ; int sum = 0 ; int product = 1 ; while ( n != 0 ) { int r = n % 10 ; sum = sum + r * r ; product = product * r * r ; n = n / 10 ; } return ( N % sum == 0 ) && ( N % product == 0 ) ; } public static void main ( String [ ] args ) { int N = 111 ; if ( isInsolite ( N ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }

Class/struct names: GFG