dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int factorial ( int n ) { if ( n <= 1 ) return 1 ; return n * factorial ( n - 1 ) ; } static int nCr ( int n , int r ) { return factorial ( n ) / ( factorial ( n - r ) * factorial ( r ) ) ; } static int NumberOfWays ( int n , int x , int y ) { return nCr ( 2 * n - x - y , n - x ) * factorial ( n ) * factorial ( n ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { int n = 5 , x = 4 , y = 2 ; System . out . println ( NumberOfWays ( n , x , y ) ) ; } }

Class/struct names: GFG
Java program:
import java . lang . * ; public class Main { static long findSmallestNonZeroY ( long A_num ) { String A_binary = Long . toBinaryString ( A_num ) ; long B = 1 ; int len = A_binary . length ( ) ; int no_ones = Long . bitCount ( A_num ) ; if ( len == no_ones ) { return A_num + 1 ; } for ( int i = 0 ; i < len ; i ++ ) { char ch = A_binary . charAt ( len - i - 1 ) ; if ( ch == '0' ) { B = ( long ) Math . pow ( 2.0 , ( double ) i ) ; break ; } } return B ; } public static void main ( String [ ] args ) { long X = findSmallestNonZeroY ( 10 ) ; System . out . println ( X ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: Main
Java program:
class GFG { static int maxElement ( int a [ ] , int n ) { if ( n < 3 ) return - 1 ; int maxElement = a [ 0 ] ; int maxProd = a [ n - 1 ] * a [ 1 ] ; for ( int i = 1 ; i < n ; i ++ ) { int currProd = a [ i - 1 ] * a [ ( i + 1 ) % n ] ; if ( currProd > maxProd ) { maxProd = currProd ; maxElement = a [ i ] ; } else if ( currProd == maxProd ) { maxElement = Math . max ( maxElement , a [ i ] ) ; } } return maxElement ; } public static void main ( String [ ] args ) { int [ ] a = { 5 , 6 , 4 , 3 , 2 } ; int n = a . length ; System . out . println ( maxElement ( a , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int ncr ( int n , int r ) { int ans = 1 ; for ( int i = 1 ; i <= r ; i += 1 ) { ans *= ( n - r + i ) ; ans /= i ; } return ans ; } static int totalWays ( int X , int Y , int M , int W ) { return ( ncr ( M , X ) * ncr ( W , Y ) ) ; } public static void main ( String [ ] args ) { int X = 4 , Y = 3 , M = 6 , W = 5 ; System . out . println ( totalWays ( X , Y , M , W ) ) ; } }

Accumulator variables: ans, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void specialSieve ( int n ) { int cnt = 0 ; int prime [ ] = new int [ n + 1 ] ; for ( int i = 0 ; i <= n ; i ++ ) prime [ i ] = 0 ; for ( int i = 2 ; i <= n ; i ++ ) { if ( ! ( prime [ i ] > 0 ) ) { cnt ++ ; for ( int j = i ; j <= n ; j += i ) prime [ j ] = cnt ; } } for ( int i = 2 ; i <= n ; i ++ ) System . out . print ( prime [ i ] + " ▁ " ) ; } public static void main ( String [ ] args ) { int n = 6 ; specialSieve ( n ) ; } }

Index/key variables: i, j
Accumulator variables: cnt, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static int maximum = Integer . MIN_VALUE , x , ans = Integer . MAX_VALUE ; static Vector < Vector < Integer > > graph = new Vector < Vector < Integer > > ( ) ; static Vector < Integer > weight = new Vector < Integer > ( ) ; static int __builtin_popcount ( int x ) { int c = 0 ; for ( int i = 0 ; i < 60 ; i ++ ) if ( ( ( x >> i ) & 1 ) != 0 ) c ++ ; return c ; } static void dfs ( int node , int parent ) { int a = __builtin_popcount ( weight . get ( node ) + x ) ; if ( maximum < a ) { maximum = a ; ans = node ; } else if ( maximum == a ) ans = Math . min ( ans , node ) ; for ( int i = 0 ; i < graph . get ( node ) . size ( ) ; i ++ ) { if ( graph . get ( node ) . get ( i ) == parent ) continue ; dfs ( graph . get ( node ) . get ( i ) , node ) ; } } public static void main ( String args [ ] ) { x = 15 ; weight . add ( 0 ) ; weight . add ( 5 ) ; weight . add ( 10 ) ; ; weight . add ( 11 ) ; ; weight . add ( 8 ) ; weight . add ( 6 ) ; for ( int i = 0 ; i < 100 ; i ++ ) graph . add ( new Vector < Integer > ( ) ) ; graph . get ( 1 ) . add ( 2 ) ; graph . get ( 2 ) . add ( 3 ) ; graph . get ( 2 ) . add ( 4 ) ; graph . get ( 1 ) . add ( 5 ) ; dfs ( 1 , 1 ) ; System . out . println ( ans ) ; } }

Accumulator variables: c, i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int count_pairs ( int a [ ] , int b [ ] , int n , int m ) { int odd1 = 0 , even1 = 0 ; int odd2 = 0 , even2 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] % 2 == 1 ) odd1 ++ ; else even1 ++ ; } for ( int i = 0 ; i < m ; i ++ ) { if ( b [ i ] % 2 == 1 ) odd2 ++ ; else even2 ++ ; } int pairs = Math . min ( odd1 , odd2 ) + Math . min ( even1 , even2 ) ; return pairs ; } public static void main ( String [ ] args ) { int a [ ] = { 9 , 14 , 6 , 2 , 11 } ; int b [ ] = { 8 , 4 , 7 , 20 } ; int n = a . length ; int m = b . length ; System . out . println ( count_pairs ( a , b , n , m ) ) ; } }

Index/key variables: i
Accumulator variables: even1, even2, i, odd1, odd2
Iterator variables: i
Class/struct names: GFG
Java program:
public class Main { public static void solve ( int Array [ ] , int N ) { double Arraynew [ ] = new double [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { Arraynew [ i ] = Math . log ( Array [ i ] ) ; } double prefixsum [ ] = new double [ N ] ; prefixsum [ 0 ] = Arraynew [ 0 ] ; for ( int i = 1 ; i < N ; i ++ ) { prefixsum [ i ] = prefixsum [ i - 1 ] + Arraynew [ i ] ; } int answer = 0 ; double minabs = Math . abs ( prefixsum [ N - 1 ] - 2 * prefixsum [ 0 ] ) ; for ( int i = 1 ; i < N - 1 ; i ++ ) { double ans1 = Math . abs ( prefixsum [ N - 1 ] - 2 * prefixsum [ i ] ) ; if ( ans1 < minabs ) { minabs = ans1 ; answer = i ; } } System . out . println ( " Index ▁ is : ▁ " + answer ) ; } public static void main ( String [ ] args ) { int Array [ ] = { 1 , 4 , 12 , 2 , 6 } ; int N = 5 ; solve ( Array , N ) ; } }

Index/key variables: N, i
Accumulator variables: i
Iterator variables: i
Class/struct names: Main
Java program:
import java . io . * ; class GFG { static int getValueOfF ( int n ) { if ( n == 1 ) return 0 ; if ( n == 2 ) return 1 ; int cnt = 0 ; while ( n % 2 == 0 ) { cnt += 1 ; n /= 2 ; } return 2 * cnt ; } public static void main ( String [ ] args ) { int n = 20 ; System . out . println ( getValueOfF ( n ) ) ; } }

Accumulator variables: cnt, n
Class/struct names: GFG
Java program:
class GFG { static int N = 100005 ; static int mod = 1000000007 ; static int cnt [ ] = new int [ N ] ; static void Divisors ( ) { for ( int i = 1 ; i < N ; i ++ ) { for ( int j = 1 ; j * i < N ; j ++ ) { cnt [ i * j ] ++ ; } } } static int Sumofdivisors ( int A , int B , int C ) { int sum = 0 ; Divisors ( ) ; for ( int i = 1 ; i <= A ; i ++ ) { for ( int j = 1 ; j <= B ; j ++ ) { for ( int k = 1 ; k <= C ; k ++ ) { int x = i * j * k ; sum += cnt [ x ] ; if ( sum >= mod ) { sum -= mod ; } } } } return sum ; } public static void main ( String [ ] args ) { int A = 5 , B = 6 , C = 7 ; System . out . println ( Sumofdivisors ( A , B , C ) ) ; } }

Index/key variables: N, x
Accumulator variables: i, j, k, sum
Iterator variables: i, j, k
Class/struct names: GFG
Java program:
class GFG { static int A_mod_B ( String N , int a ) { int len = N . length ( ) ; int ans = 0 ; for ( int i = 0 ; i < len ; i ++ ) ans = ( ans * 10 + ( int ) N . charAt ( i ) - '0' ) % a ; return ans % a ; } static int findMod ( String N ) { int mod = A_mod_B ( N , 4 ) ; int ans = ( 1 + ( int ) Math . pow ( 2 , mod ) + ( int ) Math . pow ( 3 , mod ) + ( int ) Math . pow ( 4 , mod ) ) ; return ( ans % 5 ) ; } public static void main ( String args [ ] ) { String N = "4" ; System . out . println ( findMod ( N ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GfG { static void printElements ( int arr [ ] , int n ) { for ( int i = 1 ; i < n - 1 ; i ++ ) { if ( arr [ i ] > arr [ i - 1 ] && arr [ i ] > arr [ i + 1 ] ) System . out . print ( arr [ i ] + " ▁ " ) ; } } public static void main ( String [ ] args ) { int arr [ ] = { 2 , 3 , 1 , 5 , 4 , 9 , 8 , 7 , 5 } ; int n = arr . length ; printElements ( arr , n ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GfG
Java program:
import java . lang . Math ; class GFG { static int exponent ( int A , int B ) { if ( A == 0 ) return 0 ; if ( B == 0 ) return 1 ; int y ; if ( B % 2 == 0 ) { y = exponent ( A , B / 2 ) ; y = ( y * y ) ; } else { y = A ; y = ( y * exponent ( A , B - 1 ) ) ; } return y ; } static int sum ( int k , int n ) { int sum = exponent ( k , n + 1 ) - exponent ( k - 1 , n + 1 ) ; return sum ; } public static void main ( String [ ] args ) { int n = 3 ; int K = 3 ; System . out . println ( sum ( K , n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean isPrime ( int x ) { for ( int i = 2 ; i * i <= x ; i ++ ) { if ( x % i == 0 ) return false ; } return true ; } static int minimumCost ( int n ) { if ( isPrime ( n ) ) return 1 ; if ( n % 2 == 1 && isPrime ( n - 2 ) ) return 2 ; if ( n % 2 == 0 ) return 2 ; return 3 ; } public static void main ( String args [ ] ) { int n = 6 ; System . out . println ( minimumCost ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { static double wastedWater ( double V , double M , double N ) { double wasted_amt , amt_per_min , time_to_fill ; amt_per_min = M - N ; time_to_fill = V / amt_per_min ; wasted_amt = N * time_to_fill ; return wasted_amt ; } public static void main ( String [ ] args ) { double V , M , N ; V = 700 ; M = 10 ; N = 3 ; System . out . println ( wastedWater ( V , M , N ) ) ; V = 1000 ; M = 100 ; N = 50 ; System . out . println ( wastedWater ( V , M , N ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void nDigitPerfectCubes ( int n ) { int smallest = ( int ) Math . pow ( Math . ceil ( Math . cbrt ( Math . pow ( 10 , ( n - 1 ) ) ) ) , 3 ) ; System . out . print ( smallest + " ▁ " ) ; int largest = ( int ) Math . pow ( Math . ceil ( Math . cbrt ( Math . pow ( 10 , ( n ) ) ) ) - 1 , 3 ) ; System . out . print ( largest ) ; } public static void main ( String args [ ] ) { int n = 3 ; nDigitPerfectCubes ( n ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int countNumbers ( int n ) { return ( n / 2520 ) ; } public static void main ( String args [ ] ) { int n = 3000 ; System . out . println ( countNumbers ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int MAX = 100001 ; static int prefix [ ] = new int [ MAX ] ; static void sieve_modified ( ) { for ( int i = 1 ; i < MAX ; i += 2 ) { for ( int j = i ; j < MAX ; j += i ) prefix [ j ] += i ; } for ( int i = 1 ; i < MAX ; i ++ ) prefix [ i ] += prefix [ i - 1 ] ; } static int sumOddFactors ( int L , int R ) { return ( prefix [ R ] - prefix [ L - 1 ] ) ; } public static void main ( String [ ] args ) { sieve_modified ( ) ; int l = 6 , r = 10 ; System . out . println ( sumOddFactors ( l , r ) ) ; } }

Index/key variables: MAX, R, i, j
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static int mod = 1000000007 ; public static int power ( int x , int y ) { int p = mod ; int res = 1 ; x = x % p ; while ( y > 0 ) { if ( ( y & 1 ) != 0 ) res = ( res * x ) % p ; y = y >> 1 ; x = ( x * x ) % p ; } return res ; } public static int solve ( int n , int k ) { if ( n == 1 ) return 0 ; return ( power ( ( k - 1 ) , n - 1 ) % mod - solve ( n - 1 , k ) + mod ) % mod ; } public static void main ( String [ ] args ) { int n = 4 , k = 5 ; System . out . println ( solve ( n , k ) ) ; } }

Class/struct names: GFG
Java program:
class GfG { static int n = 3 ; static void preComputeXor ( int arr [ ] [ ] , int prefix_xor [ ] [ ] ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < n ; j ++ ) { if ( j == 0 ) prefix_xor [ i ] [ j ] = arr [ i ] [ j ] ; else prefix_xor [ i ] [ j ] = ( prefix_xor [ i ] [ j - 1 ] ^ arr [ i ] [ j ] ) ; } for ( int i = 0 ; i < n ; i ++ ) for ( int j = 1 ; j < n ; j ++ ) prefix_xor [ j ] [ i ] = ( prefix_xor [ j - 1 ] [ i ] ^ prefix_xor [ j ] [ i ] ) ; } static int ansQuerie ( int prefix_xor [ ] [ ] , int x1 , int y1 , int x2 , int y2 ) { int xor_1 = 0 , xor_2 = 0 , xor_3 = 0 ; if ( x1 != 0 ) xor_1 = prefix_xor [ x1 - 1 ] [ y2 ] ; if ( y1 != 0 ) xor_2 = prefix_xor [ x2 ] [ y1 - 1 ] ; if ( x1 != 0 && y1 != 0 ) xor_3 = prefix_xor [ x1 - 1 ] [ y1 - 1 ] ; return ( ( prefix_xor [ x2 ] [ y2 ] ^ xor_1 ) ^ ( xor_2 ^ xor_3 ) ) ; } public static void main ( String [ ] args ) { int arr [ ] [ ] = new int [ ] [ ] { { 1 , 2 , 3 } , { 4 , 5 , 6 } , { 7 , 8 , 9 } } ; int prefix_xor [ ] [ ] = new int [ n ] [ n ] ; preComputeXor ( arr , prefix_xor ) ; System . out . println ( ansQuerie ( prefix_xor , 1 , 1 , 2 , 2 ) ) ; System . out . println ( ansQuerie ( prefix_xor , 1 , 2 , 2 , 2 ) ) ; } }

Index/key variables: i, j, n, x2, y2
Accumulator variables: i, j
Iterator variables: i, j
Class/struct names: GfG
Java program:
class GFG { static boolean isDigitSumOne ( int nm ) { if ( nm % 9 == 1 ) return true ; else return false ; } static void printValidNums ( int n ) { int cbrt_n = ( int ) Math . cbrt ( n ) ; for ( int i = 1 ; i <= cbrt_n ; i ++ ) { int cube = ( int ) Math . pow ( i , 3 ) ; if ( cube >= 1 && cube <= n && isDigitSumOne ( cube ) ) System . out . print ( cube + " ▁ " ) ; } } public static void main ( String args [ ] ) { int n = 1000 ; printValidNums ( n ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int countRhombi ( int h , int w ) { int ct = 0 ; for ( int i = 2 ; i <= h ; i += 2 ) for ( int j = 2 ; j <= w ; j += 2 ) ct += ( h - i + 1 ) * ( w - j + 1 ) ; return ct ; } public static void main ( String [ ] args ) { int h = 2 , w = 2 ; System . out . println ( countRhombi ( h , w ) ) ; } }

Accumulator variables: ct, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static double calculateArea ( int x , int y ) { double pi = 3.1415926536 ; double arx = pi * x * x ; double ary = pi * y * y ; return arx - ary ; } public static void main ( String [ ] args ) { int x = 2 ; int y = 1 ; System . out . println ( calculateArea ( x , y ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int __gcd ( int a , int b ) { if ( b == 0 ) return a ; return __gcd ( b , a % b ) ; } static char getWinner ( int [ ] arr , int n ) { int gcd = arr [ 0 ] ; int maxEle = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { gcd = __gcd ( gcd , arr [ i ] ) ; maxEle = Math . max ( maxEle , arr [ i ] ) ; } int totalMoves = ( maxEle / gcd ) - n ; if ( totalMoves % 2 == 1 ) return ' A ' ; return ' B ' ; } public static void main ( String args [ ] ) { int [ ] arr = { 5 , 6 , 7 } ; int n = arr . length ; System . out . print ( getWinner ( arr , n ) ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class GFG { public static int countPairs ( int n ) { int num = ( ( n / 2 ) + 1 ) ; int max = n % num ; int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= n ; j ++ ) { int val = ( ( n % i ) % j ) % n ; if ( val == max ) count ++ ; } } return count ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( countPairs ( n ) ) ; } }

Accumulator variables: count, i, j
Iterator variables: i, j
Class/struct names: GFG
Java program:
class GFG { static String isDivisible ( int n ) { int temp = n ; while ( n > 0 ) { int k = n % 10 ; if ( temp % k == 0 ) { return " YES " ; } n /= 10 ; } return " NO " ; } public static void main ( String [ ] args ) { int n = 9876543 ; System . out . println ( isDivisible ( n ) ) ; } }

Accumulator variables: n
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static double sum ( int n ) { double i , s = 0.0 ; for ( i = 1 ; i <= n ; i ++ ) s = s + 1 / i ; return s ; } public static void main ( String args [ ] ) { int n = 5 ; System . out . printf ( " Sum ▁ is ▁ % f " , sum ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static final int N = 100005 ; static Set < Integer > ABUNDANT ( ) { Set < Integer > v = new HashSet < > ( ) ; for ( int i = 1 ; i < N ; i ++ ) { int sum = 1 ; for ( int j = 2 ; j * j <= i ; j ++ ) { if ( i % j == 0 ) { sum += j ; if ( i / j != j ) { sum += i / j ; } } } if ( sum > i ) { v . add ( i ) ; } } return v ; } static void SumOfAbundant ( int n ) { Set < Integer > v = ABUNDANT ( ) ; for ( int i = 1 ; i <= n ; i ++ ) { if ( v . contains ( i ) & v . contains ( n - i ) ) { System . out . print ( i + " ▁ " + ( n - i ) ) ; return ; } } System . out . print ( - 1 ) ; } public static void main ( String [ ] args ) { int n = 24 ; SumOfAbundant ( n ) ; } }

Accumulator variables: i, j, sum
Iterator variables: i, j
Class/struct names: GFG
Java program:
import java . lang . Math ; class GFG { static long nthTermOfTheSeries ( int n ) { long nthTerm ; if ( n % 2 == 0 ) nthTerm = ( long ) Math . pow ( n - 1 , 2 ) + n ; else nthTerm = ( long ) Math . pow ( n + 1 , 2 ) + n ; return nthTerm ; } public static void main ( String [ ] args ) { int n ; n = 8 ; System . out . println ( nthTermOfTheSeries ( n ) ) ; n = 12 ; System . out . println ( nthTermOfTheSeries ( n ) ) ; n = 102 ; System . out . println ( nthTermOfTheSeries ( n ) ) ; n = 999 ; System . out . println ( nthTermOfTheSeries ( n ) ) ; n = 9999 ; System . out . println ( nthTermOfTheSeries ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class solution { static float CPwithProfit ( int sellingPrice , int profit ) { float costPrice ; costPrice = ( sellingPrice * 100 ) / ( 100 + profit ) ; return costPrice ; } static float CPwithLoss ( int sellingPrice , int loss ) { float costPrice ; costPrice = ( sellingPrice * 100 ) / ( 100 - loss ) ; return costPrice ; } public static void main ( String args [ ] ) { int SP , profit , loss ; SP = 1020 ; profit = 20 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithProfit ( SP , profit ) ) ; SP = 900 ; loss = 10 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithLoss ( SP , loss ) ) ; SP = 42039 ; profit = 8 ; System . out . println ( " Cost ▁ Price ▁ = ▁ " + CPwithProfit ( SP , profit ) ) ; } }

Class/struct names: solution
Java program:
import java . io . * ; import java . util . * ; class Gfg { static String obtain_str ( int n ) { int len = ( int ) Math . floor ( ( Math . log ( n + 1 ) / Math . log ( 2 ) ) ) ; int rel_ind = n + 1 - ( int ) Math . pow ( 2 , len ) ; int i = 0 ; StringBuilder str = new StringBuilder ( ) ; for ( i = 0 ; i < len ; i ++ ) { str . append ( ' a ' ) ; } i = 0 ; while ( rel_ind > 0 ) { if ( rel_ind % 2 == 1 ) str . setCharAt ( i , ' b ' ) ; rel_ind /= 2 ; i ++ ; } str = str . reverse ( ) ; return str . toString ( ) ; } public static void main ( String args [ ] ) { int n = 11 ; System . out . print ( obtain_str ( n ) ) ; } }

Accumulator variables: i, rel_ind
Iterator variables: i
Class/struct names: Gfg
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static void NthTerm ( int n ) { int numerator = ( ( int ) Math . pow ( n , 2 ) ) - 1 ; int denomeanator = 2 * n - 3 ; System . out . println ( numerator + " / " + denomeanator ) ; } public static void main ( String [ ] args ) { int n = 3 ; NthTerm ( n ) ; } }

Class/struct names: GFG
Java program:
public class GFG { public static int getSum ( int arr [ ] , int p ) { return arr . length ; } public static void main ( String [ ] args ) { int arr [ ] = { 5 , 6 , 8 } ; int p = 7 ; System . out . print ( getSum ( arr , p ) ) ; } }

Class/struct names: GFG
Java program:
public class GFG { static int SquareCube ( long N ) { int cnt = 0 , i = 1 ; while ( ( int ) ( Math . pow ( i , 6 ) ) <= N ) { ++ cnt ; ++ i ; } return cnt ; } public static void main ( String [ ] args ) { long N = 100000 ; System . out . println ( SquareCube ( N ) ) ; } }

Class/struct names: GFG
Java program:
class Solution { static long getSum ( int n , int d ) { long sum = 0 ; while ( d <= n ) { sum += d ; d += 10 ; } return sum ; } public static void main ( String args [ ] ) { int n = 30 , d = 3 ; System . out . print ( getSum ( n , d ) ) ; } }

Accumulator variables: d, sum
Class/struct names: Solution
Java program:
import java . io . * ; import java . util . * ; import java . lang . * ; class GFG { static int MOD = 1000000007 ; static long sum ( long N ) { long val = N * ( N + 1 ) ; val = val % MOD ; return val ; } static int sumX ( int N , int M , int K ) { for ( int i = 0 ; i < M ; i ++ ) { N = ( int ) sum ( K + N ) ; } N = N % MOD ; return N ; } public static void main ( String args [ ] ) { int N = 1 , M = 2 , K = 3 ; System . out . println ( sumX ( N , M , K ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
class Gfg1 { static int Log2n ( int n ) { return ( n > 1 ) ? 1 + Log2n ( n / 2 ) : 0 ; } public static void main ( String args [ ] ) { int n = 32 ; System . out . println ( Log2n ( n ) ) ; } }

Class/struct names: Gfg1
Java program:
import java . util . Arrays ; class GFG { static void printMode ( int [ ] a , int n ) { int max = Arrays . stream ( a ) . max ( ) . getAsInt ( ) ; int t = max + 1 ; int [ ] count = new int [ t ] ; for ( int i = 0 ; i < t ; i ++ ) { count [ i ] = 0 ; } for ( int i = 0 ; i < n ; i ++ ) { count [ a [ i ] ] ++ ; } int mode = 0 ; int k = count [ 0 ] ; for ( int i = 1 ; i < t ; i ++ ) { if ( count [ i ] > k ) { k = count [ i ] ; mode = i ; } } System . out . println ( " mode ▁ = ▁ " + mode ) ; } public static void main ( String [ ] args ) { int [ ] a = { 1 , 4 , 1 , 2 , 7 , 1 , 2 , 5 , 3 , 6 } ; int n = a . length ; printMode ( a , n ) ; } }

Index/key variables: i, t
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . util . * ; class GFG { static boolean checkIsHP ( double [ ] arr ) { int n = arr . length ; if ( n == 1 ) return true ; ArrayList < Integer > rec = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) rec . add ( ( int ) ( 1 / arr [ i ] ) ) ; Collections . sort ( rec ) ; int d = ( int ) rec . get ( 1 ) - ( int ) rec . get ( 0 ) ; for ( int i = 2 ; i < n ; i ++ ) if ( rec . get ( i ) - rec . get ( i - 1 ) != d ) return false ; return true ; } public static void main ( String [ ] args ) { double arr [ ] = { 1 / 5 , 1 / 10 , 1 / 15 , 1 / 20 , 1 / 25 } ; if ( checkIsHP ( arr ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Index/key variables: i
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . lang . * ; import java . util . * ; public class GFG { static void printAMeans ( int A , int B , int N ) { float d = ( float ) ( B - A ) / ( N + 1 ) ; for ( int i = 1 ; i <= N ; i ++ ) System . out . print ( ( A + i * d ) + " ▁ " ) ; } public static void main ( String args [ ] ) { int A = 20 , B = 32 , N = 5 ; printAMeans ( A , B , N ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; import java . lang . Math ; class GFG { public static void primeFactors ( int n ) { while ( n % 2 == 0 ) { System . out . print ( 2 + " ▁ " ) ; n /= 2 ; } for ( int i = 3 ; i <= Math . sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { System . out . print ( i + " ▁ " ) ; n /= i ; } } if ( n > 2 ) System . out . print ( n ) ; } public static void main ( String [ ] args ) { int n = 315 ; primeFactors ( n ) ; } }

Accumulator variables: i, n
Iterator variables: i
Class/struct names: GFG