id stringlengths 37 65 | content stringlengths 450 3.71k |
|---|---|
multipl-e_mbpp-java_data_mbpp_3_is_not_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 javathon function to identify non-prime numbers.
public static boolean isNotPrime(long n) {
}
public static void ... |
multipl-e_mbpp-java_data_mbpp_4_heap_queue_largest | 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 largest integers from a given array list of numbers, returned in descending order.
public static Arr... |
multipl-e_mbpp-java_data_mbpp_6_differ_At_One_Bit_Pos | 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 the two numbers differ at one bit position only or not.
public static boolean differAtOn... |
multipl-e_mbpp-java_data_mbpp_8_square_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 function to find squares of individual elements in an array array list.
public static ArrayList<Long> squareNums(ArrayList<... |
multipl-e_mbpp-java_data_mbpp_9_find_Rotations | 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 number of rotations (greater than 0) required to get the same string.
public static l... |
multipl-e_mbpp-java_data_mbpp_11_remove_Occ | 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 first and last occurrence of a given character from the string.
public static String removeOcc(... |
multipl-e_mbpp-java_data_mbpp_12_sort_matrix | 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 a given matrix in ascending order according to the sum of its rows.
public static ArrayList<ArrayList<Long... |
multipl-e_mbpp-java_data_mbpp_14_find_Volume | 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 volume of a triangular prism.
public static long findVolume(long l, long b, long h) {
}... |
multipl-e_mbpp-java_data_mbpp_16_text_lowercase_underscore | 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 that returns true if the input string contains sequences of lowercase letters joined with an underscore and false o... |
multipl-e_mbpp-java_data_mbpp_17_square_perimeter | 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 returns the perimeter of a square given its side length as input.
public static long squarePerimeter(long a) ... |
multipl-e_mbpp-java_data_mbpp_18_remove_dirty_chars | 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 characters from the first string which are present in the second string.
public static String removeDirt... |
multipl-e_mbpp-java_data_mbpp_19_test_duplicate | 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 whether a given array array list of integers contains any duplicate element.
public static boolean testDup... |
multipl-e_mbpp-java_data_mbpp_20_is_woodall | 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 the given number is woodball or not.
public static boolean isWoodall(long x) {
}
public stat... |
multipl-e_mbpp-java_data_mbpp_56_checks | 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 a given number is one less than twice its reverse.
public static boolean checks(long n) {
... |
multipl-e_mbpp-java_data_mbpp_57_find_Max_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 javathon function to find the largest number that can be formed with the given array list of digits.
public static long fin... |
multipl-e_mbpp-java_data_mbpp_58_opposite_Signs | 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 the given two integers have opposite sign or not.
public static boolean oppositeSigns(lo... |
multipl-e_mbpp-java_data_mbpp_59_is_octagonal | 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 octagonal number.
public static long isOctagonal(long n) {
}
public static void main(Str... |
multipl-e_mbpp-java_data_mbpp_61_count_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 substrings with the sum of digits equal to their length.
public static long countS... |
multipl-e_mbpp-java_data_mbpp_62_smallest_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 javathon function to find smallest number in an array array list.
public static long smallestNum(ArrayList<Long> xs) {
... |
multipl-e_mbpp-java_data_mbpp_63_max_difference | 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 difference between available pairs in the given pair array list.
public static long maxDiffere... |
multipl-e_mbpp-java_data_mbpp_64_subject_marks | 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 an array array list of pairs using the second value of each pair.
public static ArrayList<Pair<String, Lon... |
multipl-e_mbpp-java_data_mbpp_66_pos_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 the number of positive numbers in an array array list.
public static long posCount(ArrayList<Lon... |
multipl-e_mbpp-java_data_mbpp_67_bell_number | 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 number of ways to partition a set of Bell numbers.
public static long bellNumber(long n) {
}
... |
multipl-e_mbpp-java_data_mbpp_68_is_Monotonic | 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 the given array array list is monotonic or not.
public static boolean isMonotonic(ArrayL... |
multipl-e_mbpp-java_data_mbpp_69_is_sublist | 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 an array array list contains the given subarray list or not.
public static boolean isSublist(Arra... |
multipl-e_mbpp-java_data_mbpp_70_get_equal | 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 whether all the given array lists have equal length or not.
public static boolean getEqual(ArrayList<Array... |
multipl-e_mbpp-java_data_mbpp_71_comb_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 an array array list of elements.
public static ArrayList<Long> combSort(ArrayList<Long> nums) {
}
... |
multipl-e_mbpp-java_data_mbpp_72_dif_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 check whether the given number can be represented as the difference of two squares or not.
public stat... |
multipl-e_mbpp-java_data_mbpp_74_is_samepatterns | 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 it follows the sequence given in the patterns array array list.
public static boolean isSamepatte... |
multipl-e_mbpp-java_data_mbpp_75_find_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 pairs which have all elements divisible by k from the given array list of pairs.
public static ArrayList<P... |
multipl-e_mbpp-java_data_mbpp_77_is_Diff | 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 a number is divisible by 11.
public static boolean isDiff(long n) {
}
public st... |
multipl-e_mbpp-java_data_mbpp_79_word_len | 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 the length of the word is odd or not.
public static boolean wordLen(String s) {
}
... |
multipl-e_mbpp-java_data_mbpp_80_tetrahedral_number | 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 tetrahedral number.
public static long tetrahedralNumber(long n) {
}
public static void ... |
multipl-e_mbpp-java_data_mbpp_83_get_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 javathon function to find the character made by adding the ASCII value of all the characters of the given string modulo 26.
... |
multipl-e_mbpp-java_data_mbpp_84_sequence | 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 number in the newman conway sequence.
public static long sequence(long n) {
}
public sta... |
multipl-e_mbpp-java_data_mbpp_86_centered_hexagonal_number | 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 nth centered hexagonal number.
public static long centeredHexagonalNumber(long n) {
}
public sta... |
multipl-e_mbpp-java_data_mbpp_87_merge_dictionaries_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 to merge three dictionaries into a single hash map.
public static HashMap<String,String> mergeDictionariesThree(Ha... |
multipl-e_mbpp-java_data_mbpp_88_freq_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 get the frequency of all the elements in an array array list, returned as a hash map.
public static HashMap<Lon... |
multipl-e_mbpp-java_data_mbpp_89_closest_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 closest smaller number than n.
public static long closestNum(long N) {
}
public static void ... |
multipl-e_mbpp-java_data_mbpp_90_len_log | 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 length of the longest word.
public static long lenLog(ArrayList<String> list1) {
}
... |
multipl-e_mbpp-java_data_mbpp_91_find_substring | 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 a string is present as a substring in a given array list of string values.
public static boolean findS... |
multipl-e_mbpp-java_data_mbpp_92_is_undulating | 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 number is undulating or not.
public static boolean isUndulating(long n) {
}
p... |
multipl-e_mbpp-java_data_mbpp_93_power | 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 value of 'a' to the power 'b'.
public static long power(long a, long b) {
}
public stat... |
multipl-e_mbpp-java_data_mbpp_94_index_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 {
// Given an array array list of pairs, write a function that returns the first value of the pair with the smallest second value.
publi... |
multipl-e_mbpp-java_data_mbpp_95_Find_Min_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 javathon function to find the length of the smallest array list in an array array list of array lists.
public static long F... |
multipl-e_mbpp-java_data_mbpp_96_divisor | 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 number of divisors of a given integer.
public static long divisor(long n) {
}
publi... |
multipl-e_mbpp-java_data_mbpp_97_frequency_lists | 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 frequency of each element in a flattened array list of array lists, returned in a hash map.
public static ... |
multipl-e_mbpp-java_data_mbpp_99_decimal_to_binary | 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 decimal number to its binary equivalent, represented as a string with no leading zeros.
publi... |
multipl-e_mbpp-java_data_mbpp_100_next_smallest_palindrome | 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 next smallest palindrome of a specified integer, returned as an integer.
public static long nextSmalle... |
multipl-e_mbpp-java_data_mbpp_101_kth_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 find the kth element in the given array array list using 1-based indexing.
public static long kthElement(ArrayL... |
multipl-e_mbpp-java_data_mbpp_102_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 a snake case string to camel case string.
public static String snakeToCamel(String word) {
}
... |
multipl-e_mbpp-java_data_mbpp_103_eulerian_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 Eulerian number a(n, m).
public static long eulerianNum(long n, long m) {
}
public static vo... |
multipl-e_mbpp-java_data_mbpp_104_sort_sublists | 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 each subarray list of strings in a given array list of array lists.
public static ArrayList<ArrayList<Stri... |
multipl-e_mbpp-java_data_mbpp_105_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 true booleans in the given array list.
public static long count(ArrayList<Boolean> lst) {
... |
multipl-e_mbpp-java_data_mbpp_106_add_lists | 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 append the given array list to the given pairs.
public static Pair<Long, Long, Long, Long, Long> addLists(Array... |
multipl-e_mbpp-java_data_mbpp_108_merge_sorted_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 merge three array lists into a single sorted array list.
public static ArrayList<Long> mergeSortedList(ArrayLis... |
multipl-e_mbpp-java_data_mbpp_109_odd_Equivalent | 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 number of numbers with an odd value when rotating a binary string the given number of times.
... |
multipl-e_mbpp-java_data_mbpp_113_check_integer | 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 a string represents an integer or not.
public static boolean checkInteger(String text) {
}
p... |
multipl-e_mbpp-java_data_mbpp_116_tuple_to_int | 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 pair of positive integers into a single integer.
public static long tupleToInt(Pair<Long, Long,... |
multipl-e_mbpp-java_data_mbpp_117_list_to_float | 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 all possible convertible elements in an array array list of array lists to floats.
public static ArrayL... |
multipl-e_mbpp-java_data_mbpp_118_string_to_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 convert a string to an array array list of strings split on the space character.
public static ArrayList<String... |
multipl-e_mbpp-java_data_mbpp_119_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 javathon function to find the element that appears only once in a sorted array array list.
public static long search(ArrayL... |
multipl-e_mbpp-java_data_mbpp_120_max_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 maximum absolute product between numbers in pairs of pairs within a given array list.
public static lo... |
multipl-e_mbpp-java_data_mbpp_123_amicable_numbers_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 sum all amicable numbers from 1 to a specified number.
public static long amicableNumbersSum(long limit) {
... |
multipl-e_mbpp-java_data_mbpp_125_find_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 maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.... |
multipl-e_mbpp-java_data_mbpp_126_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 sum of common divisors of two given numbers.
public static long sum(long a, long b) {
}... |
multipl-e_mbpp-java_data_mbpp_127_multiply_int | 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 multiply two integers.
public static long multiplyInt(long x, long y) {
}
public static void main(Str... |
multipl-e_mbpp-java_data_mbpp_128_long_words | 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 words that are longer than n characters from a given array list of words.
public static ArrayList<String> ... |
multipl-e_mbpp-java_data_mbpp_129_magic_square_test | 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 whether the matrix is a magic square.
public static boolean magicSquareTest(ArrayList<ArrayList<Long>... |
multipl-e_mbpp-java_data_mbpp_130_max_occurrences | 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 item with maximum frequency in a given array list.
public static long maxOccurrences(ArrayList<Long> n... |
multipl-e_mbpp-java_data_mbpp_131_reverse_vowels | 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 reverse only the vowels of a given string (where y is not a vowel).
public static String reverseVowels... |
multipl-e_mbpp-java_data_mbpp_132_tup_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 convert an array array list to a string.
public static String tupString(ArrayList<String> tup1) {
}
p... |
multipl-e_mbpp-java_data_mbpp_133_sum_negativenum | 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 sum of the negative numbers of a given array list of numbers.
public static long sumNegativenum(A... |
multipl-e_mbpp-java_data_mbpp_135_hexagonal_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 nth hexagonal number.
public static long hexagonalNum(long n) {
}
public static void main(St... |
multipl-e_mbpp-java_data_mbpp_138_is_Sum_Of_Powers_Of_Two | 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 the given number can be represented as sum of non-zero powers of 2 or not.
public static... |
multipl-e_mbpp-java_data_mbpp_141_pancake_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 an array array list of elements.
public static ArrayList<Long> pancakeSort(ArrayList<Long> nums) {
}... |
multipl-e_mbpp-java_data_mbpp_142_count_samepair | 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 number items that are identical in the same position of three given array lists.
public static long count... |
multipl-e_mbpp-java_data_mbpp_143_find_lists | 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 number of array lists present in the given array list.
public static long findLists(ArrayList<Object> Inpu... |
multipl-e_mbpp-java_data_mbpp_145_max_Abs_Diff | 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 difference between any two elements in a given array array list.
public static long m... |
multipl-e_mbpp-java_data_mbpp_160_find_solution | 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 returns integers x and y that satisfy ax + by = n as a pair, or return null if no solution exists.
public sta... |
multipl-e_mbpp-java_data_mbpp_161_remove_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 remove all elements from a given array list present in another array list.
public static ArrayList<Long> remove... |
multipl-e_mbpp-java_data_mbpp_162_sum_series | 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 sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).
public stat... |
multipl-e_mbpp-java_data_mbpp_164_are_equivalent | 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 determine if the sum of the divisors of two integers are the same.
public static boolean areEquivalent(long num... |
multipl-e_mbpp-java_data_mbpp_165_count_char_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 count the number of characters in a string that occur at the same position in the string as in the English alphabet... |
multipl-e_mbpp-java_data_mbpp_166_find_even_pair | 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 counts the number of pairs of integers in an array array list that xor to an even number.
public static long ... |
multipl-e_mbpp-java_data_mbpp_167_next_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 smallest power of 2 greater than or equal to n.
public static long nextPowerOf2(long n) {
... |
multipl-e_mbpp-java_data_mbpp_168_frequency | 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 occurrences of a number in a given array list.
public static long frequency(ArrayList<Long>... |
multipl-e_mbpp-java_data_mbpp_170_sum_range_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 sum of numbers in an array array list within a range specified by two indices.
public static long sumR... |
multipl-e_mbpp-java_data_mbpp_171_perimeter_pentagon | 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 perimeter of a regular pentagon from the length of its sides.
public static long perimeterPentagon(lon... |
multipl-e_mbpp-java_data_mbpp_172_count_occurance | 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 occurence of the string 'std' in a given string.
public static long countOccurance(String s... |
multipl-e_mbpp-java_data_mbpp_222_check_type | 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 all the elements in pair have same data type or not.
public static boolean checkType(Object test_tuple... |
multipl-e_mbpp-java_data_mbpp_223_is_majority | 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 sorted array array list, its length (n), and an element and returns whether the element is the majorit... |
multipl-e_mbpp-java_data_mbpp_224_count_Set_Bits | 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 set bits (binary digits with value 1) in a given number.
public static long countS... |
multipl-e_mbpp-java_data_mbpp_226_odd_values_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 javathon function to remove the characters which have odd index values of a given string.
public static String oddValuesStr... |
multipl-e_mbpp-java_data_mbpp_227_min_of_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 to find minimum of three numbers.
public static long minOfThree(long a, long b, long c) {
}
public stati... |
multipl-e_mbpp-java_data_mbpp_228_all_Bits_Set_In_The_Given_Range | 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 all the bits are unset in the given range or not.
public static boolean allBitsSetInTheG... |
multipl-e_mbpp-java_data_mbpp_229_re_arrange_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 that takes in an array array list and an integer n, and re-arranges the first n elements of the given array array list... |
multipl-e_mbpp-java_data_mbpp_230_replace_blank | 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 string and character, replaces blank spaces in the string with the character, and returns the string.
... |
multipl-e_mbpp-java_data_mbpp_234_volume_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 volume of a cube given its side length.
public static long volumeCube(long l) {
}
public sta... |
multipl-e_mbpp-java_data_mbpp_237_check_occurences | 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 a hash map mapping each unique pair to the number of times it o... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 9