codeparrot/xlcost-text-to-code huggingface dataset:
Queries to find Kth greatest character in a range [ L , R ] from a string with updates | Java Program to implement the above approach ; Maximum Size of a String ; Fenwick Tree to store the frequencies of 26 alphabets ; Size of the String . ; Function to update Fenwick Tree for Character c at index val ; Add val to current node Fenwick Tree ; Move index to parent node in update View ; Function to get sum of frequencies of character c till index ; Stores the sum ; Add current element of Fenwick tree to sum ; Move index to parent node in getSum View ; Function to create the Fenwick tree ; Function to print the kth largest character in the range of l to r ; Stores the count of characters ; Stores the required character ; Calculate frequency of C in the given range ; Increase count ; If count exceeds K ; Required character found ; Function to update character at pos by character s ; 0 based index system ; Driver Code ; Makes the String 1 - based indexed ; Number of queries ; Construct the Fenwick Tree
import java . util . * ; class GFG { static int maxn = 100005 ; static int [ ] [ ] BITree = new int [ 26 ] [ maxn ] ; static int N ; static void update_BITree ( int index , char C , int val ) { while ( index <= N ) { BITree [ C - ' a ' ] [ index ] += val ; index += ( index & - index ) ; } } static int sum_BITree ( int index , char C ) { int s = 0 ; while ( index > 0 ) { s += BITree [ C - ' a ' ] [ index ] ; index -= ( index & - index ) ; } return s ; } static void buildTree ( String str ) { for ( int i = 1 ; i <= N ; i ++ ) { update_BITree ( i , str . charAt ( i ) , 1 ) ; } System . out . println ( ) ; } static char printCharacter ( String str , int l , int r , int k ) { int count = 0 ; char ans = 0 ; for ( char C = ' z ' ; C >= ' a ' ; C -- ) { int times = sum_BITree ( r , C ) - sum_BITree ( l - 1 , C ) ; count += times ; if ( count >= k ) { ans = C ; break ; } } return ans ; } static void updateTree ( String str , int pos , char s ) { int index = pos ; update_BITree ( index , str . charAt ( index ) , - 1 ) ; str = str . substring ( 0 , index ) + s + str . substring ( index + 1 ) ; update_BITree ( index , s , 1 ) ; } public static void main ( String [ ] args ) { String str = " abcddef " ; N = str . length ( ) ; str = ' / ' + str ; int Q = 3 ; buildTree ( str ) ; System . out . print ( printCharacter ( str , 1 , 2 , 2 ) + "NEW_LINE"); updateTree ( str , 4 , ' g ' ) ; System . out . print ( printCharacter ( str , 1 , 5 , 4 ) + "NEW_LINE"); } }
Generate a string from an array of alphanumeric strings based on given conditions | Java program for the above approach ; Function to generate required string ; To store the result ; Split name and number ; Stores the maximum number less than or equal to the length of name ; Check for number by parsing it to integer if it is greater than max number so far ; Check if no such number is found then we append X to the result . ; Otherwise ; Append max index of the name ; Return the final string ; Driver Code ; Function Call
import java . io . * ; class GFG { public static String generatePassword ( String s [ ] , char T ) { StringBuilder result = new StringBuilder ( ) ; for ( String currentString : s ) { String person [ ] = currentString . split ( " : " ) ; String name = person [ 0 ] ; String number = person [ 1 ] ; int n = name . length ( ) ; int max = 0 ; for ( int i = 0 ; i < number . length ( ) ; i ++ ) { int temp = Integer . parseInt ( String . valueOf ( number . charAt ( i ) ) ) ; if ( temp > max && temp <= n ) max = temp ; } if ( max == 0 ) result . append ( T ) ; else result . append ( String . valueOf ( name . charAt ( max - 1 ) ) ) ; } return result . toString ( ) ; } public static void main ( String [ ] args ) { String arr [ ] = { " Geeks : 89167" , " gfg : 68795" } ; char T = ' X ' ; System . out . println ( generatePassword ( arr , T ) ) ; } }
Minimum number of edges required to be removed from an Undirected Graph to make it acyclic | Java program to implement the above approach ; Stores the adjacency list ; Stores if a vertex is visited or not ; Function to perform DFS Traversal to count the number and size of all connected components ; Mark the current node as visited ; Traverse the adjacency list of the current node ; For every unvisited node ; Recursive DFS call ; Function to add undirected edge in the graph ; Function to calculate minimum number of edges to be removed ; Create Adjacency list ; Iterate over all the nodes ; Print the final count ; Driver Code
import java . util . * ; class GFG { @ SuppressWarnings ( " unchecked " ) static Vector < Integer > [ ] vec = new Vector [ 100001 ] ; static boolean [ ] vis = new boolean [ 100001 ] ; static int cc = 1 ; static void dfs ( int node ) { vis [ node ] = true ; for ( int x : vec [ node ] ) { if ( ! vis [ x ] ) { cc ++ ; dfs ( x ) ; } } } static void addEdge ( int u , int v ) { vec [ u ] . add ( v ) ; vec [ v ] . add ( u ) ; } static void minEdgeRemoved ( int N , int M , int Edges [ ] [ ] ) { for ( int i = 0 ; i < M ; i ++ ) { addEdge ( Edges [ i ] [ 0 ] , Edges [ i ] [ 1 ] ) ; } int k = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { if ( ! vis [ i ] ) { cc = 1 ; dfs ( i ) ; k ++ ; } } System . out . print ( M - N + k + "NEW_LINE"); } public static void main ( String [ ] args ) { int N = 3 , M = 2 ; int Edges [ ] [ ] = { { 1 , 2 } , { 2 , 3 } } ; for ( int i = 0 ; i < vec . length ; i ++ ) vec [ i ] = new Vector < Integer > ( ) ; minEdgeRemoved ( N , M , Edges ) ; } }
Check if a Binary Tree consists of a pair of leaf nodes with sum K | Java program to implement the above approach ; Stores if a pair exists or not ; Struct binary tree node ; Creates a new node ; Function to check if a pair of leaf nodes exists with sum K ; Checks if root is null ; Checks if the current node is a leaf node ; Checks for a valid pair of leaf nodes ; Insert value of current node into the set ; Traverse left and right subtree ; Driver Code ; Construct binary tree ; Stores the leaf nodes
import java . util . * ; class GFG { static boolean pairFound = false ; static class Node { int data ; Node left , right ; } ; static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = temp . right = null ; return temp ; } static void pairSum ( Node root , int target , HashSet < Integer > S ) { if ( root == null ) return ; if ( root . left == null && root . right == null ) { if ( S . contains ( target - root . data ) ) { System . out . print ( target - root . data + " ▁ " + root . data ) ; pairFound = true ; return ; } else S . add ( root . data ) ; } pairSum ( root . left , target , S ) ; pairSum ( root . right , target , S ) ; } public static void main ( String [ ] args ) { Node root = newNode ( 1 ) ; root . left = newNode ( 2 ) ; root . left . left = newNode ( 4 ) ; root . left . right = newNode ( 5 ) ; root . right = newNode ( 3 ) ; root . right . left = newNode ( 6 ) ; root . right . right = newNode ( 7 ) ; root . right . right . right = newNode ( 8 ) ; HashSet < Integer > S = new HashSet < Integer > ( ) ; int K = 13 ; pairSum ( root , K , S ) ; if ( pairFound == false ) System . out . print ( " - 1" ) ; } }
Maximum non | Java program for the above approach ; Function to print the maximum rooks and their positions ; Initialize row and col array ; Marking the location of already placed rooks ; Print number of non - attacking rooks that can be placed ; To store the placed rook location ; Print lexographically smallest order ; Driver Code ; Size of board ; Number of rooks already placed ; Position of rooks ; Function call
public class GFG { private static void countRooks ( int n , int k , int pos [ ] [ ] ) { int row [ ] = new int [ n ] ; int col [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { row [ i ] = 0 ; col [ i ] = 0 ; } for ( int i = 0 ; i < k ; i ++ ) { row [ pos [ i ] [ 0 ] - 1 ] = 1 ; col [ pos [ i ] [ 1 ] - 1 ] = 1 ; } int res = n - k ; System . out . println ( res + " ▁ " ) ; int ri = 0 , ci = 0 ; while ( res -- > 0 ) { while ( row [ ri ] == 1 ) { ri ++ ; } while ( col [ ci ] == 1 ) { ci ++ ; } System . out . println ( ( ri + 1 ) + " ▁ " + ( ci + 1 ) + " ▁ " ) ; ri ++ ; ci ++ ; } } public static void main ( String [ ] args ) { int N = 4 ; int K = 2 ; int pos [ ] [ ] = { { 1 , 4 } , { 2 , 2 } } ; countRooks ( N , K , pos ) ; } }
Minimum insertions to form a palindrome with permutations allowed | Java program to find minimum number of insertions to make a string palindrome ; Function will return number of characters to be added ; To store string length ; To store number of characters occurring odd number of times ; To store count of each character ; To store occurrence of each character ; To count characters with odd occurrence ; As one character can be odd return res - 1 but if string is already palindrome return 0 ; Driver program
public class Palindrome { static int minInsertion ( String str ) { int n = str . length ( ) ; int res = 0 ; int [ ] count = new int [ 26 ] ; for ( int i = 0 ; i < n ; i ++ ) count [ str . charAt ( i ) - ' a ' ] ++ ; for ( int i = 0 ; i < 26 ; i ++ ) { if ( count [ i ] % 2 == 1 ) res ++ ; } return ( res == 0 ) ? 0 : res - 1 ; } public static void main ( String [ ] args ) { String str = " geeksforgeeks " ; System . out . println ( minInsertion ( str ) ) ; } }
Generate a string which differs by only a single character from all given strings | Java program to implement the above approach ; Function to check if a given string differs by a single character from all the strings in an array ; Traverse over the strings ; Stores the count of characters differing from the strings ; If differs by more than one character ; Function to find the string which only differ at one position from the all given strings of the array ; Size of the array ; Length of a string ; Replace i - th character by all possible characters ; Check if it differs by a single character from all other strings ; If desired string is obtained ; Print the answer ; Driver code ; Function call
import java . util . * ; class GFG { static boolean check ( String ans , String [ ] s , int n , int m ) { for ( int i = 1 ; i < n ; ++ i ) { int count = 0 ; for ( int j = 0 ; j < m ; ++ j ) { if ( ans . charAt ( j ) != s [ i ] . charAt ( j ) ) count ++ ; } if ( count > 1 ) return false ; } return true ; } static String findString ( String [ ] s ) { int n = s . length ; String ans = s [ 0 ] ; int m = ans . length ( ) ; int flag = 0 ; for ( int i = 0 ; i < m ; ++ i ) { for ( int j = 0 ; j < 26 ; ++ j ) { String x = ans ; x = x . replace ( x . charAt ( i ) , ( char ) ( j + ' a ' ) ) ; if ( check ( x , s , n , m ) ) { ans = x ; flag = 1 ; break ; } } if ( flag == 1 ) break ; } if ( flag == 0 ) return " - 1" ; else return ans ; } public static void main ( String [ ] args ) { String s [ ] = { " geeks " , " teeds " } ; System . out . println ( findString ( s ) ) ; } }
Minimum increments of Non | Java Program to implement the above approach ; Function to return to the minimum number of operations required to make the array non - decreasing ; Stores the count of operations ; If arr [ i ] > arr [ i + 1 ] , add arr [ i ] - arr [ i + 1 ] to the answer Otherwise , add 0 ; Driver Code
import java . io . * ; import java . util . * ; class GFG { public static int getMinOps ( int [ ] arr ) { int ans = 0 ; for ( int i = 0 ; i < arr . length - 1 ; i ++ ) { ans += Math . max ( arr [ i ] - arr [ i + 1 ] , 0 ) ; } return ans ; } public static void main ( String [ ] args ) { int [ ] arr = { 1 , 3 , 1 , 2 , 4 } ; System . out . println ( getMinOps ( arr ) ) ; } }
Maximum difference between frequency of two elements such that element having greater frequency is also greater | Java program to find maximum difference between frequency of any two element such that element with greater frequency is also greater in value . ; Return the maximum difference between frequencies of any two elements such that element with greater frequency is also greater in value . ; Finding the frequency of each element . ; finding difference such that element having greater frequency is also greater in value . ; Driver Code
import java . util . * ; class GFG { static int maxdiff ( int arr [ ] , int n ) { Map < Integer , Integer > freq = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) freq . put ( arr [ i ] , freq . get ( arr [ i ] ) == null ? 1 : freq . get ( arr [ i ] ) + 1 ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( freq . get ( arr [ i ] ) > freq . get ( arr [ j ] ) && arr [ i ] > arr [ j ] ) ans = Math . max ( ans , freq . get ( arr [ i ] ) - freq . get ( arr [ j ] ) ) ; else if ( freq . get ( arr [ i ] ) < freq . get ( arr [ j ] ) && arr [ i ] < arr [ j ] ) ans = Math . max ( ans , freq . get ( arr [ j ] ) - freq . get ( arr [ i ] ) ) ; } } return ans ; } public static void main ( String [ ] args ) { int arr [ ] = { 3 , 1 , 3 , 2 , 3 , 2 } ; int n = arr . length ; System . out . println ( maxdiff ( arr , n ) ) ; } }
Maximum difference between frequency of two elements such that element having greater frequency is also greater | Efficient Java program to find maximum difference between frequency of any two elements such that element with greater frequency is also greater in value . ; Return the maximum difference between frequencies of any two elements such that element with greater frequency is also greater in value . ; Finding the frequency of each element . ; Sorting the distinct element ; Iterate through all sorted distinct elements . For each distinct element , maintaining the element with minimum frequency than that element and also finding the maximum frequency difference ; Driven Program
import java . util . * ; class GFG { static int maxdiff ( int arr [ ] , int n ) { HashMap < Integer , Integer > freq = new HashMap < > ( ) ; int [ ] dist = new int [ n ] ; int j = 0 ; for ( int i = 0 ; i < n ; i ++ ) { dist [ j ++ ] = arr [ i ] ; if ( ! freq . containsKey ( arr [ i ] ) ) freq . put ( arr [ i ] , 1 ) ; else freq . put ( arr [ i ] , freq . get ( arr [ i ] ) + 1 ) ; } Arrays . sort ( dist ) ; int min_freq = n + 1 ; int ans = 0 ; for ( int i = 0 ; i < j ; i ++ ) { int cur_freq = freq . get ( dist [ i ] ) ; ans = Math . max ( ans , cur_freq - min_freq ) ; min_freq = Math . min ( min_freq , cur_freq ) ; } return ans ; } public static void main ( String [ ] args ) { int arr [ ] = { 3 , 1 , 3 , 2 , 3 , 2 } ; int n = arr . length ; System . out . print ( maxdiff ( arr , n ) + "NEW_LINE"); } }
Maximum Sum possible by selecting X elements from a Matrix based on given conditions | Java program to implement the above approach ; Function to calculate the maximum possible sum by selecting X elements from the Matrix ; Generate prefix sum of the matrix ; Initialize dp [ ] [ ] ; Maximum possible sum by selecting 0 elements from the first i rows ; If a single row is present ; If elements from the current row is not selected ; Iterate over all possible selections from current row ; Return maximum possible sum ; Driver Code
import java . util . * ; import java . io . * ; class GFG { static int n , m , X ; public static int maxSum ( int [ ] [ ] grid ) { int prefsum [ ] [ ] = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int x = 0 ; x < m ; x ++ ) { if ( x == 0 ) prefsum [ i ] [ x ] = grid [ i ] [ x ] ; else prefsum [ i ] [ x ] = prefsum [ i ] [ x - 1 ] + grid [ i ] [ x ] ; } } int dp [ ] [ ] = new int [ n ] [ X + 1 ] ; for ( int dpp [ ] : dp ) Arrays . fill ( dpp , Integer . MIN_VALUE ) ; for ( int i = 0 ; i < n ; i ++ ) dp [ i ] [ 0 ] = 0 ; for ( int i = 1 ; i <= Math . min ( m , X ) ; ++ i ) { dp [ 0 ] [ i ] = dp [ 0 ] [ i - 1 ] + grid [ 0 ] [ i - 1 ] ; } for ( int i = 1 ; i < n ; ++ i ) { for ( int j = 1 ; j <= X ; ++ j ) { dp [ i ] [ j ] = dp [ i - 1 ] [ j ] ; for ( int x = 1 ; x <= Math . min ( j , m ) ; x ++ ) { dp [ i ] [ j ] = Math . max ( dp [ i ] [ j ] , dp [ i - 1 ] [ j - x ] + prefsum [ i ] [ x - 1 ] ) ; } } } return dp [ n - 1 ] [ X ] ; } public static void main ( String [ ] args ) { n = 4 ; m = 4 ; X = 6 ; int grid [ ] [ ] = { { 3 , 2 , 6 , 1 } , { 1 , 9 , 2 , 4 } , { 4 , 1 , 3 , 9 } , { 3 , 8 , 2 , 1 } } ; int ans = maxSum ( grid ) ; System . out . println ( ans ) ; } }
Difference between highest and least frequencies in an array | JAVA Code for Difference between highest and least frequencies in an array ; sort the array ; checking consecutive elements ; Driver program to test above function
import java . util . * ; class GFG { static int findDiff ( int arr [ ] , int n ) { Arrays . sort ( arr ) ; int count = 0 , max_count = 0 , min_count = n ; for ( int i = 0 ; i < ( n - 1 ) ; i ++ ) { if ( arr [ i ] == arr [ i + 1 ] ) { count += 1 ; continue ; } else { max_count = Math . max ( max_count , count ) ; min_count = Math . min ( min_count , count ) ; count = 0 ; } } return ( max_count - min_count ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 7 , 8 , 4 , 5 , 4 , 1 , 1 , 7 , 7 , 2 , 5 } ; int n = arr . length ; System . out . println ( findDiff ( arr , n ) ) ; } }
Minimum Decrements on Subarrays required to reduce all Array elements to zero | Java Program to implement the above approach ; Function to count the minimum number of subarrays that are required to be decremented by 1 ; Base Case ; Initializing ans to first element ; For A [ i ] > A [ i - 1 ] , operation ( A [ i ] - A [ i - 1 ] ) is required ; Return the count ; Driver Code
import java . io . * ; class GFG { static int min_operations ( int A [ ] , int n ) { if ( n == 0 ) return 0 ; int ans = A [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { if ( A [ i ] > A [ i - 1 ] ) { ans += A [ i ] - A [ i - 1 ] ; } } return ans ; } public static void main ( String [ ] args ) { int n = 5 ; int A [ ] = { 1 , 2 , 3 , 2 , 1 } ; System . out . println ( min_operations ( A , n ) ) ; } }
Difference between highest and least frequencies in an array | Java code to find the difference between highest and least frequencies ; Put all elements in a hash map ; Find counts of maximum and minimum frequent elements ; Driver code
import java . util . * ; class GFG { static int findDiff ( int arr [ ] , int n ) { Map < Integer , Integer > mp = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mp . containsKey ( arr [ i ] ) ) { mp . put ( arr [ i ] , mp . get ( arr [ i ] ) + 1 ) ; } else { mp . put ( arr [ i ] , 1 ) ; } } int max_count = 0 , min_count = n ; for ( Map . Entry < Integer , Integer > x : mp . entrySet ( ) ) { max_count = Math . max ( max_count , x . getValue ( ) ) ; min_count = Math . min ( min_count , x . getValue ( ) ) ; } return ( max_count - min_count ) ; } public static void main ( String [ ] args ) { int arr [ ] = { 7 , 8 , 4 , 5 , 4 , 1 , 1 , 7 , 7 , 2 , 5 } ; int n = arr . length ; System . out . println ( findDiff ( arr , n ) ) ; } }
Iterative function to check if two trees are identical | Iterative Java program to check if two ; A Binary Tree Node ; Iterative method to find height of Binary Tree ; Return true if both trees are empty ; Return false if one is empty and other is not ; Create an empty queues for simultaneous traversals ; Enqueue Roots of trees in respective queues ; Get front nodes and compare them ; Remove front nodes from queues ; Enqueue left children of both nodes ; If one left child is empty and other is not ; Right child code ( Similar to left child code ) ; Utility function to create a new tree node ; Driver program to test above functions
import java . util . * ; class GfG { static class Node { int data ; Node left , right ; } static boolean areIdentical ( Node root1 , Node root2 ) { if ( root1 == null && root2 == null ) return true ; if ( root1 == null root2 == null ) return false ; Queue < Node > q1 = new LinkedList < Node > ( ) ; Queue < Node > q2 = new LinkedList < Node > ( ) ; q1 . add ( root1 ) ; q2 . add ( root2 ) ; while ( ! q1 . isEmpty ( ) && ! q2 . isEmpty ( ) ) { Node n1 = q1 . peek ( ) ; Node n2 = q2 . peek ( ) ; if ( n1 . data != n2 . data ) return false ; q1 . remove ( ) ; q2 . remove ( ) ; if ( n1 . left != null && n2 . left != null ) { q1 . add ( n1 . left ) ; q2 . add ( n2 . left ) ; } else if ( n1 . left != null n2 . left != null ) return false ; if ( n1 . right != null && n2 . right != null ) { q1 . add ( n1 . right ) ; q2 . add ( n2 . right ) ; } else if ( n1 . right != null n2 . right != null ) return false ; } return true ; } static Node newNode ( int data ) { Node temp = new Node ( ) ; temp . data = data ; temp . left = null ; temp . right = null ; return temp ; } public static void main ( String [ ] args ) { Node root1 = newNode ( 1 ) ; root1 . left = newNode ( 2 ) ; root1 . right = newNode ( 3 ) ; root1 . left . left = newNode ( 4 ) ; root1 . left . right = newNode ( 5 ) ; Node root2 = newNode ( 1 ) ; root2 . left = newNode ( 2 ) ; root2 . right = newNode ( 3 ) ; root2 . left . left = newNode ( 4 ) ; root2 . left . right = newNode ( 5 ) ; if ( areIdentical ( root1 , root2 ) == true ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }
Queries to check if vertices X and Y are in the same Connected Component of an Undirected Graph | Java Program to implement the above approach ; Maximum number of nodes or vertices that can be present in the graph ; Store the parent of each vertex ; Stores the size of each set ; Function to initialize the parent of each vertices ; Function to find the representative of the set which contain element v ; Path compression technique to optimize the time complexity ; Function to merge two different set into a single set by finding the representative of each set and merge the smallest set with the larger one ; Finding the set representative of each element ; Check if they have different set repersentative ; Compare the set sizes ; Assign parent of smaller set to the larger one ; Add the size of smaller set to the larger one ; Function to check the vertices are on the same set or not ; Check if they have same set representative or not ; Driver Code ; Connected vertices and taking them into single set ; Number of queries ; Function call
import java . util . * ; class GFG { static final int MAX_NODES = 100005 ; static int [ ] parent = new int [ MAX_NODES ] ; static int [ ] size_set = new int [ MAX_NODES ] ; static void make_set ( int v ) { parent [ v ] = v ; size_set [ v ] = 1 ; } static int find_set ( int v ) { if ( v == parent [ v ] ) return v ; return parent [ v ] = find_set ( parent [ v ] ) ; } static void union_set ( int a , int b ) { a = find_set ( a ) ; b = find_set ( b ) ; if ( a != b ) { if ( size_set [ a ] < size_set [ b ] ) { a = a + b ; b = a - b ; a = a - b ; } parent [ b ] = a ; size_set [ a ] += size_set [ b ] ; } } static String check ( int a , int b ) { a = find_set ( a ) ; b = find_set ( b ) ; return ( a == b ) ? " Yes " : " No " ; } public static void main ( String [ ] args ) { int n = 5 , m = 3 ; make_set ( 1 ) ; make_set ( 2 ) ; make_set ( 3 ) ; make_set ( 4 ) ; make_set ( 5 ) ; union_set ( 1 , 3 ) ; union_set ( 3 , 4 ) ; union_set ( 3 , 5 ) ; int q = 3 ; System . out . print ( check ( 1 , 5 ) + "NEW_LINE"); System . out . print ( check ( 3 , 2 ) + "NEW_LINE"); System . out . print ( check ( 5 , 2 ) + "NEW_LINE"); } }