id
stringlengths
37
65
content
stringlengths
450
3.71k
multipl-e_mbpp-java_data_mbpp_238_number_of_substrings
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to count the number of non-empty substrings of a given string. public static long numberOfSubstrings(Stri...
multipl-e_mbpp-java_data_mbpp_239_get_total_number_of_sequences
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element...
multipl-e_mbpp-java_data_mbpp_240_replace_list
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in two array lists and replaces the last element of the first array list with the elements of the second ar...
multipl-e_mbpp-java_data_mbpp_242_count_charac
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to count the total number of characters in a string. public static long countCharac(String str1) { } pub...
multipl-e_mbpp-java_data_mbpp_244_next_Perfect_Square
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the next perfect square greater than a given number. public static long nextPerfectSquare(long N)...
multipl-e_mbpp-java_data_mbpp_245_max_sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes an array array list and finds the maximum sum of a bitonic subsequence for the given array array list, wher...
multipl-e_mbpp-java_data_mbpp_247_lps
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the length of the longest palindromic subsequence in the given string. public static long lps(String str) ...
multipl-e_mbpp-java_data_mbpp_249_intersection_array
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the intersection of two array array lists. public static ArrayList<Long> intersectionArray(ArrayList<Long>...
multipl-e_mbpp-java_data_mbpp_250_count_X
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function that takes in a pair and an element and counts the occcurences of the element in the array list. public s...
multipl-e_mbpp-java_data_mbpp_251_insert_element
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and an element and inserts the element before each element in the array list, and re...
multipl-e_mbpp-java_data_mbpp_252_convert
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to convert complex numbers to polar coordinates. public static Pair<Float, Float> convert(long numbers) {...
multipl-e_mbpp-java_data_mbpp_255_combinations_colors
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and length n, and generates all combinations (with repetition) of the elements of th...
multipl-e_mbpp-java_data_mbpp_256_count_Primes_nums
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative ...
multipl-e_mbpp-java_data_mbpp_257_swap_numbers
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in two numbers and returns an array array list with the second number and then the first number. public...
multipl-e_mbpp-java_data_mbpp_259_maximize_elements
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to maximize the given two array lists. public static ArrayList<ArrayList<Long>> maximizeElements(ArrayList<ArrayLi...
multipl-e_mbpp-java_data_mbpp_260_newman_prime
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the nth newman–shanks–williams prime number. public static long newmanPrime(long n) { } public s...
multipl-e_mbpp-java_data_mbpp_261_division_elements
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in two pairs and performs mathematical division operation element-wise across the given pairs. public s...
multipl-e_mbpp-java_data_mbpp_262_split_two_parts
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and an integer L and splits the given array list into two parts where the length of ...
multipl-e_mbpp-java_data_mbpp_264_dog_age
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to calculate a dog's age in dog's years. public static long dogAge(long h_age) { } public static void ma...
multipl-e_mbpp-java_data_mbpp_265_list_split
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and an integer n and splits an array array list for every nth element, returning an ...
multipl-e_mbpp-java_data_mbpp_266_lateralsurface_cube
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the lateral surface area of a cube given its side length. public static long lateralsurfaceCube(long l) { ...
multipl-e_mbpp-java_data_mbpp_267_square_Sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers. public ...
multipl-e_mbpp-java_data_mbpp_268_find_star_num
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the n'th star number. public static long findStarNum(long n) { } public static void main(String[...
multipl-e_mbpp-java_data_mbpp_269_ascii_value
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the ascii value of a character. public static long asciiValue(String k) { } public static void m...
multipl-e_mbpp-java_data_mbpp_270_sum_even_and_even_index
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the sum of even numbers at even positions of an array array list. public static long sumEvenAndEv...
multipl-e_mbpp-java_data_mbpp_271_even_Power_Sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth...
multipl-e_mbpp-java_data_mbpp_272_rear_extract
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list of pairs and returns an array array list containing the rear element of each pair. ...
multipl-e_mbpp-java_data_mbpp_273_substract_elements
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in two pairs and subtracts the elements of the first pair by the elements of the second pair with the same ...
multipl-e_mbpp-java_data_mbpp_274_even_binomial_Coeff_Sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function that takes in a positive integer n and finds the sum of even index binomial coefficients. public static l...
multipl-e_mbpp-java_data_mbpp_277_dict_filter
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in a hash map and integer n and filters the hash map to only include entries with values greater than or eq...
multipl-e_mbpp-java_data_mbpp_279_is_num_decagonal
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the nth decagonal number. public static long isNumDecagonal(long n) { } public static void main(...
multipl-e_mbpp-java_data_mbpp_280_sequential_search
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and element and returns a pair containing a boolean that indicates if the element is...
multipl-e_mbpp-java_data_mbpp_281_all_unique
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to check if the elements of a given array list are unique or not. public static boolean allUnique(ArrayLi...
multipl-e_mbpp-java_data_mbpp_282_sub_list
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to subtract two array lists element-wise. public static ArrayList<Long> subList(ArrayList<Long> nums1, ArrayList<L...
multipl-e_mbpp-java_data_mbpp_283_validate
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the...
multipl-e_mbpp-java_data_mbpp_284_check_element
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes in an array array list and element and checks whether all items in the array list are equal to the given el...
multipl-e_mbpp-java_data_mbpp_285_text_match_two_three
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters. public static boo...
multipl-e_mbpp-java_data_mbpp_286_max_sub_array_sum_repeated
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the largest sum of a contiguous array array list in the modified array array list which is formed by repeating...
multipl-e_mbpp-java_data_mbpp_287_square_Sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function takes in an integer n and returns the sum of squares of first n even natural numbers. public static long ...
multipl-e_mbpp-java_data_mbpp_290_max_length
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the array list of maximum length in an array array list of array lists. public static Pair<Long, ArrayList...
multipl-e_mbpp-java_data_mbpp_291_count_no_of_ways
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color for the gi...
multipl-e_mbpp-java_data_mbpp_292_find
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find quotient of two numbers (rounded down to the nearest integer). public static long find(long n, lo...
multipl-e_mbpp-java_data_mbpp_293_otherside_rightangle
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the third side of a right angled triangle. public static float othersideRightangle(long w, long h) { ...
multipl-e_mbpp-java_data_mbpp_295_sum_div
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to return the sum of all divisors of a number. public static long sumDiv(long number) { } public static ...
multipl-e_mbpp-java_data_mbpp_296_get_Inv_Count
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to count inversions in an array array list. public static long getInvCount(ArrayList<Long> arr) { }...
multipl-e_mbpp-java_data_mbpp_299_max_aggregate
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to calculate the maximum aggregate from the array list of pairs. public static Pair<String, Long> maxAggregate(Arr...
multipl-e_mbpp-java_data_mbpp_304_find_Element
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find element at a given index after number of rotations. public static long findElement(ArrayList<Long...
multipl-e_mbpp-java_data_mbpp_305_start_withp
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to return two words from an array array list of words starting with letter 'p'. public static Pair<String, String>...
multipl-e_mbpp-java_data_mbpp_306_max_sum_increasing_subseq
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element w...
multipl-e_mbpp-java_data_mbpp_308_large_product
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the specified number of largest products from two given array lists, selecting one factor from each array list...
multipl-e_mbpp-java_data_mbpp_309_maximum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the maximum of two numbers. public static long maximum(long a, long b) { } public stati...
multipl-e_mbpp-java_data_mbpp_310_string_to_tuple
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to convert a given string to an array array list of characters. public static ArrayList<String> stringToTuple(Stri...
multipl-e_mbpp-java_data_mbpp_388_highest_Power_of_2
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the highest power of 2 that is less than or equal to n. public static long highestPowerOf2(long n...
multipl-e_mbpp-java_data_mbpp_389_find_lucas
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the n'th lucas number. public static long findLucas(long n) { } public static void main(String[]...
multipl-e_mbpp-java_data_mbpp_390_add_string
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to apply a given format string to all of the elements in an array array list. public static ArrayList<String> addS...
multipl-e_mbpp-java_data_mbpp_391_convert_list_dictionary
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to convert more than one array list to nested hash map. public static ArrayList<HashMap<String,HashMap<String,Long...
multipl-e_mbpp-java_data_mbpp_392_get_max_sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the maximum sum possible by using the given equation f(n) = max( (f(n/2) + f(n/3) + f(n/4) + f(n/5)), n). ...
multipl-e_mbpp-java_data_mbpp_393_max_length_list
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the array list with maximum length. public static Pair<Long, ArrayList<Long>> maxLengthList(ArrayList<Arra...
multipl-e_mbpp-java_data_mbpp_394_check_distinct
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to check if given array list contains no duplicates. public static boolean checkDistinct(ArrayList<Long> test_tup)...
multipl-e_mbpp-java_data_mbpp_395_first_non_repeating_character
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the first non-repeated character in a given string. public static Optional<String> firstNonRepeat...
multipl-e_mbpp-java_data_mbpp_396_check_char
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to check whether the given string starts and ends with the same character or not. public static String checkChar(S...
multipl-e_mbpp-java_data_mbpp_397_median_numbers
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the median of three numbers. public static float medianNumbers(long a, long b, long c) { } publi...
multipl-e_mbpp-java_data_mbpp_398_sum_of_digits
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to compute the sum of digits of each number of a given array list. public static long sumOfDigits(ArrayList<Object...
multipl-e_mbpp-java_data_mbpp_399_bitwise_xor
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to perform the mathematical bitwise xor operation across the given pairs. public static Pair<Long, Long, Long, Lon...
multipl-e_mbpp-java_data_mbpp_400_extract_freq
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to extract the number of unique pairs in the given array list. public static long extractFreq(ArrayList<Pair<Long,...
multipl-e_mbpp-java_data_mbpp_401_add_nested_tuples
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to perform index wise addition of array list elements in the given two nested array lists. public static ArrayList...
multipl-e_mbpp-java_data_mbpp_404_minimum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the minimum of two numbers. public static long minimum(long a, long b) { } public stati...
multipl-e_mbpp-java_data_mbpp_406_find_Parity
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find whether the parity of a given number is odd. public static boolean findParity(long x) { } ...
multipl-e_mbpp-java_data_mbpp_407_rearrange_bigger
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to create the next bigger number by rearranging the digits of a given number. public static Object rearrangeBigger...
multipl-e_mbpp-java_data_mbpp_408_k_smallest_pairs
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find k number of smallest pairs which consist of one element from the first array array list and one element from t...
multipl-e_mbpp-java_data_mbpp_409_min_product_tuple
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the minimum product from the pairs of pairs within a given array list. public static long minProductTuple(...
multipl-e_mbpp-java_data_mbpp_411_snake_to_camel
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to convert the given snake case string to camel case string. public static String snakeToCamel(String word) { ...
multipl-e_mbpp-java_data_mbpp_412_remove_odd
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to remove odd numbers from a given array list. public static ArrayList<Long> removeOdd(ArrayList<Long> l)...
multipl-e_mbpp-java_data_mbpp_413_extract_nth_element
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to extract the nth element from a given array list of pairs. public static ArrayList<Object> extractNthElement(Arr...
multipl-e_mbpp-java_data_mbpp_414_overlapping
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to check whether any value in a sequence exists in a sequence or not. public static boolean overlapping(A...
multipl-e_mbpp-java_data_mbpp_415_max_Product
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find a pair with highest product from a given array array list of integers. public static Pair<Long, L...
multipl-e_mbpp-java_data_mbpp_417_group_tuples
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find common first element in given array list of array lists. public static ArrayList<ArrayList<String>> groupT...
multipl-e_mbpp-java_data_mbpp_418_Find_Max
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the element of an array array list having maximum length. public static ArrayList<Object> FindMax...
multipl-e_mbpp-java_data_mbpp_420_cube_Sum
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the cube sum of first n even natural numbers. public static long cubeSum(long n) { } pu...
multipl-e_mbpp-java_data_mbpp_421_concatenate_tuple
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to concatenate each element of pair by the delimiter. public static String concatenateTuple(Pair<String, String, L...
multipl-e_mbpp-java_data_mbpp_422_find_Average_Of_Cube
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the average of cubes of first n natural numbers. public static float findAverageOfCube(long n) { ...
multipl-e_mbpp-java_data_mbpp_424_extract_rear
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to extract only the rear index element of each string in the given pair. public static ArrayList<String> extractRe...
multipl-e_mbpp-java_data_mbpp_425_count_element_in_list
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to count the number of subarray lists containing a particular element. public static long countElementInList(Array...
multipl-e_mbpp-java_data_mbpp_426_filter_oddnumbers
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to filter odd numbers. public static ArrayList<Long> filterOddnumbers(ArrayList<Long> nums) { } public s...
multipl-e_mbpp-java_data_mbpp_427_change_date_format
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format. public static String changeDateFormat(String dt) { ...
multipl-e_mbpp-java_data_mbpp_428_shell_sort
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to sort the given array array list by using shell sort. public static ArrayList<Long> shellSort(ArrayList<Long> my...
multipl-e_mbpp-java_data_mbpp_429_and_tuples
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to extract the elementwise and pairs from the given two pairs. public static Pair<Long, Long, Long, Long> andTuple...
multipl-e_mbpp-java_data_mbpp_430_parabola_directrix
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the directrix of a parabola. public static long parabolaDirectrix(long a, long b, long c) { } pu...
multipl-e_mbpp-java_data_mbpp_431_common_element
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that takes two array lists and returns true if they have at least one common element. public static Optional<Boole...
multipl-e_mbpp-java_data_mbpp_432_median_trapezium
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the median length of a trapezium. public static float medianTrapezium(long base1, long base2, long height)...
multipl-e_mbpp-java_data_mbpp_433_check_greater
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to check whether the entered number is greater than the elements of the given array array list. public static bool...
multipl-e_mbpp-java_data_mbpp_434_text_match_one
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function that matches a string that has an a followed by one or more b's. public static boolean textMatchOne(String text) {...
multipl-e_mbpp-java_data_mbpp_435_last_Digit
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to find the last digit of a given number. public static long lastDigit(long n) { } public stati...
multipl-e_mbpp-java_data_mbpp_436_neg_nos
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a javathon function to return the negative numbers in an array array list. public static ArrayList<Long> negNos(ArrayList<Lon...
multipl-e_mbpp-java_data_mbpp_437_remove_odd
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to remove odd characters in a string. public static String removeOdd(String str1) { } public static void...
multipl-e_mbpp-java_data_mbpp_438_count_bidirectional
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to count bidirectional pair pairs. public static long countBidirectional(ArrayList<Pair<Long, Long>> test_list) { ...
multipl-e_mbpp-java_data_mbpp_439_multiple_to_single
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to join an array array list of multiple integers into a single integer. public static long multipleToSingle(ArrayL...
multipl-e_mbpp-java_data_mbpp_440_find_adverb_position
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the first adverb and their positions in a given sentence. public static Pair<Long, Long, String> findAdver...
multipl-e_mbpp-java_data_mbpp_441_surfacearea_cube
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the surface area of a cube of a given size. public static long surfaceareaCube(long l) { } publi...
multipl-e_mbpp-java_data_mbpp_442_positive_count
import java.util.*; import java.lang.reflect.*; import org.javatuples.*; import java.security.*; import java.math.*; import java.io.*; import java.util.stream.*; class Problem { // Write a function to find the ration of positive numbers in an array array list of integers. public static float positiveCount(Array...