diff --git "a/mbpp_2.json" "b/mbpp_2.json" new file mode 100644--- /dev/null +++ "b/mbpp_2.json" @@ -0,0 +1,5846 @@ +[ + { + "task_id": 1, + "function_signature": "def min_cost(cost: list[list[int]], m: int, n: int) -> int:", + "text": "Write a function to find the minimum cost path to reach (m, n) from (0, 0) for the given cost matrix cost[][] and a position (m, n) in cost[][].", + "test_case": "assert min_cost([[1, 2, 3], [4, 8, 2], [1, 5, 3]], 2, 2) == 8" + }, + { + "task_id": 2, + "function_signature": "def similar_elements(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to find the similar elements from the given two tuple lists.", + "test_case": "assert similar_elements((3, 4, 5, 6),(5, 7, 4, 10)) == (4, 5)" + }, + { + "task_id": 3, + "function_signature": "def is_not_prime(n: int) -> bool:", + "text": "Write a python function to identify non-prime numbers.", + "test_case": "assert is_not_prime(2) == False" + }, + { + "task_id": 4, + "function_signature": "def heap_queue_largest(nums: list[int], n: int) -> list[int]:", + "text": "Write a function to find the largest integers from a given list of numbers using heap queue algorithm.", + "test_case": "assert heap_queue_largest( [25, 35, 22, 85, 14, 65, 75, 22, 58],3)==[85, 75, 65] " + }, + { + "task_id": 5, + "function_signature": "def count_ways(n: int) -> int:", + "text": "Write a function to find the number of ways to fill it with 2 x 1 dominoes for the given 3 x n board.", + "test_case": "assert count_ways(2) == 3" + }, + { + "task_id": 6, + "function_signature": "def differ_At_One_Bit_Pos(a: int, b: int) -> bool:", + "text": "Write a python function to check whether the two numbers differ at one bit position only or not.", + "test_case": "assert differ_At_One_Bit_Pos(13,9) == True" + }, + { + "task_id": 7, + "function_signature": "def find_char_long(text: str) -> list[str]:", + "text": "Write a function to find all words which are at least 4 characters long in a string by using regex.", + "test_case": "assert find_char_long('Please move back to stream') == ['Please', 'move', 'back', 'stream']" + }, + { + "task_id": 8, + "function_signature": "def square_nums(nums: list[int]) -> list[int]:", + "text": "Write a function to find squares of individual elements in a list using lambda function.", + "test_case": "assert square_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" + }, + { + "task_id": 9, + "function_signature": "def find_Rotations(str: str) -> int:", + "text": "Write a python function to find the minimum number of rotations required to get the same string.", + "test_case": "assert find_Rotations(\"aaaa\") == 1" + }, + { + "task_id": 10, + "function_signature": "def small_nnum(list1: list[int], n: int) -> list[int]:", + "text": "Write a function to get the n smallest items from a dataset.", + "test_case": "assert small_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[10,20]" + }, + { + "task_id": 11, + "function_signature": "def remove_Occ(s: str, ch: str) -> str:", + "text": "Write a python function to remove first and last occurrence of a given character from the string.", + "test_case": "assert remove_Occ(\"hello\",\"l\") == \"heo\"" + }, + { + "task_id": 12, + "function_signature": "def sort_matrix(M: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to sort a given matrix in ascending order according to the sum of its rows.", + "test_case": "assert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]" + }, + { + "task_id": 13, + "function_signature": "def count_common(words: list[str]) -> list[tuple[str, ...]]:", + "text": "Write a function to count the most common words in a dictionary.", + "test_case": "assert count_common(['red','green','black','pink','black','white','black','eyes','white','black','orange','pink','pink','red','red','white','orange','white',\"black\",'pink','green','green','pink','green','pink','white','orange',\"orange\",'red']) == [('pink', 6), ('black', 5), ('white', 5), ('red', 4)]" + }, + { + "task_id": 14, + "function_signature": "def find_Volume(None: int) -> int:", + "text": "Write a python function to find the volume of a triangular prism.", + "test_case": "assert find_Volume(10,8,6) == 240" + }, + { + "task_id": 15, + "function_signature": "def split_lowerstring(text: str) -> list[str]:", + "text": "Write a function to split a string at lowercase letters.", + "test_case": "assert split_lowerstring(\"AbCd\")==['bC','d']" + }, + { + "task_id": 16, + "function_signature": "def text_lowercase_underscore(text: str) -> str:", + "text": "Write a function to find sequences of lowercase letters joined with an underscore.", + "test_case": "assert text_lowercase_underscore(\"aab_cbbbc\")==('Found a match!')" + }, + { + "task_id": 17, + "function_signature": "def square_perimeter(a: int) -> int:", + "text": "Write a function to find the perimeter of a square.", + "test_case": "assert square_perimeter(10)==40" + }, + { + "task_id": 18, + "function_signature": "def remove_dirty_chars(string: str, second_string: str) -> str:", + "text": "Write a function to remove characters from the first string which are present in the second string.", + "test_case": "assert remove_dirty_chars(\"probasscurve\", \"pros\") == 'bacuve'" + }, + { + "task_id": 19, + "function_signature": "def test_duplicate(arraynums: list[int]) -> bool:", + "text": "Write a function to find whether a given array of integers contains any duplicate element.", + "test_case": "assert test_duplicate(([1,2,3,4,5]))==False" + }, + { + "task_id": 20, + "function_signature": "def is_woodall(x: int) -> bool:", + "text": "Write a function to check if the given number is woodball or not.", + "test_case": "assert is_woodall(383) == True" + }, + { + "task_id": 21, + "function_signature": "def multiples_of_num(m: int, n: int) -> list[int]:", + "text": "Write a function to find m number of multiples of n.", + "test_case": "assert multiples_of_num(4,3)== [3,6,9,12]" + }, + { + "task_id": 22, + "function_signature": "def find_first_duplicate(nums: list[int]) -> int:", + "text": "Write a function to find the first duplicate element in a given array of integers.", + "test_case": "assert find_first_duplicate(([1, 2, 3, 4, 4, 5]))==4" + }, + { + "task_id": 23, + "function_signature": "def maximum_Sum(list1: list[list[int]]) -> int:", + "text": "Write a python function to find the maximum sum of elements of list in a list of lists.", + "test_case": "assert maximum_Sum([[1,2,3],[4,5,6],[10,11,12],[7,8,9]]) == 33" + }, + { + "task_id": 24, + "function_signature": "def binary_to_decimal(binary: int) -> int:", + "text": "Write a function to convert the given binary number to its decimal equivalent.", + "test_case": "assert binary_to_decimal(100) == 4" + }, + { + "task_id": 25, + "function_signature": "def find_Product(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the product of non-repeated elements in a given array.", + "test_case": "assert find_Product([1,1,2,3],4) == 6" + }, + { + "task_id": 26, + "function_signature": "def check_k_elements(test_list: list[tuple[int, ...]], K: int) -> bool:", + "text": "Write a function to check if the given tuple list has all k elements.", + "test_case": "assert check_k_elements([(4, 4), (4, 4, 4), (4, 4), (4, 4, 4, 4), (4, )], 4) == True" + }, + { + "task_id": 27, + "function_signature": "def remove(list: list[str]) -> list[str]:", + "text": "Write a python function to remove all digits from a list of strings.", + "test_case": "assert remove(['4words', '3letters', '4digits']) == ['words', 'letters', 'digits']" + }, + { + "task_id": 28, + "function_signature": "def binomial_Coeff(n: int, k: int) -> int:", + "text": "Write a python function to find binomial co-efficient.", + "test_case": "assert binomial_Coeff(5,2) == 10" + }, + { + "task_id": 29, + "function_signature": "def get_Odd_Occurrence(arr: list[int], arr_size: int) -> int:", + "text": "Write a python function to find the element occurring odd number of times.", + "test_case": "assert get_Odd_Occurrence([1,2,3,1,2,3,1],7) == 1" + }, + { + "task_id": 30, + "function_signature": "def count_Substring_With_Equal_Ends(s: str) -> int:", + "text": "Write a python function to count all the substrings starting and ending with same characters.", + "test_case": "assert count_Substring_With_Equal_Ends(\"abc\") == 3" + }, + { + "task_id": 31, + "function_signature": "def func(nums: list[list[int]], k: int) -> list[int]:", + "text": "Write a function to find the top k integers that occur most frequently from given lists of sorted and distinct integers using heap queue algorithm.", + "test_case": "assert func([[1, 2, 6], [1, 3, 4, 5, 7, 8], [1, 3, 5, 6, 8, 9], [2, 5, 7, 11], [1, 4, 7, 8, 12]],3)==[5, 7, 1]" + }, + { + "task_id": 32, + "function_signature": "def max_Prime_Factors(n: int) -> int:", + "text": "Write a python function to find the largest prime factor of a given number.", + "test_case": "assert max_Prime_Factors(15) == 5" + }, + { + "task_id": 33, + "function_signature": "def decimal_To_Binary(N: int) -> int:", + "text": "Write a python function to convert a decimal number to binary number.", + "test_case": "assert decimal_To_Binary(10) == 1010" + }, + { + "task_id": 34, + "function_signature": "def find_missing(ar: list[int], N: int) -> int:", + "text": "Write a python function to find the missing number in a sorted array.", + "test_case": "assert find_missing([1,2,3,5],4) == 4" + }, + { + "task_id": 35, + "function_signature": "def find_rect_num(n: int) -> int:", + "text": "Write a function to find the n-th rectangular number.", + "test_case": "assert find_rect_num(4) == 20" + }, + { + "task_id": 36, + "function_signature": "def find_Nth_Digit(None: int) -> int:", + "text": "Write a python function to find the nth digit in the proper fraction of two given numbers.", + "test_case": "assert find_Nth_Digit(1,2,1) == 5" + }, + { + "task_id": 37, + "function_signature": "def sort_mixed_list(mixed_list: list[int]) -> list[int]:", + "text": "Write a function to sort a given mixed list of integers and strings.", + "test_case": "assert sort_mixed_list([19,'red',12,'green','blue', 10,'white','green',1])==[1, 10, 12, 19, 'blue', 'green', 'green', 'red', 'white']" + }, + { + "task_id": 38, + "function_signature": "def div_even_odd(list1: list[int]) -> int:", + "text": "Write a function to find the division of first even and odd number of a given list.", + "test_case": "assert div_even_odd([1,3,5,7,4,1,6,8])==4" + }, + { + "task_id": 39, + "function_signature": "def rearange_string(S: str) -> str:", + "text": "Write a function to check if the letters of a given string can be rearranged so that two characters that are adjacent to each other are different.", + "test_case": "assert rearange_string(\"aab\")==('aba')" + }, + { + "task_id": 40, + "function_signature": "def freq_element(nums: list[list[int]]) -> dict:", + "text": "Write a function to find frequency of the elements in a given list of lists using collections module.", + "test_case": "assert freq_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]])==({2: 3, 1: 2, 5: 2, 3: 1, 4: 1, 6: 1, 7: 1, 9: 1})" + }, + { + "task_id": 41, + "function_signature": "def filter_evennumbers(nums: list[int]) -> list[int]:", + "text": "Write a function to filter even numbers using lambda function.", + "test_case": "assert filter_evennumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[2, 4, 6, 8, 10]" + }, + { + "task_id": 42, + "function_signature": "def find_Sum(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the sum of repeated elements in a given array.", + "test_case": "assert find_Sum([1,2,3,1,1,4,5,6],8) == 3" + }, + { + "task_id": 43, + "function_signature": "def text_match(text: str) -> str:", + "text": "Write a function to find sequences of lowercase letters joined with an underscore using regex.", + "test_case": "assert text_match(\"aab_cbbbc\") == 'Found a match!'" + }, + { + "task_id": 44, + "function_signature": "def text_match_string(text: str) -> str:", + "text": "Write a function that matches a word at the beginning of a string.", + "test_case": "assert text_match_string(\" python\")==('Not matched!')" + }, + { + "task_id": 45, + "function_signature": "def get_gcd(l: list[int]) -> int:", + "text": "Write a function to find the gcd of the given array elements.", + "test_case": "assert get_gcd([2, 4, 6, 8, 16]) == 2" + }, + { + "task_id": 46, + "function_signature": "def test_distinct(data: list[int]) -> bool:", + "text": "Write a python function to determine whether all the numbers are different from each other are not.", + "test_case": "assert test_distinct([1,5,7,9]) == True" + }, + { + "task_id": 47, + "function_signature": "def compute_Last_Digit(A: int, B: int) -> int:", + "text": "Write a python function to find the last digit when factorial of a divides factorial of b.", + "test_case": "assert compute_Last_Digit(2,4) == 2" + }, + { + "task_id": 48, + "function_signature": "def odd_bit_set_number(n: int) -> int:", + "text": "Write a python function to set all odd bits of a given number.", + "test_case": "assert odd_bit_set_number(10) == 15" + }, + { + "task_id": 49, + "function_signature": "def specified_element(nums: list[list[int]], N: int) -> list[int]:", + "text": "Write a function to extract every first or specified element from a given two-dimensional list.", + "test_case": "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]" + }, + { + "task_id": 50, + "function_signature": "def min_length_list(input_list: list[list[int]]) -> tuple[int, ...]:", + "text": "Write a function to find the list with minimum length using lambda function.", + "test_case": "assert min_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(1, [0])" + }, + { + "task_id": 51, + "function_signature": "def check_equilateral(x: int, y: int, z: int) -> bool:", + "text": "Write a function to print check if the triangle is equilateral or not.", + "test_case": "assert check_equilateral(6,8,12)==False " + }, + { + "task_id": 52, + "function_signature": "def parallelogram_area(b: int, h: int) -> int:", + "text": "Write a function to caluclate area of a parallelogram.", + "test_case": "assert parallelogram_area(10,20)==200" + }, + { + "task_id": 53, + "function_signature": "def check_Equality(str: str) -> str:", + "text": "Write a python function to check whether the first and last characters of a given string are equal or not.", + "test_case": "assert check_Equality(\"abcda\") == \"Equal\"" + }, + { + "task_id": 54, + "function_signature": "def counting_sort(my_list: list[int]) -> list[int]:", + "text": "Write a function to sort the given array by using counting sort.", + "test_case": "assert counting_sort([1,23,4,5,6,7,8]) == [1, 4, 5, 6, 7, 8, 23]" + }, + { + "task_id": 55, + "function_signature": "def tn_gp(a: int, n: int, r: int) -> int:", + "text": "Write a function to find t-nth term of geometric series.", + "test_case": "assert tn_gp(1,5,2)==16" + }, + { + "task_id": 56, + "function_signature": "def check(n: int) -> bool:", + "text": "Write a python function to check if a given number is one less than twice its reverse.", + "test_case": "assert check(70) == False" + }, + { + "task_id": 57, + "function_signature": "def find_Max_Num(None: list[int]) -> int:", + "text": "Write a python function to find the largest number that can be formed with the given digits.", + "test_case": "assert find_Max_Num([1,2,3],3) == 321" + }, + { + "task_id": 58, + "function_signature": "def opposite_Signs(x: int, y: int) -> bool:", + "text": "Write a python function to check whether the given two integers have opposite sign or not.", + "test_case": "assert opposite_Signs(1,-2) == True" + }, + { + "task_id": 59, + "function_signature": "def is_octagonal(n: int) -> int:", + "text": "Write a function to find the nth octagonal number.", + "test_case": "assert is_octagonal(5) == 65" + }, + { + "task_id": 60, + "function_signature": "def max_len_sub(arr: list[int], n: int) -> int:", + "text": "Write a function to find the maximum length of the subsequence with difference between adjacent elements for the given array.", + "test_case": "assert max_len_sub([2, 5, 6, 3, 7, 6, 5, 8], 8) == 5" + }, + { + "task_id": 61, + "function_signature": "def count_Substrings(s: str, n: int) -> int:", + "text": "Write a python function to count number of substrings with the sum of digits equal to their length.", + "test_case": "assert count_Substrings('112112',6) == 6" + }, + { + "task_id": 62, + "function_signature": "def smallest_num(xs: list[int]) -> int:", + "text": "Write a python function to find smallest number in a list.", + "test_case": "assert smallest_num([10, 20, 1, 45, 99]) == 1" + }, + { + "task_id": 63, + "function_signature": "def max_difference(test_list: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the maximum difference between available pairs in the given tuple list.", + "test_case": "assert max_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 7" + }, + { + "task_id": 64, + "function_signature": "def subject_marks(subjectmarks: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to sort a list of tuples using lambda.", + "test_case": "assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)])==[('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]" + }, + { + "task_id": 65, + "function_signature": "def recursive_list_sum(data_list: list[int]) -> int:", + "text": "Write a function of recursion list sum.", + "test_case": "assert recursive_list_sum(([1, 2, [3,4],[5,6]]))==21" + }, + { + "task_id": 66, + "function_signature": "def pos_count(list: list[int]) -> int:", + "text": "Write a python function to count positive numbers in a list.", + "test_case": "assert pos_count([1,-2,3,-4]) == 2" + }, + { + "task_id": 67, + "function_signature": "def bell_number(n: int) -> int:", + "text": "Write a function to find the number of ways to partition a set of bell numbers.", + "test_case": "assert bell_number(2)==2" + }, + { + "task_id": 68, + "function_signature": "def is_Monotonic(A: list[int]) -> bool:", + "text": "Write a python function to check whether the given array is monotonic or not.", + "test_case": "assert is_Monotonic([6, 5, 4, 4]) == True" + }, + { + "task_id": 69, + "function_signature": "def is_sublist(l: list[int], s: list[int]) -> bool:", + "text": "Write a function to check whether a list contains the given sublist or not.", + "test_case": "assert is_sublist([2,4,3,5,7],[3,7])==False" + }, + { + "task_id": 70, + "function_signature": "def get_equal(Input: list[tuple[int, ...]], k: int) -> str:", + "text": "Write a function to find whether all the given tuples have equal length or not.", + "test_case": "assert get_equal([(11, 22, 33), (44, 55, 66)], 3) == 'All tuples have same length'" + }, + { + "task_id": 71, + "function_signature": "def comb_sort(nums: list[int]) -> list[int]:", + "text": "Write a function to sort a list of elements using comb sort.", + "test_case": "assert comb_sort([5, 15, 37, 25, 79]) == [5, 15, 25, 37, 79]" + }, + { + "task_id": 72, + "function_signature": "def dif_Square(n: int) -> bool:", + "text": "Write a python function to check whether the given number can be represented as difference of two squares or not.", + "test_case": "assert dif_Square(5) == True" + }, + { + "task_id": 73, + "function_signature": "def multiple_split(text: str) -> list[str]:", + "text": "Write a function to split the given string with multiple delimiters by using regex.", + "test_case": "assert multiple_split('Forces of the \\ndarkness*are coming into the play.') == ['Forces of the ', 'darkness', 'are coming into the play.']" + }, + { + "task_id": 74, + "function_signature": "def is_samepatterns(colors: list[str], patterns: list[str]) -> bool:", + "text": "Write a function to check whether it follows the sequence given in the patterns array.", + "test_case": "assert is_samepatterns([\"red\",\"green\",\"green\"], [\"a\", \"b\", \"b\"])==True " + }, + { + "task_id": 75, + "function_signature": "def find_tuples(test_list: list[tuple[int, ...]], K: int) -> str:", + "text": "Write a function to find tuples which have all elements divisible by k from the given list of tuples.", + "test_case": "assert find_tuples([(6, 24, 12), (7, 9, 6), (12, 18, 21)], 6) == '[(6, 24, 12)]'" + }, + { + "task_id": 76, + "function_signature": "def count_Squares(m: int, n: int) -> int:", + "text": "Write a python function to count the number of squares in a rectangle.", + "test_case": "assert count_Squares(4,3) == 20" + }, + { + "task_id": 77, + "function_signature": "def is_Diff(n):", + "text": "Write a python function to find the difference between sum of even and odd digits.", + "test_case": "assert is_Diff (12345) == False" + }, + { + "task_id": 78, + "function_signature": "def count_With_Odd_SetBits(n: int) -> int:", + "text": "Write a python function to find number of integers with odd number of set bits.", + "test_case": "assert count_With_Odd_SetBits(5) == 3" + }, + { + "task_id": 79, + "function_signature": "def word_len(s: str) -> bool:", + "text": "Write a python function to check whether the length of the word is odd or not.", + "test_case": "assert word_len(\"Hadoop\") == False" + }, + { + "task_id": 80, + "function_signature": "def tetrahedral_number(n: int) -> float:", + "text": "Write a function to find the nth tetrahedral number.", + "test_case": "assert tetrahedral_number(5) == 35.0" + }, + { + "task_id": 81, + "function_signature": "def zip_tuples(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> list[tuple[int, ...]]:", + "text": "Write a function to zip the two given tuples.", + "test_case": "assert zip_tuples((7, 8, 4, 5, 9, 10),(1, 5, 6) ) == [(7, 1), (8, 5), (4, 6), (5, 1), (9, 5), (10, 6)]" + }, + { + "task_id": 82, + "function_signature": "def volume_sphere(r: int) -> float:", + "text": "Write a function to find the volume of a sphere.", + "test_case": "assert volume_sphere(10)==4188.790204786391" + }, + { + "task_id": 83, + "function_signature": "def get_Char(strr: str) -> str:", + "text": "Write a python function to find the character made by adding all the characters of the given string.", + "test_case": "assert get_Char(\"abc\") == \"f\"" + }, + { + "task_id": 84, + "function_signature": "def sequence(n: int) -> int:", + "text": "Write a function to find the n-th number in newman conway sequence.", + "test_case": "assert sequence(10) == 6" + }, + { + "task_id": 85, + "function_signature": "def surfacearea_sphere(r: int) -> float:", + "text": "Write a function to find the surface area of a sphere.", + "test_case": "assert surfacearea_sphere(10)==1256.6370614359173" + }, + { + "task_id": 86, + "function_signature": "def centered_hexagonal_number(n: int) -> int:", + "text": "Write a function to find nth centered hexagonal number.", + "test_case": "assert centered_hexagonal_number(10) == 271" + }, + { + "task_id": 87, + "function_signature": "def merge_dictionaries_three(dict1: dict, dict2: dict, dict3: dict) -> dict:", + "text": "Write a function to merge three dictionaries into a single expression.", + "test_case": "assert merge_dictionaries_three({ \"R\": \"Red\", \"B\": \"Black\", \"P\": \"Pink\" }, { \"G\": \"Green\", \"W\": \"White\" },{ \"O\": \"Orange\", \"W\": \"White\", \"B\": \"Black\" })=={'B': 'Black', 'R': 'Red', 'P': 'Pink', 'G': 'Green', 'W': 'White', 'O': 'Orange'}" + }, + { + "task_id": 88, + "function_signature": "def freq_count(list1: list[int]) -> dict:", + "text": "Write a function to get the frequency of the elements in a list.", + "test_case": "assert freq_count([10,10,10,10,20,20,20,20,40,40,50,50,30])==({10: 4, 20: 4, 40: 2, 50: 2, 30: 1}) " + }, + { + "task_id": 89, + "function_signature": "def closest_num(N: int) -> int:", + "text": "Write a function to find the closest smaller number than n.", + "test_case": "assert closest_num(11) == 10" + }, + { + "task_id": 90, + "function_signature": "def len_log(list1: list[str]) -> int:", + "text": "Write a python function to find the length of the longest word.", + "test_case": "assert len_log([\"python\",\"PHP\",\"bigdata\"]) == 7" + }, + { + "task_id": 91, + "function_signature": "def find_substring(str1: list[str], sub_str: str) -> bool:", + "text": "Write a function to check if a substring is present in a given list of string values.", + "test_case": "assert find_substring([\"red\", \"black\", \"white\", \"green\", \"orange\"],\"ack\")==True" + }, + { + "task_id": 92, + "function_signature": "def is_undulating(n: str) -> bool:", + "text": "Write a function to check whether the given number is undulating or not.", + "test_case": "assert is_undulating(\"1212121\") == True" + }, + { + "task_id": 93, + "function_signature": "def power(a: int, b: int) -> int:", + "text": "Write a function to calculate the value of 'a' to the power 'b'.", + "test_case": "assert power(3,4) == 81" + }, + { + "task_id": 94, + "function_signature": "def index_minimum(test_list: list[tuple[str, ...]]) -> str:", + "text": "Write a function to extract the index minimum value record from the given tuples.", + "test_case": "assert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'" + }, + { + "task_id": 95, + "function_signature": "def Find_Min_Length(lst: list[list[int]]) -> int:", + "text": "Write a python function to find the minimum length of sublist.", + "test_case": "assert Find_Min_Length([[1],[1,2]]) == 1" + }, + { + "task_id": 96, + "function_signature": "def divisor(n: int) -> int:", + "text": "Write a python function to find the number of divisors of a given integer.", + "test_case": "assert divisor(15) == 4 " + }, + { + "task_id": 97, + "function_signature": "def frequency_lists(list1: list[list[int]]) -> dict:", + "text": "Write a function to find frequency count of list of lists.", + "test_case": "assert frequency_lists([[1, 2, 3, 2], [4, 5, 6, 2], [7, 8, 9, 5]])=={1: 1, 2: 3, 3: 1, 4: 1, 5: 2, 6: 1, 7: 1, 8: 1, 9: 1}" + }, + { + "task_id": 98, + "function_signature": "def multiply_num(numbers: tuple[int, ...]) -> float:", + "text": "Write a function to multiply all the numbers in a list and divide with the length of the list.", + "test_case": "assert multiply_num((8, 2, 3, -1, 7))==-67.2" + }, + { + "task_id": 99, + "function_signature": "def decimal_to_binary(n: int) -> str:", + "text": "Write a function to convert the given decimal number to its binary equivalent.", + "test_case": "assert decimal_to_binary(8) == '1000'" + }, + { + "task_id": 100, + "function_signature": "def next_smallest_palindrome(num: int) -> int:", + "text": "Write a function to find the next smallest palindrome of a specified number.", + "test_case": "assert next_smallest_palindrome(99)==101" + }, + { + "task_id": 101, + "function_signature": "def kth_element(arr: list[int], n: int, k: int) -> int:", + "text": "Write a function to find the kth element in the given array.", + "test_case": "assert kth_element([12,3,5,7,19], 5, 2) == 3" + }, + { + "task_id": 102, + "function_signature": "def snake_to_camel(word: str) -> str:", + "text": "Write a function to convert snake case string to camel case string.", + "test_case": "assert snake_to_camel('python_program')=='PythonProgram'" + }, + { + "task_id": 103, + "function_signature": "def eulerian_num(n: int, m: int) -> int:", + "text": "Write a function to find eulerian number a(n, m).", + "test_case": "assert eulerian_num(3, 1) == 4" + }, + { + "task_id": 104, + "function_signature": "def sort_sublists(input_list: tuple[list[str], ...]) -> list[list[str]]:", + "text": "Write a function to sort each sublist of strings in a given list of lists using lambda function.", + "test_case": "assert sort_sublists(([\"green\", \"orange\"], [\"black\", \"white\"], [\"white\", \"black\", \"orange\"]))==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]" + }, + { + "task_id": 105, + "function_signature": "def count(lst: list[bool]) -> int:", + "text": "Write a python function to count true booleans in the given list.", + "test_case": "assert count([True,False,True]) == 2" + }, + { + "task_id": 106, + "function_signature": "def add_lists(test_list: list[int], test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to add the given list to the given tuples.", + "test_case": "assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7)" + }, + { + "task_id": 107, + "function_signature": "def count_Hexadecimal(None: int) -> int:", + "text": "Write a python function to count hexadecimal numbers for a given range.", + "test_case": "assert count_Hexadecimal(10,15) == 6" + }, + { + "task_id": 108, + "function_signature": "def merge_sorted_list(num1: list[int], num2: list[int], num3: list[int]) -> list[int]:", + "text": "Write a function to merge multiple sorted inputs into a single sorted iterator using heap queue algorithm.", + "test_case": "assert merge_sorted_list([25, 24, 15, 4, 5, 29, 110],[19, 20, 11, 56, 25, 233, 154],[24, 26, 54, 48])==[4, 5, 11, 15, 19, 20, 24, 24, 25, 25, 26, 29, 48, 54, 56, 110, 154, 233]" + }, + { + "task_id": 109, + "function_signature": "def odd_Equivalent(s: str, n: int) -> int:", + "text": "Write a python function to find the count of rotations of a binary string with odd value.", + "test_case": "assert odd_Equivalent(\"011001\",6) == 3" + }, + { + "task_id": 110, + "function_signature": "def extract_missing(test_list: list[tuple[int, ...]], strt_val: int, stop_val: int) -> list[tuple[int, ...]]:", + "text": "Write a function to extract the ranges that are missing from the given list with the given start range and end range values.", + "test_case": "assert extract_missing([(6, 9), (15, 34), (48, 70)], 2, 100) == [(2, 6), (9, 100), (9, 15), (34, 100), (34, 48), (70, 100)]" + }, + { + "task_id": 111, + "function_signature": "def common_in_nested_lists(nestedlist: list[list[int]]) -> list[int]:", + "text": "Write a function to find common elements in given nested lists. * list item * list item * list item * list item", + "test_case": "assert common_in_nested_lists([[12, 18, 23, 25, 45], [7, 12, 18, 24, 28], [1, 5, 8, 12, 15, 16, 18]])==[18, 12]" + }, + { + "task_id": 112, + "function_signature": "def perimeter(None: int) -> int:", + "text": "Write a python function to find the perimeter of a cylinder.", + "test_case": "assert perimeter(2,4) == 12" + }, + { + "task_id": 113, + "function_signature": "def check_integer(text: str) -> bool:", + "text": "Write a function to check if a string represents an integer or not.", + "test_case": "assert check_integer(\"python\")==False" + }, + { + "task_id": 114, + "function_signature": "def assign_freq(test_list: list[tuple[int, ...]]) -> str:", + "text": "Write a function to assign frequency to each tuple in the given tuple list.", + "test_case": "assert assign_freq([(6, 5, 8), (2, 7), (6, 5, 8), (6, 5, 8), (9, ), (2, 7)] ) == '[(6, 5, 8, 3), (2, 7, 2), (9, 1)]'" + }, + { + "task_id": 115, + "function_signature": "def empty_dit(list1: list[dict]) -> bool:", + "text": "Write a function to check whether all dictionaries in a list are empty or not.", + "test_case": "assert empty_dit([{},{},{}])==True" + }, + { + "task_id": 116, + "function_signature": "def tuple_to_int(nums: tuple[int, ...]) -> int:", + "text": "Write a function to convert a given tuple of positive integers into an integer.", + "test_case": "assert tuple_to_int((1,2,3))==123" + }, + { + "task_id": 117, + "function_signature": "def list_to_float(test_list: list[tuple[str, ...]]) -> str:", + "text": "Write a function to convert all possible convertible elements in the list to float.", + "test_case": "assert list_to_float( [(\"3\", \"4\"), (\"1\", \"26.45\"), (\"7.32\", \"8\"), (\"4\", \"8\")] ) == '[(3.0, 4.0), (1.0, 26.45), (7.32, 8.0), (4.0, 8.0)]'" + }, + { + "task_id": 118, + "function_signature": "def string_to_list(string: str) -> list[str]:", + "text": "[link text](https:// [link text](https:// [link text](https://)))write a function to convert a string to a list.", + "test_case": "assert string_to_list(\"python programming\")==['python','programming']" + }, + { + "task_id": 119, + "function_signature": "def search(None: list[int]) -> int:", + "text": "Write a python function to find the element that appears only once in a sorted array.", + "test_case": "assert search([1,1,2,2,3],5) == 3" + }, + { + "task_id": 120, + "function_signature": "def max_product_tuple(list1: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the maximum product from the pairs of tuples within a given list.", + "test_case": "assert max_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==36" + }, + { + "task_id": 121, + "function_signature": "def check_triplet(A: list[int], n: int, sum: int, count: int) -> bool:", + "text": "Write a function to find the triplet with sum of the given array", + "test_case": "assert check_triplet([2, 7, 4, 0, 9, 5, 1, 3], 8, 6, 0) == True" + }, + { + "task_id": 122, + "function_signature": "def smartNumber(n: int) -> int:", + "text": "Write a function to find n’th smart number.", + "test_case": "assert smartNumber(1) == 30" + }, + { + "task_id": 123, + "function_signature": "def amicable_numbers_sum(limit: int) -> int:", + "text": "Write a function to sum all amicable numbers from 1 to a specified number.", + "test_case": "assert amicable_numbers_sum(999)==504" + }, + { + "task_id": 124, + "function_signature": "def angle_complex(a: int, b: Any) -> float:", + "text": "Write a function to get the angle of a complex number.", + "test_case": "assert angle_complex(0,1j)==1.5707963267948966 " + }, + { + "task_id": 125, + "function_signature": "def find_length(string: str, n: int) -> int:", + "text": "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.", + "test_case": "assert find_length(\"11000010001\", 11) == 6" + }, + { + "task_id": 126, + "function_signature": "def sum(a: int, b: int) -> int:", + "text": "Write a python function to find the sum of common divisors of two given numbers.", + "test_case": "assert sum(10,15) == 6" + }, + { + "task_id": 127, + "function_signature": "def multiply_int(x: int, y: int) -> int:", + "text": "Write a function to multiply two integers without using the * operator in python.", + "test_case": "assert multiply_int(10,20)==200" + }, + { + "task_id": 128, + "function_signature": "def long_words(n: int, str: str) -> list[str]:", + "text": "Write a function to shortlist words that are longer than n from a given list of words.", + "test_case": "assert long_words(3,\"python is a programming language\")==['python','programming','language']" + }, + { + "task_id": 129, + "function_signature": "def magic_square_test(my_matrix: list[list[int]]) -> bool:", + "text": "Write a function to calculate magic square.", + "test_case": "assert magic_square_test([[7, 12, 1, 14], [2, 13, 8, 11], [16, 3, 10, 5], [9, 6, 15, 4]])==True" + }, + { + "task_id": 130, + "function_signature": "def max_occurrences(nums: list[int]) -> tuple[int, ...]:", + "text": "Write a function to find the item with maximum frequency in a given list.", + "test_case": "assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,2,4,6,9,1,2])==(2, 5)" + }, + { + "task_id": 131, + "function_signature": "def reverse_vowels(str1: str) -> str:", + "text": "Write a python function to reverse only the vowels of a given string.", + "test_case": "assert reverse_vowels(\"Python\") == \"Python\"" + }, + { + "task_id": 132, + "function_signature": "def tup_string(tup1: tuple[str, ...]) -> str:", + "text": "Write a function to convert tuple to a string.", + "test_case": "assert tup_string(('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's'))==(\"exercises\")" + }, + { + "task_id": 133, + "function_signature": "def sum_negativenum(nums: list[int]) -> int:", + "text": "Write a function to calculate the sum of the negative numbers of a given list of numbers using lambda function.", + "test_case": "assert sum_negativenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==-32" + }, + { + "task_id": 134, + "function_signature": "def check_last(arr: list[int], n: int, p: int) -> str:", + "text": "Write a python function to check whether the last element of given array is even or odd after performing an operation p times.", + "test_case": "assert check_last([5,7,10],3,1) == \"ODD\"" + }, + { + "task_id": 135, + "function_signature": "def hexagonal_num(n: int) -> int:", + "text": "Write a function to find the nth hexagonal number.", + "test_case": "assert hexagonal_num(10) == 190" + }, + { + "task_id": 136, + "function_signature": "def cal_electbill(units: int) -> float:", + "text": "Write a function to calculate electricity bill.", + "test_case": "assert cal_electbill(75)==246.25" + }, + { + "task_id": 137, + "function_signature": "def zero_count(nums: list[int]) -> float:", + "text": "Write a function to find the ration of zeroes in an array of integers.", + "test_case": "assert zero_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.15" + }, + { + "task_id": 138, + "function_signature": "def is_Sum_Of_Powers_Of_Two(n: int) -> bool:", + "text": "Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.", + "test_case": "assert is_Sum_Of_Powers_Of_Two(10) == True" + }, + { + "task_id": 139, + "function_signature": "def circle_circumference(r: int) -> float:", + "text": "Write a function to find the circumference of a circle.", + "test_case": "assert circle_circumference(10)==62.830000000000005" + }, + { + "task_id": 140, + "function_signature": "def extract_singly(test_list: list[tuple[int, ...]]) -> list[int]:", + "text": "Write a function to extract elements that occur singly in the given tuple list.", + "test_case": "assert extract_singly([(3, 4, 5), (4, 5, 7), (1, 4)]) == [3, 4, 5, 7, 1]" + }, + { + "task_id": 141, + "function_signature": "def pancake_sort(nums: list[int]) -> list[int]:", + "text": "Write a function to sort a list of elements using pancake sort.", + "test_case": "assert pancake_sort([15, 79, 25, 38, 69]) == [15, 25, 38, 69, 79]" + }, + { + "task_id": 142, + "function_signature": "def count_samepair(list1: list[int], list2: list[int], list3: list[int]) -> int:", + "text": "Write a function to count the same pair in three given lists.", + "test_case": "assert count_samepair([1,2,3,4,5,6,7,8],[2,2,3,1,2,6,7,9],[2,1,3,1,2,6,7,9])==3" + }, + { + "task_id": 143, + "function_signature": "def find_lists(Input: tuple[list[int], ...]) -> int:", + "text": "Write a function to find number of lists present in the given tuple.", + "test_case": "assert find_lists(([1, 2, 3, 4], [5, 6, 7, 8])) == 2" + }, + { + "task_id": 144, + "function_signature": "def sum_Pairs(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the sum of absolute differences in all pairs of the given array.", + "test_case": "assert sum_Pairs([1,8,9,15,16],5) == 74" + }, + { + "task_id": 145, + "function_signature": "def max_Abs_Diff(arr: tuple[int, ...], n: int) -> int:", + "text": "Write a python function to find the maximum difference between any two elements in a given array.", + "test_case": "assert max_Abs_Diff((2,1,5,3),4) == 4" + }, + { + "task_id": 146, + "function_signature": "def ascii_value_string(str1: str) -> int:", + "text": "Write a function to find the ascii value of total characters in a string.", + "test_case": "assert ascii_value_string(\"python\")==112" + }, + { + "task_id": 147, + "function_signature": "def max_path_sum(tri: list[list[int]], m: int, n: int) -> int:", + "text": "Write a function to find the maximum total path sum in the given triangle.", + "test_case": "assert max_path_sum([[1, 0, 0], [4, 8, 0], [1, 5, 3]], 2, 2) == 14" + }, + { + "task_id": 148, + "function_signature": "def sum_digits_twoparts(None: int) -> int:", + "text": "Write a function to divide a number into two parts such that the sum of digits is maximum.", + "test_case": "assert sum_digits_twoparts(35)==17" + }, + { + "task_id": 149, + "function_signature": "def longest_subseq_with_diff_one(arr: list[int], n: int) -> int:", + "text": "Write a function to find the longest subsequence such that the difference between adjacents is one for the given array.", + "test_case": "assert longest_subseq_with_diff_one([1, 2, 3, 4, 5, 3, 2], 7) == 6" + }, + { + "task_id": 150, + "function_signature": "def does_Contain_B(a: int, b: int, c: int) -> bool:", + "text": "Write a python function to find whether the given number is present in the infinite sequence or not.", + "test_case": "assert does_Contain_B(1,7,3) == True" + }, + { + "task_id": 151, + "function_signature": "def is_coprime(x: int, y: int) -> bool:", + "text": "Write a python function to check whether the given number is co-prime or not.", + "test_case": "assert is_coprime(17,13) == True" + }, + { + "task_id": 152, + "function_signature": "def merge_sort(x: list[int]) -> list[int]:", + "text": "Write a function to sort the given array by using merge sort.", + "test_case": "assert merge_sort([3, 4, 2, 6, 5, 7, 1, 9]) == [1, 2, 3, 4, 5, 6, 7, 9]" + }, + { + "task_id": 153, + "function_signature": "def parabola_vertex(a: int, b: int, c: int) -> tuple[float, ...]:", + "text": "Write a function to find the vertex of a parabola.", + "test_case": "assert parabola_vertex(5,3,2)==(-0.3, 1.55)" + }, + { + "task_id": 154, + "function_signature": "def specified_element(nums: list[list[int]], N: int) -> list[int]:", + "text": "Write a function to extract every specified element from a given two dimensional list.", + "test_case": "assert specified_element([[1, 2, 3, 2], [4, 5, 6, 2], [7, 1, 9, 5]],0)==[1, 4, 7]" + }, + { + "task_id": 155, + "function_signature": "def even_bit_toggle_number(None: int) -> int:", + "text": "Write a python function to toggle all even bits of a given number.", + "test_case": "assert even_bit_toggle_number(10) == 0" + }, + { + "task_id": 156, + "function_signature": "def tuple_int_str(tuple_str: tuple[tuple[str, ...], ...]) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to convert a tuple of string values to a tuple of integer values.", + "test_case": "assert tuple_int_str((('333', '33'), ('1416', '55')))==((333, 33), (1416, 55))" + }, + { + "task_id": 157, + "function_signature": "def encode_list(list1: list[int]) -> list[list[int]]:", + "text": "Write a function to reflect the run-length encoding from a list.", + "test_case": "assert encode_list([1,1,2,3,4,4.3,5,1])==[[2, 1], [1, 2], [1, 3], [1, 4], [1, 4.3], [1, 5], [1, 1]]" + }, + { + "task_id": 158, + "function_signature": "def min_Ops(arr: list[int], n: int, k: int) -> int:", + "text": "Write a python function to find k number of operations required to make all elements equal.", + "test_case": "assert min_Ops([2,2,2,2],4,3) == 0" + }, + { + "task_id": 159, + "function_signature": "def month_season(month: str, days: int) -> str:", + "text": "Write a function to print the season for the given month and day.", + "test_case": "assert month_season('January',4)==('winter')" + }, + { + "task_id": 160, + "function_signature": "def solution(a: int, b: int, n: int) -> tuple[str, ...]:", + "text": "Write a function to find x and y that satisfies ax + by = n.", + "test_case": "assert solution(2, 3, 7) == ('x = ', 2, ', y = ', 1)" + }, + { + "task_id": 161, + "function_signature": "def remove_elements(list1: list[int], list2: list[int]) -> list[int]:", + "text": "Write a function to remove all elements from a given list present in another list.", + "test_case": "assert remove_elements([1,2,3,4,5,6,7,8,9,10],[2,4,6,8])==[1, 3, 5, 7, 9, 10]" + }, + { + "task_id": 162, + "function_signature": "def sum_series(n: int) -> int:", + "text": "Write a function to calculate the sum of the positive integers of n+(n-2)+(n-4)... (until n-x =< 0).", + "test_case": "assert sum_series(6)==12" + }, + { + "task_id": 163, + "function_signature": "def area_polygon(s: int, l: int) -> float:", + "text": "Write a function to calculate the area of a regular polygon.", + "test_case": "assert area_polygon(4,20)==400.00000000000006" + }, + { + "task_id": 164, + "function_signature": "def areEquivalent(num1: int, num2: int) -> bool:", + "text": "Write a python function to check whether the sum of divisors are same or not.", + "test_case": "assert areEquivalent(36,57) == False" + }, + { + "task_id": 165, + "function_signature": "def count_char_position(str1: str) -> int:", + "text": "Write a python function to count characters at same position in a given string (lower and uppercase characters) as in english alphabet.", + "test_case": "assert count_char_position(\"xbcefg\") == 2" + }, + { + "task_id": 166, + "function_signature": "def find_even_Pair(A: list[int], N: int) -> int:", + "text": "Write a python function to count the pairs with xor as an even number.", + "test_case": "assert find_even_Pair([5,4,7,2,1],5) == 4" + }, + { + "task_id": 167, + "function_signature": "def next_Power_Of_2(n: int) -> int:", + "text": "Write a python function to find smallest power of 2 greater than or equal to n.", + "test_case": "assert next_Power_Of_2(0) == 1" + }, + { + "task_id": 168, + "function_signature": "def frequency(a: list[int], x: int) -> int:", + "text": "Write a python function to find the frequency of a number in a given array.", + "test_case": "assert frequency([1,2,3],4) == 0" + }, + { + "task_id": 169, + "function_signature": "def get_pell(n: int) -> int:", + "text": "Write a function to calculate the nth pell number.", + "test_case": "assert get_pell(4) == 12" + }, + { + "task_id": 170, + "function_signature": "def sum_range_list(list1: list[int], m: int, n: int) -> int:", + "text": "Write a function to find sum of the numbers in a list between the indices of a specified range.", + "test_case": "assert sum_range_list( [2,1,5,6,8,3,4,9,10,11,8,12],8,10)==29" + }, + { + "task_id": 171, + "function_signature": "def perimeter_pentagon(a: int) -> int:", + "text": "Write a function to find the perimeter of a pentagon.", + "test_case": "assert perimeter_pentagon(5)==25" + }, + { + "task_id": 172, + "function_signature": "def count_occurance(s: str) -> int:", + "text": "Write a function to find the occurence of characters 'std' in the given string 1. list item 1. list item 1. list item 2. list item 2. list item 2. list item", + "test_case": "assert count_occurance(\"letstdlenstdporstd\") == 3" + }, + { + "task_id": 173, + "function_signature": "def remove_splchar(text: str) -> str:", + "text": "Write a function to remove everything except alphanumeric characters from a string.", + "test_case": "assert remove_splchar('python @#&^%$*program123')==('pythonprogram123')" + }, + { + "task_id": 174, + "function_signature": "def group_keyvalue(l: list[tuple[str, ...]]) -> dict:", + "text": "Write a function to group a sequence of key-value pairs into a dictionary of lists.", + "test_case": "assert group_keyvalue([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])=={'yellow': [1, 3], 'blue': [2, 4], 'red': [1]}" + }, + { + "task_id": 175, + "function_signature": "def is_valid_parenthese(str1: str) -> bool:", + "text": "Write a function to verify validity of a string of parentheses.", + "test_case": "assert is_valid_parenthese(\"(){}[]\")==True" + }, + { + "task_id": 176, + "function_signature": "def perimeter_triangle(a: int, b: int, c: int) -> int:", + "text": "Write a function to find the perimeter of a triangle.", + "test_case": "assert perimeter_triangle(10,20,30)==60" + }, + { + "task_id": 177, + "function_signature": "def answer(L: int, R: int) -> tuple[int, ...]:", + "text": "Write a python function to find two distinct numbers such that their lcm lies within the given range.", + "test_case": "assert answer(3,8) == (3,6)" + }, + { + "task_id": 178, + "function_signature": "def string_literals(patterns: list[str], text: str) -> str:", + "text": "Write a function to search some literals strings in a string.", + "test_case": "assert string_literals(['language'],'python language')==('Matched!')" + }, + { + "task_id": 179, + "function_signature": "def is_num_keith(x: int) -> bool:", + "text": "Write a function to find if the given number is a keith number or not.", + "test_case": "assert is_num_keith(14) == True" + }, + { + "task_id": 180, + "function_signature": "def distance_lat_long(slat: float, slon: float, elat: float, elon: float) -> float:", + "text": "Write a function to calculate distance between two points using latitude and longitude.", + "test_case": "assert distance_lat_long(23.5,67.5,25.5,69.5)==12179.372041317429" + }, + { + "task_id": 181, + "function_signature": "def common_prefix(arr: list[str], n: int) -> str:", + "text": "Write a function to find the longest common prefix in the given set of strings.", + "test_case": "assert common_prefix([\"tablets\", \"tables\", \"taxi\", \"tamarind\"], 4) == 'ta'" + }, + { + "task_id": 182, + "function_signature": "def find_character(string: str) -> tuple[list[str], ...]:", + "text": "Write a function to find uppercase, lowercase, special character and numeric values using regex.", + "test_case": "assert find_character(\"ThisIsGeeksforGeeks\") == (['T', 'I', 'G', 'G'], ['h', 'i', 's', 's', 'e', 'e', 'k', 's', 'f', 'o', 'r', 'e', 'e', 'k', 's'], [], [])" + }, + { + "task_id": 183, + "function_signature": "def count_pairs(arr: list[int], n: int, k: int) -> int:", + "text": "Write a function to count all the distinct pairs having a difference of k in any array.", + "test_case": "assert count_pairs([1, 5, 3, 4, 2], 5, 3) == 2" + }, + { + "task_id": 184, + "function_signature": "def greater_specificnum(list: list[int], num: int) -> bool:", + "text": "Write a function to find all the values in a list that are greater than a specified number.", + "test_case": "assert greater_specificnum([220, 330, 500],200)==True" + }, + { + "task_id": 185, + "function_signature": "def parabola_focus(a: int, b: int, c: int) -> tuple[float, ...]:", + "text": "Write a function to find the focus of a parabola.", + "test_case": "assert parabola_focus(5,3,2)==(-0.3, 1.6)" + }, + { + "task_id": 186, + "function_signature": "def check_literals(text: str, patterns: list[str]) -> str:", + "text": "Write a function to search some literals strings in a string by using regex.", + "test_case": "assert check_literals('The quick brown fox jumps over the lazy dog.',['fox']) == 'Matched!'" + }, + { + "task_id": 187, + "function_signature": "def longest_common_subsequence(X: str, Y: str, m: int, n: int) -> int:", + "text": "Write a function to find the longest common subsequence for the given two sequences.", + "test_case": "assert longest_common_subsequence(\"AGGTAB\" , \"GXTXAYB\", 6, 7) == 4" + }, + { + "task_id": 188, + "function_signature": "def prod_Square(n: int) -> bool:", + "text": "Write a python function to check whether the given number can be represented by product of two squares or not.", + "test_case": "assert prod_Square(25) == False" + }, + { + "task_id": 189, + "function_signature": "def first_Missing_Positive(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the first missing positive number.", + "test_case": "assert first_Missing_Positive([1,2,3,-1,5],5) == 4" + }, + { + "task_id": 190, + "function_signature": "def count_Intgral_Points(x1: int, y1: int, x2: int, y2: int) -> int:", + "text": "Write a python function to count the number of integral co-ordinates that lie inside a square.", + "test_case": "assert count_Intgral_Points(1,1,4,4) == 4" + }, + { + "task_id": 191, + "function_signature": "def check_monthnumber(monthname3: str) -> bool:", + "text": "Write a function to check whether the given month name contains 30 days or not.", + "test_case": "assert check_monthnumber(\"February\")==False" + }, + { + "task_id": 192, + "function_signature": "def check_String(str: str) -> bool:", + "text": "Write a python function to check whether a string has atleast one letter and one number.", + "test_case": "assert check_String('thishasboth29') == True" + }, + { + "task_id": 193, + "function_signature": "def remove_tuple(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to remove the duplicates from the given tuple.", + "test_case": "assert remove_tuple((1, 3, 5, 2, 3, 5, 1, 1, 3)) == (1, 2, 3, 5)" + }, + { + "task_id": 194, + "function_signature": "def octal_To_Decimal(n: int) -> int:", + "text": "Write a python function to convert octal number to decimal number.", + "test_case": "assert octal_To_Decimal(25) == 21" + }, + { + "task_id": 195, + "function_signature": "def first(arr: list[int], x: int, n: int) -> int:", + "text": "Write a python function to find the first position of an element in a sorted array.", + "test_case": "assert first([1,2,3,4,5,6,6],6,6) == 5" + }, + { + "task_id": 196, + "function_signature": "def remove_tuples(test_list: list[tuple[int, ...]], K: int) -> list[tuple[int, ...]]:", + "text": "Write a function to remove all the tuples with length k.", + "test_case": "assert remove_tuples([(4, 5), (4, ), (8, 6, 7), (1, ), (3, 4, 6, 7)] , 1) == [(4, 5), (8, 6, 7), (3, 4, 6, 7)]" + }, + { + "task_id": 197, + "function_signature": "def find_exponentio(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to perform the exponentiation of the given two tuples.", + "test_case": "assert find_exponentio((10, 4, 5, 6), (5, 6, 7, 5)) == (100000, 4096, 78125, 7776)" + }, + { + "task_id": 198, + "function_signature": "def largest_triangle(a: int, b: int) -> float:", + "text": "Write a function to find the largest triangle that can be inscribed in an ellipse.", + "test_case": "assert largest_triangle(4,2)==10.392304845413264" + }, + { + "task_id": 199, + "function_signature": "def highest_Power_of_2(n: int) -> int:", + "text": "Write a python function to find highest power of 2 less than or equal to given number.", + "test_case": "assert highest_Power_of_2(10) == 8" + }, + { + "task_id": 200, + "function_signature": "def position_max(list1: list[int]) -> list[int]:", + "text": "Write a function to find all index positions of the maximum values in a given list.", + "test_case": "assert position_max([12,33,23,10,67,89,45,667,23,12,11,10,54])==[7]" + }, + { + "task_id": 201, + "function_signature": "def chkList(lst: list[str]) -> bool:", + "text": "Write a python function to check whether the elements in a list are same or not.", + "test_case": "assert chkList(['one','one','one']) == True" + }, + { + "task_id": 202, + "function_signature": "def remove_even(str1: str) -> str:", + "text": "Write a function to remove even characters in a string.", + "test_case": "assert remove_even(\"python\")==(\"pto\")" + }, + { + "task_id": 203, + "function_signature": "def hamming_Distance(None: int) -> int:", + "text": "Write a python function to find the hamming distance between given two integers.", + "test_case": "assert hamming_Distance(4,8) == 2" + }, + { + "task_id": 204, + "function_signature": "def count(s,c) : \r\n res = 0 \r\n for i in range(len(s)) : \r\n if (s[i] == c):", + "text": "Write a python function to count the occurrence of a given character in a string.", + "test_case": "assert count(\"abcc\",\"c\") == 2" + }, + { + "task_id": 205, + "function_signature": "def inversion_elements(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to find the inversions of tuple elements in the given tuple list.", + "test_case": "assert inversion_elements((7, 8, 9, 1, 10, 7)) == (-8, -9, -10, -2, -11, -8)" + }, + { + "task_id": 206, + "function_signature": "def concatenate_elements(test_tup: tuple[str, ...]) -> tuple[str, ...]:", + "text": "Write a function to perform the adjacent element concatenation in the given tuples.", + "test_case": "assert concatenate_elements((\"DSP \", \"IS \", \"BEST \", \"FOR \", \"ALL \", \"UTS\")) == ('DSP IS ', 'IS BEST ', 'BEST FOR ', 'FOR ALL ', 'ALL UTS')" + }, + { + "task_id": 207, + "function_signature": "def find_longest_repeating_subseq(str: str) -> int:", + "text": "Write a function to count the longest repeating subsequences such that the two subsequences don’t have same string characters at same positions.", + "test_case": "assert find_longest_repeating_subseq(\"AABEBCDD\") == 3" + }, + { + "task_id": 208, + "function_signature": "def is_decimal(num: str) -> bool:", + "text": "Write a function to check the given decimal with a precision of 2 by using regex.", + "test_case": "assert is_decimal('123.11') == True" + }, + { + "task_id": 209, + "function_signature": "def heap_replace(heap: list[int], a: int) -> list[int]:", + "text": "Write a function to delete the smallest element from the given heap and then insert a new item.", + "test_case": "assert heap_replace( [25, 44, 68, 21, 39, 23, 89],21)==[21, 25, 23, 44, 39, 68, 89]" + }, + { + "task_id": 210, + "function_signature": "def is_allowed_specific_char(string: str) -> bool:", + "text": "Write a function to check that the given string contains only a certain set of characters(in this case a-z, a-z and 0-9) by using regex.", + "test_case": "assert is_allowed_specific_char(\"ABCDEFabcdef123450\") == True" + }, + { + "task_id": 211, + "function_signature": "def count_Num(n: int) -> int:", + "text": "Write a python function to count numbers whose oth and nth bits are set.", + "test_case": "assert count_Num(2) == 1" + }, + { + "task_id": 212, + "function_signature": "def fourth_Power_Sum(n: int) -> int:", + "text": "Write a python function to find the sum of fourth power of n natural numbers.", + "test_case": "assert fourth_Power_Sum(2) == 17" + }, + { + "task_id": 213, + "function_signature": "def concatenate_strings(test_tup1: tuple[str, ...], test_tup2: tuple[str, ...]) -> tuple[str, ...]:", + "text": "Write a function to perform the concatenation of two string tuples.", + "test_case": "assert concatenate_strings((\"Manjeet\", \"Nikhil\", \"Akshat\"), (\" Singh\", \" Meherwal\", \" Garg\")) == ('Manjeet Singh', 'Nikhil Meherwal', 'Akshat Garg')" + }, + { + "task_id": 214, + "function_signature": "def degree_radian(radian: int) -> float:", + "text": "Write a function to convert radians to degrees.", + "test_case": "assert degree_radian(90)==5156.620156177409" + }, + { + "task_id": 215, + "function_signature": "def decode_list(alist: list[list[int]]) -> list[int]:", + "text": "Write a function to decode a run-length encoded given list.", + "test_case": "assert decode_list([[2, 1], 2, 3, [2, 4], 5,1])==[1,1,2,3,4,4,5,1]" + }, + { + "task_id": 216, + "function_signature": "def check_subset_list(list1: list[int], list2: list[list[int]]) -> bool:", + "text": "Write a function to check if a nested list is a subset of another nested list.", + "test_case": "assert check_subset_list([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==False" + }, + { + "task_id": 217, + "function_signature": "def first_Repeated_Char(str: str) -> str:", + "text": "Write a python function to find the first repeated character in a given string.", + "test_case": "assert first_Repeated_Char(\"Google\") == \"o\"" + }, + { + "task_id": 218, + "function_signature": "def min_Operations(A: int, B: int) -> int:", + "text": "Write a python function to find the minimum operations required to make two numbers equal.", + "test_case": "assert min_Operations(2,4) == 1" + }, + { + "task_id": 219, + "function_signature": "def extract_min_max(test_tup: tuple[int, ...], K: int) -> tuple[int, ...]:", + "text": "Write a function to extract maximum and minimum k elements in the given tuple.", + "test_case": "assert extract_min_max((5, 20, 3, 7, 6, 8), 2) == (3, 5, 8, 20)" + }, + { + "task_id": 220, + "function_signature": "def replace_max_specialchar(text: str, n: int) -> str:", + "text": "Write a function to replace maximum n occurrences of spaces, commas, or dots with a colon.", + "test_case": "assert replace_max_specialchar('Python language, Programming language.',2)==('Python:language: Programming language.')" + }, + { + "task_id": 221, + "function_signature": "def first_even(nums):", + "text": "Write a python function to find the first even number in a given list of numbers.", + "test_case": "assert first_even ([1, 3, 5, 7, 4, 1, 6, 8]) == 4" + }, + { + "task_id": 222, + "function_signature": "def check_type(test_tuple: tuple[int, ...]) -> bool:", + "text": "Write a function to check if all the elements in tuple have same data type or not.", + "test_case": "assert check_type((5, 6, 7, 3, 5, 6) ) == True" + }, + { + "task_id": 223, + "function_signature": "def is_majority(arr: list[int], n: int, x: int) -> bool:", + "text": "Write a function to check for majority element in the given sorted array.", + "test_case": "assert is_majority([1, 2, 3, 3, 3, 3, 10], 7, 3) == True" + }, + { + "task_id": 224, + "function_signature": "def count_Set_Bits(n: int) -> int:", + "text": "Write a python function to count set bits of a given number.", + "test_case": "assert count_Set_Bits(2) == 1" + }, + { + "task_id": 225, + "function_signature": "def find_Min(arr: list[int], low: int, high: int) -> int:", + "text": "Write a python function to find the minimum element in a sorted and rotated array.", + "test_case": "assert find_Min([1,2,3,4,5],0,4) == 1" + }, + { + "task_id": 226, + "function_signature": "def odd_values_string(str: str) -> str:", + "text": "Write a python function to remove the characters which have odd index values of a given string.", + "test_case": "assert odd_values_string('abcdef') == 'ace'" + }, + { + "task_id": 227, + "function_signature": "def min_of_three(a: int, b: int, c: int) -> int:", + "text": "Write a function to find minimum of three numbers.", + "test_case": "assert min_of_three(10,20,0)==0" + }, + { + "task_id": 228, + "function_signature": "def all_Bits_Set_In_The_Given_Range(n: int, l: int, r: int) -> bool:", + "text": "Write a python function to check whether all the bits are unset in the given range or not.", + "test_case": "assert all_Bits_Set_In_The_Given_Range(4,1,2) == True" + }, + { + "task_id": 229, + "function_signature": "def re_arrange_array(arr: list[int], n: int) -> list[int]:", + "text": "Write a function to re-arrange the elements of the given array so that all negative elements appear before positive ones.", + "test_case": "assert re_arrange_array([-1, 2, -3, 4, 5, 6, -7, 8, 9], 9) == [-1, -3, -7, 4, 5, 6, 2, 8, 9]" + }, + { + "task_id": 230, + "function_signature": "def replace_blank(str1: str, char: str) -> str:", + "text": "Write a function to replace blank spaces with any character in a string.", + "test_case": "assert replace_blank(\"hello people\",'@')==(\"hello@people\")" + }, + { + "task_id": 231, + "function_signature": "def max_sum(tri: list[list[int]], n: int) -> int:", + "text": "Write a function to find the maximum sum in the given right triangle of numbers.", + "test_case": "assert max_sum([[1], [2,1], [3,3,2]], 3) == 6" + }, + { + "task_id": 232, + "function_signature": "def larg_nnum(list1: list[int], n: int) -> list[int]:", + "text": "Write a function to get the n largest items from a dataset.", + "test_case": "assert larg_nnum([10, 20, 50, 70, 90, 20, 50, 40, 60, 80, 100],2)==[100,90]" + }, + { + "task_id": 233, + "function_signature": "def lateralsuface_cylinder(r: int, h: int) -> float:", + "text": "Write a function to find the lateral surface area of a cylinder.", + "test_case": "assert lateralsuface_cylinder(10,5)==314.15000000000003" + }, + { + "task_id": 234, + "function_signature": "def volume_cube(l: int) -> int:", + "text": "Write a function to find the volume of a cube.", + "test_case": "assert volume_cube(3)==27" + }, + { + "task_id": 235, + "function_signature": "def even_bit_set_number(n: int) -> int:", + "text": "Write a python function to set all even bits of a given number.", + "test_case": "assert even_bit_set_number(10) == 10" + }, + { + "task_id": 236, + "function_signature": "def No_of_Triangle(N: int, K: int) -> int:", + "text": "Write a python function to count the maximum number of equilateral triangles that can be formed within a given equilateral triangle.", + "test_case": "assert No_of_Triangle(4,2) == 7" + }, + { + "task_id": 237, + "function_signature": "def check_occurences(test_list: list[tuple[int, ...]]) -> dict:", + "text": "Write a function to check the occurrences of records which occur similar times in the given tuples.", + "test_case": "assert check_occurences([(3, 1), (1, 3), (2, 5), (5, 2), (6, 3)] ) == {(1, 3): 2, (2, 5): 2, (3, 6): 1}" + }, + { + "task_id": 238, + "function_signature": "def number_of_substrings(str: str) -> int:", + "text": "Write a python function to count number of non-empty substrings of a given string.", + "test_case": "assert number_of_substrings(\"abc\") == 6" + }, + { + "task_id": 239, + "function_signature": "def get_total_number_of_sequences(m: int, n: int) -> int:", + "text": "Write a function to find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.", + "test_case": "assert get_total_number_of_sequences(10, 4) == 4" + }, + { + "task_id": 240, + "function_signature": "def replace_list(list1: list[int], list2: list[int]) -> list[int]:", + "text": "Write a function to replace the last element of the list with another list.", + "test_case": "assert replace_list([1, 3, 5, 7, 9, 10],[2, 4, 6, 8])==[1, 3, 5, 7, 9, 2, 4, 6, 8]" + }, + { + "task_id": 241, + "function_signature": "def array_3d(m: int, n: int, o: int) -> list[list[list[str]]]:", + "text": "Write a function to generate a 3d array having each element as '*'.", + "test_case": "assert array_3d(6,4,3)==[[['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']], [['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*'], ['*', '*', '*', '*', '*', '*']]]" + }, + { + "task_id": 242, + "function_signature": "def count_charac(str1: str) -> int:", + "text": "Write a function to count total characters in a string.", + "test_case": "assert count_charac(\"python programming\")==18" + }, + { + "task_id": 243, + "function_signature": "def sort_on_occurence(lst: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to sort the given list based on the occurrence of first element of tuples.", + "test_case": "assert sort_on_occurence([(1, 'Jake'), (2, 'Bob'), (1, 'Cara')]) == [(1, 'Jake', 'Cara', 2), (2, 'Bob', 1)]" + }, + { + "task_id": 244, + "function_signature": "def next_Perfect_Square(N: int) -> int:", + "text": "Write a python function to find the next perfect square greater than a given number.", + "test_case": "assert next_Perfect_Square(35) == 36" + }, + { + "task_id": 245, + "function_signature": "def max_sum(arr: list[int], n: int) -> int:", + "text": "Write a function to find the maximum sum of bi-tonic sub-sequence for the given array.", + "test_case": "assert max_sum([1, 15, 51, 45, 33, 100, 12, 18, 9], 9) == 194" + }, + { + "task_id": 246, + "function_signature": "def babylonian_squareroot(number: int) -> float:", + "text": "Write a function for computing square roots using the babylonian method.", + "test_case": "assert babylonian_squareroot(10)==3.162277660168379" + }, + { + "task_id": 247, + "function_signature": "def lps(str: str) -> int:", + "text": "Write a function to find the longest palindromic subsequence in the given string.", + "test_case": "assert lps(\"TENS FOR TENS\") == 5 " + }, + { + "task_id": 248, + "function_signature": "def harmonic_sum(n: int) -> float:", + "text": "Write a function to calculate the harmonic sum of n-1.", + "test_case": "assert harmonic_sum(7) == 2.5928571428571425" + }, + { + "task_id": 249, + "function_signature": "def intersection_array(array_nums1: list[int], array_nums2: list[int]) -> list[int]:", + "text": "Write a function to find the intersection of two arrays using lambda function.", + "test_case": "assert intersection_array([1, 2, 3, 5, 7, 8, 9, 10],[1, 2, 4, 8, 9])==[1, 2, 8, 9]" + }, + { + "task_id": 250, + "function_signature": "def count_X(tup: tuple[int, ...], x: int) -> int:", + "text": "Write a python function to count the occcurences of an element in a tuple.", + "test_case": "assert count_X((10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2),4) == 0" + }, + { + "task_id": 251, + "function_signature": "def insert_element(list: list[str], element: str) -> list[str]:", + "text": "Write a function to insert an element before each element of a list.", + "test_case": "assert insert_element(['Red', 'Green', 'Black'] ,'c')==['c', 'Red', 'c', 'Green', 'c', 'Black'] " + }, + { + "task_id": 252, + "function_signature": "def convert(numbers: int) -> tuple[float, ...]:", + "text": "Write a python function to convert complex numbers to polar coordinates.", + "test_case": "assert convert(1) == (1.0, 0.0)" + }, + { + "task_id": 253, + "function_signature": "def count_integer(list1: list[int]) -> int:", + "text": "Write a python function to count integers from a given list.", + "test_case": "assert count_integer([1,2,'abc',1.2]) == 2" + }, + { + "task_id": 254, + "function_signature": "def words_ae(text: str) -> list[str]:", + "text": "Write a function to find all words starting with 'a' or 'e' in a given string.", + "test_case": "assert words_ae(\"python programe\")==['ame']" + }, + { + "task_id": 255, + "function_signature": "def combinations_colors(l: list[str], n: int) -> list[tuple[str, ...]]:", + "text": "Write a function to choose specified number of colours from three different colours and generate all the combinations with repetitions.", + "test_case": "assert combinations_colors( [\"Red\",\"Green\",\"Blue\"],1)==[('Red',), ('Green',), ('Blue',)]" + }, + { + "task_id": 256, + "function_signature": "def count_Primes_nums(n: int) -> int:", + "text": "Write a python function to count the number of prime numbers less than a given non-negative number.", + "test_case": "assert count_Primes_nums(5) == 2" + }, + { + "task_id": 257, + "function_signature": "def swap_numbers(a: int, b: int) -> tuple[int, ...]:", + "text": "Write a function to swap two numbers.", + "test_case": "assert swap_numbers(10,20)==(20,10)" + }, + { + "task_id": 258, + "function_signature": "def count_odd(array_nums: list[int]) -> int:", + "text": "Write a function to find number of odd elements in the given list using lambda function.", + "test_case": "assert count_odd([1, 2, 3, 5, 7, 8, 10])==4" + }, + { + "task_id": 259, + "function_signature": "def maximize_elements(test_tup1: tuple[tuple[int, ...], ...], test_tup2: tuple[tuple[int, ...], ...]) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to maximize the given two tuples.", + "test_case": "assert maximize_elements(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((6, 7), (4, 9), (2, 9), (7, 10))" + }, + { + "task_id": 260, + "function_signature": "def newman_prime(n: int) -> int:", + "text": "Write a function to find the nth newman–shanks–williams prime number.", + "test_case": "assert newman_prime(3) == 7 " + }, + { + "task_id": 261, + "function_signature": "def division_elements(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to perform mathematical division operation across the given tuples.", + "test_case": "assert division_elements((10, 4, 6, 9),(5, 2, 3, 3)) == (2, 2, 2, 3)" + }, + { + "task_id": 262, + "function_signature": "def split_two_parts(list1: list[int], L: int) -> tuple[list[int], ...]:", + "text": "Write a function to split a given list into two parts where the length of the first part of the list is given.", + "test_case": "assert split_two_parts([1,1,2,3,4,4,5,1],3)==([1, 1, 2], [3, 4, 4, 5, 1])" + }, + { + "task_id": 263, + "function_signature": "def merge_dict(d1: dict, d2: dict) -> dict:", + "text": "Write a function to merge two dictionaries.", + "test_case": "assert merge_dict({'a': 100, 'b': 200},{'x': 300, 'y': 200})=={'x': 300, 'y': 200, 'a': 100, 'b': 200}" + }, + { + "task_id": 264, + "function_signature": "def dog_age(h_age: int) -> int:", + "text": "Write a function to calculate a dog's age in dog's years.", + "test_case": "assert dog_age(12)==61" + }, + { + "task_id": 265, + "function_signature": "def list_split(S: list[str], step: int) -> list[list[str]]:", + "text": "Write a function to split a list for every nth element.", + "test_case": "assert list_split(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'],3)==[['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k', 'n'], ['c', 'f', 'i', 'l']] " + }, + { + "task_id": 266, + "function_signature": "def lateralsurface_cube(l: int) -> int:", + "text": "Write a function to find the lateral surface area of a cube.", + "test_case": "assert lateralsurface_cube(5)==100" + }, + { + "task_id": 267, + "function_signature": "def square_Sum(n: int) -> int:", + "text": "Write a python function to find the sum of squares of first n odd natural numbers.", + "test_case": "assert square_Sum(2) == 10" + }, + { + "task_id": 268, + "function_signature": "def find_star_num(n: int) -> int:", + "text": "Write a function to find the n'th star number.", + "test_case": "assert find_star_num(3) == 37" + }, + { + "task_id": 269, + "function_signature": "def ascii_value(k: str) -> int:", + "text": "Write a function to find the ascii value of a character.", + "test_case": "assert ascii_value('A')==65" + }, + { + "task_id": 270, + "function_signature": "def sum_even_and_even_index(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the sum of even numbers at even positions.", + "test_case": "assert sum_even_and_even_index([5, 6, 12, 1, 18, 8],6) == 30" + }, + { + "task_id": 271, + "function_signature": "def even_Power_Sum(n: int) -> int:", + "text": "Write a python function to find the sum of fifth power of first n even natural numbers.", + "test_case": "assert even_Power_Sum(2) == 1056" + }, + { + "task_id": 272, + "function_signature": "def rear_extract(test_list: list[tuple[int, ...]]) -> list[int]:", + "text": "Write a function to perfom the rear element extraction from list of tuples records.", + "test_case": "assert rear_extract([(1, 'Rash', 21), (2, 'Varsha', 20), (3, 'Kil', 19)]) == [21, 20, 19]" + }, + { + "task_id": 273, + "function_signature": "def substract_elements(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to substract the contents of one tuple with corresponding index of other tuple.", + "test_case": "assert substract_elements((10, 4, 5), (2, 5, 18)) == (8, -1, -13)" + }, + { + "task_id": 274, + "function_signature": "def even_binomial_Coeff_Sum(n: int) -> int:", + "text": "Write a python function to find sum of even index binomial coefficients.", + "test_case": "assert even_binomial_Coeff_Sum(4) == 8" + }, + { + "task_id": 275, + "function_signature": "def get_Position(a: list[int], n: int, m: int) -> int:", + "text": "Write a python function to find the position of the last removed element from the given array.", + "test_case": "assert get_Position([2,5,4],3,2) == 2" + }, + { + "task_id": 276, + "function_signature": "def volume_cylinder(r: int, h: int) -> float:", + "text": "Write a function to find the volume of a cylinder.", + "test_case": "assert volume_cylinder(10,5)==1570.7500000000002" + }, + { + "task_id": 277, + "function_signature": "def dict_filter(dict: dict, n: int) -> dict:", + "text": "Write a function to filter a dictionary based on values.", + "test_case": "assert dict_filter({'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190},170)=={'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190}" + }, + { + "task_id": 278, + "function_signature": "def count_first_elements(test_tup: tuple[int, ...]) -> int:", + "text": "Write a function to find the element count that occurs before the record in the given tuple.", + "test_case": "assert count_first_elements((1, 5, 7, (4, 6), 10) ) == 3" + }, + { + "task_id": 279, + "function_signature": "def is_num_decagonal(n: int) -> int:", + "text": "Write a function to find the nth decagonal number.", + "test_case": "assert is_num_decagonal(3) == 27" + }, + { + "task_id": 280, + "function_signature": "def sequential_search(dlist: list[int], item: int) -> tuple[bool, ...]:", + "text": "Write a function to search an element in the given array by using sequential search.", + "test_case": "assert sequential_search([11,23,58,31,56,77,43,12,65,19],31) == (True, 3)" + }, + { + "task_id": 281, + "function_signature": "def all_unique(test_list: list[int]) -> bool:", + "text": "Write a python function to check if the elements of a given list are unique or not.", + "test_case": "assert all_unique([1,2,3]) == True" + }, + { + "task_id": 282, + "function_signature": "def sub_list(nums1: list[int], nums2: list[int]) -> list[int]:", + "text": "Write a function to substaract two lists using map and lambda function.", + "test_case": "assert sub_list([1, 2, 3],[4,5,6])==[-3,-3,-3]" + }, + { + "task_id": 283, + "function_signature": "def validate(n: int) -> bool:", + "text": "Write a python function to check whether the frequency of each digit is less than or equal to the digit itself.", + "test_case": "assert validate(1234) == True" + }, + { + "task_id": 284, + "function_signature": "def check_element(list: list[str], element: str) -> bool:", + "text": "Write a function to check whether all items of a list are equal to a given string.", + "test_case": "assert check_element([\"green\", \"orange\", \"black\", \"white\"],'blue')==False" + }, + { + "task_id": 285, + "function_signature": "def text_match_two_three(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by two to three 'b'.", + "test_case": "assert text_match_two_three(\"ac\")==('Not matched!')" + }, + { + "task_id": 286, + "function_signature": "def max_sub_array_sum_repeated(a: list[int], n: int, k: int) -> int:", + "text": "Write a function to find the largest sum of contiguous array in the modified array which is formed by repeating the given array k times.", + "test_case": "assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30" + }, + { + "task_id": 287, + "function_signature": "def square_Sum(n: int) -> int:", + "text": "Write a python function to find the sum of squares of first n even natural numbers.", + "test_case": "assert square_Sum(2) == 20" + }, + { + "task_id": 288, + "function_signature": "def modular_inverse(arr: list[int], N: int, P: int) -> int:", + "text": "Write a function to count array elements having modular inverse under given prime number p equal to itself.", + "test_case": "assert modular_inverse([ 1, 6, 4, 5 ], 4, 7) == 2" + }, + { + "task_id": 289, + "function_signature": "def odd_Days(N: int) -> int:", + "text": "Write a python function to calculate the number of odd days in a given year.", + "test_case": "assert odd_Days(100) == 5" + }, + { + "task_id": 290, + "function_signature": "def max_length(list1: list[list[int]]) -> tuple[int, ...]:", + "text": "Write a function to find the list of lists with maximum length.", + "test_case": "assert max_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])" + }, + { + "task_id": 291, + "function_signature": "def count_no_of_ways(n: int, k: int) -> int:", + "text": "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 given fence with n posts and k colors.", + "test_case": "assert count_no_of_ways(2, 4) == 16" + }, + { + "task_id": 292, + "function_signature": "def find(n: int, m: int) -> int:", + "text": "Write a python function to find quotient of two numbers.", + "test_case": "assert find(10,3) == 3" + }, + { + "task_id": 293, + "function_signature": "def otherside_rightangle(w: int, h: int) -> float:", + "text": "Write a function to find the third side of a right angled triangle.", + "test_case": "assert otherside_rightangle(7,8)==10.63014581273465" + }, + { + "task_id": 294, + "function_signature": "def max_val(listval: list[str]) -> int:", + "text": "Write a function to find the maximum value in a given heterogeneous list.", + "test_case": "assert max_val(['Python', 3, 2, 4, 5, 'version'])==5" + }, + { + "task_id": 295, + "function_signature": "def sum_div(number: int) -> int:", + "text": "Write a function to return the sum of all divisors of a number.", + "test_case": "assert sum_div(8)==7" + }, + { + "task_id": 296, + "function_signature": "def get_Inv_Count(arr: list[int], n: int) -> int:", + "text": "Write a python function to count inversions in an array.", + "test_case": "assert get_Inv_Count([1,20,6,4,5],5) == 5" + }, + { + "task_id": 297, + "function_signature": "def flatten_list(list1: list[int]) -> list[int]:", + "text": "Write a function to flatten a given nested list structure.", + "test_case": "assert flatten_list([0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]])==[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]" + }, + { + "task_id": 298, + "function_signature": "def intersection_nested_lists(l1: list[int], l2: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to find the nested list elements which are present in another list.", + "test_case": "assert intersection_nested_lists( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],[[12, 18, 23, 25, 45], [7, 11, 19, 24, 28], [1, 5, 8, 18, 15, 16]])==[[12], [7, 11], [1, 5, 8]]" + }, + { + "task_id": 299, + "function_signature": "def max_aggregate(stdata: list[tuple[str, ...]]) -> tuple[str, ...]:", + "text": "Write a function to calculate the maximum aggregate from the list of tuples.", + "test_case": "assert max_aggregate([('Juan Whelan',90),('Sabah Colley',88),('Peter Nichols',7),('Juan Whelan',122),('Sabah Colley',84)])==('Juan Whelan', 212)" + }, + { + "task_id": 300, + "function_signature": "def count_binary_seq(n: int) -> float:", + "text": "Write a function to find the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits.", + "test_case": "assert count_binary_seq(1) == 2.0" + }, + { + "task_id": 301, + "function_signature": "def dict_depth(d: dict) -> int:", + "text": "Write a function to find the depth of a dictionary.", + "test_case": "assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4" + }, + { + "task_id": 302, + "function_signature": "def set_Bit_Number(n: int) -> int:", + "text": "Write a python function to find the most significant bit number which is also a set bit.", + "test_case": "assert set_Bit_Number(6) == 4" + }, + { + "task_id": 303, + "function_signature": "def solve(a: list[int], n: int) -> bool:", + "text": "Write a python function to check whether the count of inversion of two types are same or not.", + "test_case": "assert solve([1,0,2],3) == True" + }, + { + "task_id": 304, + "function_signature": "def find_Element(None: list[int]) -> int:", + "text": "Write a python function to find element at a given index after number of rotations.", + "test_case": "assert find_Element([1,2,3,4,5],[[0,2],[0,3]],2,1) == 3" + }, + { + "task_id": 305, + "function_signature": "def start_withp(words: list[str]) -> tuple[str, ...]:", + "text": "Write a function to match two words from a list of words starting with letter 'p'.", + "test_case": "assert start_withp([\"Python PHP\", \"Java JavaScript\", \"c c++\"])==('Python', 'PHP')" + }, + { + "task_id": 306, + "function_signature": "def max_sum_increasing_subseq(a: list[int], n: int, index: int, k: int) -> int:", + "text": "Write a function to find the maximum sum of increasing subsequence from prefix till ith index and also including a given kth element which is after i, i.e., k > i .", + "test_case": "assert max_sum_increasing_subseq([1, 101, 2, 3, 100, 4, 5 ], 7, 4, 6) == 11" + }, + { + "task_id": 307, + "function_signature": "def colon_tuplex(tuplex: tuple[str, ...], m: int, n: int) -> tuple[str, ...]:", + "text": "Write a function to get a colon of a tuple.", + "test_case": "assert colon_tuplex((\"HELLO\", 5, [], True) ,2,50)==(\"HELLO\", 5, [50], True) " + }, + { + "task_id": 308, + "function_signature": "def large_product(nums1: list[int], nums2: list[int], N: int) -> list[int]:", + "text": "Write a function to find the specified number of largest products from two given lists.", + "test_case": "assert large_product([1, 2, 3, 4, 5, 6],[3, 6, 8, 9, 10, 6],3)==[60, 54, 50]" + }, + { + "task_id": 309, + "function_signature": "def maximum(a: int, b: int) -> int:", + "text": "Write a python function to find the maximum of two numbers.", + "test_case": "assert maximum(5,10) == 10" + }, + { + "task_id": 310, + "function_signature": "def string_to_tuple(str1: str) -> tuple[str, ...]:", + "text": "Write a function to convert a given string to a tuple.", + "test_case": "assert string_to_tuple(\"python 3.0\")==('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')" + }, + { + "task_id": 311, + "function_signature": "def set_left_most_unset_bit(n: int) -> int:", + "text": "Write a python function to set the left most unset bit.", + "test_case": "assert set_left_most_unset_bit(10) == 14" + }, + { + "task_id": 312, + "function_signature": "def volume_cone(r: int, h: int) -> float:", + "text": "Write a function to find the volume of a cone.", + "test_case": "assert volume_cone(5,12)==314.15926535897927" + }, + { + "task_id": 313, + "function_signature": "def pos_nos(list1: list[int]) -> tuple[int, ...]:", + "text": "Write a python function to print positive numbers in a list.", + "test_case": "assert pos_nos([-1,-2,1,2]) == 1,2" + }, + { + "task_id": 314, + "function_signature": "def max_sum_rectangular_grid(None: list[list[int]]) -> int:", + "text": "Write a function to find out the maximum sum such that no two chosen numbers are adjacent for the given rectangular grid of dimension 2 x n.", + "test_case": "assert max_sum_rectangular_grid([ [1, 4, 5], [2, 0, 0 ] ], 3) == 7" + }, + { + "task_id": 315, + "function_signature": "def find_Max_Len_Even(str: str) -> str:", + "text": "Write a python function to find the first maximum length of even word.", + "test_case": "assert find_Max_Len_Even(\"python language\") == \"language\"" + }, + { + "task_id": 316, + "function_signature": "def find_last_occurrence(A: list[int], x: int) -> int:", + "text": "Write a function to find the index of the last occurrence of a given number in a sorted array.", + "test_case": "assert find_last_occurrence([2, 5, 5, 5, 6, 6, 8, 9, 9, 9], 5) == 3" + }, + { + "task_id": 317, + "function_signature": "def modified_encode(alist: list[int]) -> list[list[int]]:", + "text": "Write a function to reflect the modified run-length encoding from a list.", + "test_case": "assert modified_encode([1,1,2,3,4,4,5,1])==[[2, 1], 2, 3, [2, 4], 5, 1]" + }, + { + "task_id": 318, + "function_signature": "def max_volume(s: int) -> int:", + "text": "Write a python function to find the maximum volume of a cuboid with given sum of sides.", + "test_case": "assert max_volume(8) == 18" + }, + { + "task_id": 319, + "function_signature": "def find_long_word(text: str) -> list[str]:", + "text": "Write a function to find all five characters long word in the given string by using regex.", + "test_case": "assert find_long_word('Please move back to strem') == ['strem']" + }, + { + "task_id": 320, + "function_signature": "def sum_difference(n: int) -> int:", + "text": "Write a function to calculate the difference between the squared sum of first n natural numbers and the sum of squared first n natural numbers.", + "test_case": "assert sum_difference(12)==5434" + }, + { + "task_id": 321, + "function_signature": "def find_demlo(s: str) -> str:", + "text": "Write a function to find the demlo number for the given number.", + "test_case": "assert find_demlo(\"111111\") == '12345654321'" + }, + { + "task_id": 322, + "function_signature": "def position_min(list1: list[int]) -> list[int]:", + "text": "Write a function to find all index positions of the minimum values in a given list.", + "test_case": "assert position_min([12,33,23,10,67,89,45,667,23,12,11,10,54])==[3,11]" + }, + { + "task_id": 323, + "function_signature": "def re_arrange(arr: list[int], n: int) -> list[int]:", + "text": "Write a function to re-arrange the given array in alternating positive and negative items.", + "test_case": "assert re_arrange([-5, -2, 5, 2, 4,\t7, 1, 8, 0, -8], 10) == [-5, 5, -2, 2, -8, 4, 7, 1, 8, 0]" + }, + { + "task_id": 324, + "function_signature": "def sum_of_alternates(test_tuple: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to extract the sum of alternate chains of tuples.", + "test_case": "assert sum_of_alternates((5, 6, 3, 6, 10, 34)) == (46, 18)" + }, + { + "task_id": 325, + "function_signature": "def get_Min_Squares(n: int) -> int:", + "text": "Write a python function to find the minimum number of squares whose sum is equal to a given number.", + "test_case": "assert get_Min_Squares(6) == 3" + }, + { + "task_id": 326, + "function_signature": "def most_occurrences(test_list: list[str]) -> str:", + "text": "Write a function to get the word with most number of occurrences in the given strings list.", + "test_case": "assert most_occurrences([\"UTS is best for RTF\", \"RTF love UTS\", \"UTS is best\"] ) == 'UTS'" + }, + { + "task_id": 327, + "function_signature": "def check_isosceles(x: int, y: int, z: int) -> bool:", + "text": "Write a function to print check if the triangle is isosceles or not.", + "test_case": "assert check_isosceles(6,8,12)==False " + }, + { + "task_id": 328, + "function_signature": "def rotate_left(list1: list[int], m: int, n: int) -> list[int]:", + "text": "Write a function to rotate a given list by specified number of items to the left direction.", + "test_case": "assert rotate_left([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],3,4)==[4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4]" + }, + { + "task_id": 329, + "function_signature": "def neg_count(list: list[int]) -> int:", + "text": "Write a python function to count negative numbers in a list.", + "test_case": "assert neg_count([-1,-2,3,-4,-5]) == 4" + }, + { + "task_id": 330, + "function_signature": "def find_char(text: str) -> list[str]:", + "text": "Write a function to find all three, four, five characters long words in the given string by using regex.", + "test_case": "assert find_char('For the four consumer complaints contact manager AKR reddy') == ['For', 'the', 'four', 'AKR', 'reddy']" + }, + { + "task_id": 331, + "function_signature": "def count_unset_bits(n: int) -> int:", + "text": "Write a python function to count unset bits of a given number.", + "test_case": "assert count_unset_bits(2) == 1" + }, + { + "task_id": 332, + "function_signature": "def char_frequency(str1: str) -> dict:", + "text": "Write a function to count character frequency of a given string.", + "test_case": "assert char_frequency('python')=={'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}" + }, + { + "task_id": 333, + "function_signature": "def Sort(sub_li: list[list[str]]) -> list[list[str]]:", + "text": "Write a python function to sort a list according to the second element in sublist.", + "test_case": "assert Sort([['a', 10], ['b', 5], ['c', 20], ['d', 15]]) == [['b', 5], ['a', 10], ['d', 15], ['c', 20]]" + }, + { + "task_id": 334, + "function_signature": "def check_Validity(a: int, b: int, c: int) -> bool:", + "text": "Write a python function to check whether the triangle is valid or not if sides are given.", + "test_case": "assert check_Validity(1,2,3) == False" + }, + { + "task_id": 335, + "function_signature": "def ap_sum(a: int, n: int, d: int) -> int:", + "text": "Write a function to find the sum of arithmetic progression.", + "test_case": "assert ap_sum(1,5,2)==25" + }, + { + "task_id": 336, + "function_signature": "def check_monthnum(monthname1: str) -> bool:", + "text": "Write a function to check whether the given month name contains 28 days or not.", + "test_case": "assert check_monthnum(\"February\")==True" + }, + { + "task_id": 337, + "function_signature": "def text_match_word(text: str) -> str:", + "text": "Write a function that matches a word at the end of a string, with optional punctuation.", + "test_case": "assert text_match_word(\"python.\")==('Found a match!')" + }, + { + "task_id": 338, + "function_signature": "def count_Substring_With_Equal_Ends(s: str) -> int:", + "text": "Write a python function to count the number of substrings with same first and last characters.", + "test_case": "assert count_Substring_With_Equal_Ends('aba') == 4" + }, + { + "task_id": 339, + "function_signature": "def find_Divisor(x: int, y: int) -> int:", + "text": "Write a python function to find the maximum occuring divisor in an interval.", + "test_case": "assert find_Divisor(2,2) == 2" + }, + { + "task_id": 340, + "function_signature": "def sum_three_smallest_nums(lst: list[int]) -> int:", + "text": "Write a python function to find the sum of the three lowest positive numbers from a given list of numbers.", + "test_case": "assert sum_three_smallest_nums([10,20,30,40,50,60,7]) == 37" + }, + { + "task_id": 341, + "function_signature": "def set_to_tuple(s: set) -> tuple[int, ...]:", + "text": "Write a function to convert the given set into ordered tuples.", + "test_case": "assert set_to_tuple({1, 2, 3, 4, 5}) == (1, 2, 3, 4, 5)" + }, + { + "task_id": 342, + "function_signature": "def find_minimum_range(list: list[list[int]]) -> tuple[int, ...]:", + "text": "Write a function to find the smallest range that includes at-least one element from each of the given arrays.", + "test_case": "assert find_minimum_range([[3, 6, 8, 10, 15], [1, 5, 12], [4, 8, 15, 16], [2, 6]]) == (4, 6)" + }, + { + "task_id": 343, + "function_signature": "def dig_let(s: str) -> tuple[int, ...]:", + "text": "Write a function to calculate the number of digits and letters in a string.", + "test_case": "assert dig_let(\"python\")==(6,0)" + }, + { + "task_id": 344, + "function_signature": "def count_Odd_Squares(n: int, m: int) -> int:", + "text": "Write a python function to find number of elements with odd factors in a given range.", + "test_case": "assert count_Odd_Squares(5,100) == 8" + }, + { + "task_id": 345, + "function_signature": "def diff_consecutivenums(nums: list[int]) -> list[int]:", + "text": "Write a function to find the difference between two consecutive numbers in a given list.", + "test_case": "assert diff_consecutivenums([1, 1, 3, 4, 4, 5, 6, 7])==[0, 2, 1, 0, 1, 1, 1]" + }, + { + "task_id": 346, + "function_signature": "def zigzag(n: int, k: int) -> int:", + "text": "Write a function to find entringer number e(n, k).", + "test_case": "assert zigzag(4, 3) == 5" + }, + { + "task_id": 347, + "function_signature": "def count_Squares(m: int, n: int) -> int:", + "text": "Write a python function to count the number of squares in a rectangle.", + "test_case": "assert count_Squares(4,3) == 20" + }, + { + "task_id": 348, + "function_signature": "def find_ways(M: int) -> int:", + "text": "Write a function to count sequences of given length having non-negative prefix sums that can be generated by given values.", + "test_case": "assert find_ways(4) == 2" + }, + { + "task_id": 349, + "function_signature": "def check(None: str) -> str:", + "text": "Write a python function to check whether the given string is a binary string or not.", + "test_case": "assert check(\"01010101010\") == \"Yes\"" + }, + { + "task_id": 350, + "function_signature": "def minimum_Length(None: str) -> int:", + "text": "Write a python function to minimize the length of the string by removing occurrence of only one character.", + "test_case": "assert minimum_Length(\"mnm\") == 1" + }, + { + "task_id": 351, + "function_signature": "def first_Element(arr: list[int], n: int, k: int) -> int:", + "text": "Write a python function to find the first element occurring k times in a given array.", + "test_case": "assert first_Element([0,1,2,3,4,5],6,1) == 0" + }, + { + "task_id": 352, + "function_signature": "def unique_Characters(str: str) -> bool:", + "text": "Write a python function to check whether all the characters in a given string are unique.", + "test_case": "assert unique_Characters('aba') == False" + }, + { + "task_id": 353, + "function_signature": "def remove_column(list1: list[list[int]], n: int) -> list[list[int]]:", + "text": "Write a function to remove a specified column from a given nested list.", + "test_case": "assert remove_column([[1, 2, 3], [2, 4, 5], [1, 1, 1]],0)==[[2, 3], [4, 5], [1, 1]]" + }, + { + "task_id": 354, + "function_signature": "def tn_ap(a: int, n: int, d: int) -> int:", + "text": "Write a function to find t-nth term of arithemetic progression.", + "test_case": "assert tn_ap(1,5,2)==9" + }, + { + "task_id": 355, + "function_signature": "def count_Rectangles(radius: int) -> int:", + "text": "Write a python function to count the number of rectangles in a circle of radius r.", + "test_case": "assert count_Rectangles(2) == 8" + }, + { + "task_id": 356, + "function_signature": "def find_angle(a: int, b: int) -> int:", + "text": "Write a function to find the third angle of a triangle using two angles.", + "test_case": "assert find_angle(47,89)==44" + }, + { + "task_id": 357, + "function_signature": "def find_max(test_list: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the maximum element of all the given tuple records.", + "test_case": "assert find_max([(2, 4), (6, 7), (5, 1), (6, 10), (8, 7)]) == 10" + }, + { + "task_id": 358, + "function_signature": "def moddiv_list(nums1: list[int], nums2: list[int]) -> list[int]:", + "text": "Write a function to find modulo division of two lists using map and lambda function.", + "test_case": "assert moddiv_list([4,5,6],[1, 2, 3])==[0, 1, 0]" + }, + { + "task_id": 359, + "function_signature": "def Check_Solution(a: int, b: int, c: int) -> str:", + "text": "Write a python function to check whether one root of the quadratic equation is twice of the other or not.", + "test_case": "assert Check_Solution(1,3,2) == \"Yes\"" + }, + { + "task_id": 360, + "function_signature": "def get_carol(n: int) -> int:", + "text": "Write a function to find the n’th carol number.", + "test_case": "assert get_carol(2) == 7" + }, + { + "task_id": 361, + "function_signature": "def remove_empty(list1: list[list]) -> list[str]:", + "text": "Write a function to remove empty lists from a given list of lists.", + "test_case": "assert remove_empty([[], [], [], 'Red', 'Green', [1,2], 'Blue', [], []])==['Red', 'Green', [1, 2], 'Blue']" + }, + { + "task_id": 362, + "function_signature": "def max_occurrences(nums: list[int]) -> int:", + "text": "Write a python function to find the item with maximum occurrences in a given list.", + "test_case": "assert max_occurrences([1,2,3,1,2,3,12,4,2]) == 2" + }, + { + "task_id": 363, + "function_signature": "def add_K_element(test_list: list[tuple[int, ...]], K: int) -> list[tuple[int, ...]]:", + "text": "Write a function to add the k elements to each element in the tuple.", + "test_case": "assert add_K_element([(1, 3, 4), (2, 4, 6), (3, 8, 1)], 4) == [(5, 7, 8), (6, 8, 10), (7, 12, 5)]" + }, + { + "task_id": 364, + "function_signature": "def min_flip_to_make_string_alternate(str: str) -> int:", + "text": "Write a function to find the number of flips required to make the given binary string a sequence of alternate characters.", + "test_case": "assert min_flip_to_make_string_alternate(\"0001010111\") == 2" + }, + { + "task_id": 365, + "function_signature": "def count_Digit(n: int) -> int:", + "text": "Write a python function to count the number of digits of a given number.", + "test_case": "assert count_Digit(12345) == 5" + }, + { + "task_id": 366, + "function_signature": "def adjacent_num_product(list_nums: list[int]) -> int:", + "text": "Write a python function to find the largest product of the pair of adjacent elements from a given list of integers.", + "test_case": "assert adjacent_num_product([1,2,3,4,5,6]) == 30" + }, + { + "task_id": 367, + "function_signature": "def is_tree_balanced(root):", + "text": "Write a function to check if a binary tree is balanced or not.", + "test_case": "assert is_tree_balanced(root) == False" + }, + { + "task_id": 368, + "function_signature": "def repeat_tuples(test_tup: tuple[int, ...], N: int) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to repeat the given tuple n times.", + "test_case": "assert repeat_tuples((1, 3), 4) == ((1, 3), (1, 3), (1, 3), (1, 3))" + }, + { + "task_id": 369, + "function_signature": "def lateralsurface_cuboid(l: int, w: int, h: int) -> int:", + "text": "Write a function to find the lateral surface area of cuboid", + "test_case": "assert lateralsurface_cuboid(8,5,6)==156" + }, + { + "task_id": 370, + "function_signature": "def float_sort(price: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to sort a tuple by its float element.", + "test_case": "assert float_sort([('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')])==[('item3', '24.5'), ('item2', '15.10'), ('item1', '12.20')] " + }, + { + "task_id": 371, + "function_signature": "def smallest_missing(A: list[int], left_element: int, right_element: int) -> int:", + "text": "Write a function to find the smallest missing element in a sorted array.", + "test_case": "assert smallest_missing([0, 1, 2, 3, 4, 5, 6], 0, 6) == 7" + }, + { + "task_id": 372, + "function_signature": "def heap_assending(nums: list[int]) -> list[int]:", + "text": "Write a function to sort a given list of elements in ascending order using heap queue algorithm.", + "test_case": "assert heap_assending([18, 14, 10, 9, 8, 7, 9, 3, 2, 4, 1])==[1, 2, 3, 4, 7, 8, 9, 9, 10, 14, 18]" + }, + { + "task_id": 373, + "function_signature": "def volume_cuboid(l: int, w: int, h: int) -> int:", + "text": "Write a function to find the volume of a cuboid.", + "test_case": "assert volume_cuboid(1,2,3)==6" + }, + { + "task_id": 374, + "function_signature": "def permute_string(str: str) -> list[str]:", + "text": "Write a function to print all permutations of a given string including duplicates.", + "test_case": "assert permute_string('ab')==['ab', 'ba']" + }, + { + "task_id": 375, + "function_signature": "def round_num(n: int, m: int) -> int:", + "text": "Write a function to round the given number to the nearest multiple of a specific number.", + "test_case": "assert round_num(4722,10)==4720" + }, + { + "task_id": 376, + "function_signature": "def remove_replica(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to remove tuple elements that occur more than once and replace the duplicates with some custom value.", + "test_case": "assert remove_replica((1, 1, 4, 4, 4, 5, 5, 6, 7, 7)) == (1, 'MSP', 4, 'MSP', 'MSP', 5, 'MSP', 6, 7, 'MSP')" + }, + { + "task_id": 377, + "function_signature": "def remove_Char(None: str) -> str:", + "text": "Write a python function to remove all occurrences of a character in a given string.", + "test_case": "assert remove_Char(\"aba\",'a') == \"b\"" + }, + { + "task_id": 378, + "function_signature": "def move_first(test_list: list[int]) -> list[int]:", + "text": "Write a python function to shift last element to first position in the given list.", + "test_case": "assert move_first([1,2,3,4]) == [4,1,2,3]" + }, + { + "task_id": 379, + "function_signature": "def surfacearea_cuboid(l: int, w: int, h: int) -> int:", + "text": "Write a function to find the surface area of a cuboid.", + "test_case": "assert surfacearea_cuboid(1,2,3)==22" + }, + { + "task_id": 380, + "function_signature": "def multi_list(rownum: int, colnum: int) -> list[list[int]]:", + "text": "Write a function to generate a two-dimensional array.", + "test_case": "assert multi_list(3,4)==[[0, 0, 0, 0], [0, 1, 2, 3], [0, 2, 4, 6]] " + }, + { + "task_id": 381, + "function_signature": "def index_on_inner_list(list_data: list[tuple[str, ...]], index_no: int) -> list[tuple[str, ...]]:", + "text": "Write a function to sort a list of lists by a given index of the inner list.", + "test_case": "assert index_on_inner_list([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==[('Beau Turnbull', 94, 98), ('Brady Kent', 97, 96), ('Greyson Fulton', 98, 99), ('Wyatt Knott', 91, 94)]" + }, + { + "task_id": 382, + "function_signature": "def find_rotation_count(A: list[int]) -> int:", + "text": "Write a function to find the number of rotations in a circularly sorted array.", + "test_case": "assert find_rotation_count([8, 9, 10, 1, 2, 3, 4, 5, 6, 7]) == 3" + }, + { + "task_id": 383, + "function_signature": "def even_bit_toggle_number(None: int) -> int:", + "text": "Write a python function to toggle all odd bits of a given number.", + "test_case": "assert even_bit_toggle_number(10) == 15" + }, + { + "task_id": 384, + "function_signature": "def frequency_Of_Smallest(n: int, arr: list[int]) -> int:", + "text": "Write a python function to find the frequency of the smallest value in a given array.", + "test_case": "assert frequency_Of_Smallest(5,[1,2,3,4,3]) == 1" + }, + { + "task_id": 385, + "function_signature": "def get_perrin(n: int) -> int:", + "text": "Write a function to find the n'th perrin number using recursion.", + "test_case": "assert get_perrin(9) == 12" + }, + { + "task_id": 386, + "function_signature": "def swap_count(s: str) -> int:", + "text": "Write a function to find out the minimum no of swaps required for bracket balancing in the given string.", + "test_case": "assert swap_count(\"[]][][\") == 2" + }, + { + "task_id": 387, + "function_signature": "def even_or_odd(N: str) -> str:", + "text": "Write a python function to check whether the hexadecimal number is even or odd.", + "test_case": "assert even_or_odd(\"AB3454D\") ==\"Odd\"" + }, + { + "task_id": 388, + "function_signature": "def highest_Power_of_2(n: int) -> int:", + "text": "Write a python function to find the highest power of 2 that is less than or equal to n.", + "test_case": "assert highest_Power_of_2(10) == 8" + }, + { + "task_id": 389, + "function_signature": "def find_lucas(n: int) -> int:", + "text": "Write a function to find the n'th lucas number.", + "test_case": "assert find_lucas(9) == 76" + }, + { + "task_id": 390, + "function_signature": "def add_string(list: list[int], string: str) -> list[str]:", + "text": "Write a function to insert a given string at the beginning of all items in a list.", + "test_case": "assert add_string([1,2,3,4],'temp{0}')==['temp1', 'temp2', 'temp3', 'temp4']" + }, + { + "task_id": 391, + "function_signature": "def convert_list_dictionary(l1: list[str], l2: list[str], l3: list[int]) -> list[dict]:", + "text": "Write a function to convert more than one list to nested dictionary.", + "test_case": "assert convert_list_dictionary([\"S001\", \"S002\", \"S003\", \"S004\"],[\"Adina Park\", \"Leyton Marsh\", \"Duncan Boyle\", \"Saim Richards\"] ,[85, 98, 89, 92])==[{'S001': {'Adina Park': 85}}, {'S002': {'Leyton Marsh': 98}}, {'S003': {'Duncan Boyle': 89}}, {'S004': {'Saim Richards': 92}}]" + }, + { + "task_id": 392, + "function_signature": "def get_max_sum(n: int) -> int:", + "text": "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).", + "test_case": "assert get_max_sum(60) == 106" + }, + { + "task_id": 393, + "function_signature": "def max_length_list(input_list: list[list[int]]) -> tuple[int, ...]:", + "text": "Write a function to find the list with maximum length using lambda function.", + "test_case": "assert max_length_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(3, [13, 15, 17])" + }, + { + "task_id": 394, + "function_signature": "def check_distinct(test_tup: tuple[int, ...]) -> bool:", + "text": "Write a function to check if given tuple is distinct or not.", + "test_case": "assert check_distinct((1, 4, 5, 6, 1, 4)) == False" + }, + { + "task_id": 395, + "function_signature": "def first_non_repeating_character(str1: str) -> None:", + "text": "Write a python function to find the first non-repeated character in a given string.", + "test_case": "assert first_non_repeating_character(\"abcabc\") == None" + }, + { + "task_id": 396, + "function_signature": "def check_char(string: str) -> str:", + "text": "Write a function to check whether the given string starts and ends with the same character or not using regex.", + "test_case": "assert check_char(\"abba\") == \"Valid\"" + }, + { + "task_id": 397, + "function_signature": "def median_numbers(a: int, b: int, c: int) -> float:", + "text": "Write a function to find the median of three specific numbers.", + "test_case": "assert median_numbers(25,55,65)==55.0" + }, + { + "task_id": 398, + "function_signature": "def sum_of_digits(nums: list[int]) -> int:", + "text": "Write a function to compute the sum of digits of each number of a given list.", + "test_case": "assert sum_of_digits([10,2,56])==14" + }, + { + "task_id": 399, + "function_signature": "def bitwise_xor(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to perform the mathematical bitwise xor operation across the given tuples.", + "test_case": "assert bitwise_xor((10, 4, 6, 9), (5, 2, 3, 3)) == (15, 6, 5, 10)" + }, + { + "task_id": 400, + "function_signature": "def extract_freq(test_list: list[tuple[int, ...]]) -> int:", + "text": "Write a function to extract the frequency of unique tuples in the given list order irrespective.", + "test_case": "assert extract_freq([(3, 4), (1, 2), (4, 3), (5, 6)] ) == 3" + }, + { + "task_id": 401, + "function_signature": "def add_nested_tuples(test_tup1: tuple[tuple[int, ...], ...], test_tup2: tuple[tuple[int, ...], ...]) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to perform index wise addition of tuple elements in the given two nested tuples.", + "test_case": "assert add_nested_tuples(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((7, 10), (7, 14), (3, 10), (8, 13))" + }, + { + "task_id": 402, + "function_signature": "def ncr_modp(n: int, r: int, p: int) -> int:", + "text": "Write a function to compute the value of ncr%p.", + "test_case": "assert ncr_modp(10,2,13)==6" + }, + { + "task_id": 403, + "function_signature": "def is_valid_URL(str: str) -> bool:", + "text": "Write a function to check if a url is valid or not using regex.", + "test_case": "assert is_valid_URL(\"https://www.google.com\") == True" + }, + { + "task_id": 404, + "function_signature": "def minimum(a: int, b: int) -> int:", + "text": "Write a python function to find the minimum of two numbers.", + "test_case": "assert minimum(1,2) == 1" + }, + { + "task_id": 405, + "function_signature": "def check_tuplex(tuplex: tuple[str, ...], tuple1: str) -> bool:", + "text": "Write a function to check whether an element exists within a tuple.", + "test_case": "assert check_tuplex((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),'r')==True" + }, + { + "task_id": 406, + "function_signature": "def find_Parity(x: int) -> str:", + "text": "Write a python function to find the parity of a given number.", + "test_case": "assert find_Parity(12) == \"Even Parity\"" + }, + { + "task_id": 407, + "function_signature": "def rearrange_bigger(n: int) -> int:", + "text": "Write a function to create the next bigger number by rearranging the digits of a given number.", + "test_case": "assert rearrange_bigger(12)==21" + }, + { + "task_id": 408, + "function_signature": "def k_smallest_pairs(nums1: list[int], nums2: list[int], k: int) -> list[list[int]]:", + "text": "Write a function to find k number of pairs which consist of one element from the first array and one element from the second array.", + "test_case": "assert k_smallest_pairs([1,3,7],[2,4,6],2)==[[1, 2], [1, 4]]" + }, + { + "task_id": 409, + "function_signature": "def min_product_tuple(list1: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the minimum product from the pairs of tuples within a given list.", + "test_case": "assert min_product_tuple([(2, 7), (2, 6), (1, 8), (4, 9)] )==8" + }, + { + "task_id": 410, + "function_signature": "def min_val(listval: list[str]) -> int:", + "text": "Write a function to find the minimum value in a given heterogeneous list.", + "test_case": "assert min_val(['Python', 3, 2, 4, 5, 'version'])==2" + }, + { + "task_id": 411, + "function_signature": "def snake_to_camel(word: str) -> str:", + "text": "Write a function to convert the given snake case string to camel case string by using regex.", + "test_case": "assert snake_to_camel('android_tv') == 'AndroidTv'" + }, + { + "task_id": 412, + "function_signature": "def remove_odd(l: list[int]) -> list[int]:", + "text": "Write a python function to remove odd numbers from a given list.", + "test_case": "assert remove_odd([1,2,3]) == [2]" + }, + { + "task_id": 413, + "function_signature": "def extract_nth_element(list1: list[tuple[str, ...]], n: int) -> list[str]:", + "text": "Write a function to extract the nth element from a given list of tuples.", + "test_case": "assert extract_nth_element([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)] ,0)==['Greyson Fulton', 'Brady Kent', 'Wyatt Knott', 'Beau Turnbull']" + }, + { + "task_id": 414, + "function_signature": "def overlapping(list1: list[int], list2: list[int]) -> bool:", + "text": "Write a python function to check whether the value exists in a sequence or not.", + "test_case": "assert overlapping([1,2,3,4,5],[6,7,8,9]) == False" + }, + { + "task_id": 415, + "function_signature": "def max_Product(arr: list[int]) -> tuple[int, ...]:", + "text": "Write a python function to find a pair with highest product from a given array of integers.", + "test_case": "assert max_Product([1,2,3,4,7,0,8,4]) == (7,8)" + }, + { + "task_id": 416, + "function_signature": "def breakSum(n: int) -> int:", + "text": "Write a function to find the maximum sum we can make by dividing number in three parts recursively and summing them up together for the given number.", + "test_case": "assert breakSum(12) == 13" + }, + { + "task_id": 417, + "function_signature": "def group_tuples(Input: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to find common first element in given list of tuple.", + "test_case": "assert group_tuples([('x', 'y'), ('x', 'z'), ('w', 't')]) == [('x', 'y', 'z'), ('w', 't')]" + }, + { + "task_id": 418, + "function_signature": "def Find_Max(lst: list[list[str]]) -> list[str]:", + "text": "Write a python function to find the sublist having maximum length.", + "test_case": "assert Find_Max([['A'],['A','B'],['A','B','C']]) == ['A','B','C']" + }, + { + "task_id": 419, + "function_signature": "def round_and_sum(list1: list[float]) -> int:", + "text": "Write a function to round every number of a given list of numbers and print the total sum multiplied by the length of the list.", + "test_case": "assert round_and_sum([22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50])==243" + }, + { + "task_id": 420, + "function_signature": "def cube_Sum(n: int) -> int:", + "text": "Write a python function to find the cube sum of first n even natural numbers.", + "test_case": "assert cube_Sum(2) == 72" + }, + { + "task_id": 421, + "function_signature": "def concatenate_tuple(test_tup: tuple[str, ...]) -> str:", + "text": "Write a function to concatenate each element of tuple by the delimiter.", + "test_case": "assert concatenate_tuple((\"ID\", \"is\", 4, \"UTS\") ) == 'ID-is-4-UTS'" + }, + { + "task_id": 422, + "function_signature": "def find_Average_Of_Cube(n: int) -> float:", + "text": "Write a python function to find the average of cubes of first n natural numbers.", + "test_case": "assert find_Average_Of_Cube(2) == 4.5" + }, + { + "task_id": 423, + "function_signature": "def get_maxgold(gold: list[list[int]], m: int, n: int) -> int:", + "text": "Write a function to solve gold mine problem.", + "test_case": "assert get_maxgold([[1, 3, 1, 5],[2, 2, 4, 1],[5, 0, 2, 3],[0, 6, 1, 2]],4,4)==16" + }, + { + "task_id": 424, + "function_signature": "def extract_rear(test_tuple: tuple[str, ...]) -> list[str]:", + "text": "Write a function to extract only the rear index element of each string in the given tuple.", + "test_case": "assert extract_rear(('Mers', 'for', 'Vers') ) == ['s', 'r', 's']" + }, + { + "task_id": 425, + "function_signature": "def count_element_in_list(list1: list[list[int]], x: int) -> int:", + "text": "Write a function to count the number of sublists containing a particular element.", + "test_case": "assert count_element_in_list([[1, 3], [5, 7], [1, 11], [1, 15, 7]],1)==3" + }, + { + "task_id": 426, + "function_signature": "def filter_oddnumbers(nums: list[int]) -> list[int]:", + "text": "Write a function to filter odd numbers using lambda function.", + "test_case": "assert filter_oddnumbers([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1,3,5,7,9]" + }, + { + "task_id": 427, + "function_signature": "def change_date_format(dt: str) -> str:", + "text": "Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format by using regex.", + "test_case": "assert change_date_format(\"2026-01-02\") == '02-01-2026'" + }, + { + "task_id": 428, + "function_signature": "def shell_sort(my_list: list[int]) -> list[int]:", + "text": "Write a function to sort the given array by using shell sort.", + "test_case": "assert shell_sort([12, 23, 4, 5, 3, 2, 12, 81, 56, 95]) == [2, 3, 4, 5, 12, 12, 23, 56, 81, 95]" + }, + { + "task_id": 429, + "function_signature": "def and_tuples(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to extract the elementwise and tuples from the given two tuples.", + "test_case": "assert and_tuples((10, 4, 6, 9), (5, 2, 3, 3)) == (0, 0, 2, 1)" + }, + { + "task_id": 430, + "function_signature": "def parabola_directrix(a: int, b: int, c: int) -> int:", + "text": "Write a function to find the directrix of a parabola.", + "test_case": "assert parabola_directrix(5,3,2)==-198" + }, + { + "task_id": 431, + "function_signature": "def common_element(list1: list[int], list2: list[int]) -> bool:", + "text": "Write a function that takes two lists and returns true if they have at least one common element.", + "test_case": "assert common_element([1,2,3,4,5], [5,6,7,8,9])==True" + }, + { + "task_id": 432, + "function_signature": "def median_trapezium(base1: int, base2: int, height: int) -> int:", + "text": "Write a function to find the median of a trapezium.", + "test_case": "assert median_trapezium(15,25,35)==20" + }, + { + "task_id": 433, + "function_signature": "def check_greater(arr: list[int], number: int) -> str:", + "text": "Write a function to check whether the entered number is greater than the elements of the given array.", + "test_case": "assert check_greater([1, 2, 3, 4, 5], 4) == 'No, entered number is less than those in the array'" + }, + { + "task_id": 434, + "function_signature": "def text_match_one(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by one or more b's.", + "test_case": "assert text_match_one(\"ac\")==('Not matched!')" + }, + { + "task_id": 435, + "function_signature": "def last_Digit(None: int) -> int:", + "text": "Write a python function to find the last digit of a given number.", + "test_case": "assert last_Digit(123) == 3" + }, + { + "task_id": 436, + "function_signature": "def neg_nos(list1: list[int]) -> tuple[int, ...]:", + "text": "Write a python function to print negative numbers in a list.", + "test_case": "assert neg_nos([-1,4,5,-6]) == -1,-6" + }, + { + "task_id": 437, + "function_signature": "def remove_odd(str1: str) -> str:", + "text": "Write a function to remove odd characters in a string.", + "test_case": "assert remove_odd(\"python\")==(\"yhn\")" + }, + { + "task_id": 438, + "function_signature": "def count_bidirectional(test_list: list[tuple[int, ...]]) -> str:", + "text": "Write a function to count bidirectional tuple pairs.", + "test_case": "assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == '3'" + }, + { + "task_id": 439, + "function_signature": "def multiple_to_single(L: list[int]) -> int:", + "text": "Write a function to convert a list of multiple integers into a single integer.", + "test_case": "assert multiple_to_single([11, 33, 50])==113350" + }, + { + "task_id": 440, + "function_signature": "def find_adverb_position(text: str) -> tuple[int, ...]:", + "text": "Write a function to find all adverbs and their positions in a given sentence.", + "test_case": "assert find_adverb_position(\"clearly!! we can see the sky\")==(0, 7, 'clearly')" + }, + { + "task_id": 441, + "function_signature": "def surfacearea_cube(l: int) -> int:", + "text": "Write a function to find the surface area of a cube.", + "test_case": "assert surfacearea_cube(5)==150" + }, + { + "task_id": 442, + "function_signature": "def positive_count(nums: list[int]) -> float:", + "text": "Write a function to find the ration of positive numbers in an array of integers.", + "test_case": "assert positive_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.54" + }, + { + "task_id": 443, + "function_signature": "def largest_neg(list1: list[int]) -> int:", + "text": "Write a python function to find the largest negative number from the given list.", + "test_case": "assert largest_neg([1,2,3,-4,-6]) == -6" + }, + { + "task_id": 444, + "function_signature": "def trim_tuple(test_list: list[tuple[int, ...]], K: int) -> str:", + "text": "Write a function to trim each tuple by k in the given tuple list.", + "test_case": "assert trim_tuple([(5, 3, 2, 1, 4), (3, 4, 9, 2, 1),(9, 1, 2, 3, 5), (4, 8, 2, 1, 7)], 2) == '[(2,), (9,), (2,), (2,)]'" + }, + { + "task_id": 445, + "function_signature": "def index_multiplication(test_tup1: tuple[tuple[int, ...], ...], test_tup2: tuple[tuple[int, ...], ...]) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to perform index wise multiplication of tuple elements in the given two tuples.", + "test_case": "assert index_multiplication(((1, 3), (4, 5), (2, 9), (1, 10)),((6, 7), (3, 9), (1, 1), (7, 3)) ) == ((6, 21), (12, 45), (2, 9), (7, 30))" + }, + { + "task_id": 446, + "function_signature": "def count_Occurrence(tup: tuple[str, ...], lst: list[str]) -> int:", + "text": "Write a python function to count the occurence of all elements of list in a tuple.", + "test_case": "assert count_Occurrence(('a', 'a', 'c', 'b', 'd'),['a', 'b'] ) == 3" + }, + { + "task_id": 447, + "function_signature": "def cube_nums(nums: list[int]) -> list[int]:", + "text": "Write a function to find cubes of individual elements in a list using lambda function.", + "test_case": "assert cube_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]" + }, + { + "task_id": 448, + "function_signature": "def cal_sum(n: int) -> int:", + "text": "Write a function to calculate the sum of perrin numbers.", + "test_case": "assert cal_sum(9) == 49" + }, + { + "task_id": 449, + "function_signature": "def check_Triangle(x1: int, y1: int, x2: int, y2: int, x3: int, y3: int) -> str:", + "text": "Write a python function to check whether the triangle is valid or not if 3 points are given.", + "test_case": "assert check_Triangle(1,5,2,5,4,6) == 'Yes'" + }, + { + "task_id": 450, + "function_signature": "def extract_string(str: list[str], l: int) -> list[str]:", + "text": "Write a function to extract specified size of strings from a give list of string values.", + "test_case": "assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'] ,8)==['practice', 'solution']" + }, + { + "task_id": 451, + "function_signature": "def remove_whitespaces(text1: str) -> str:", + "text": "Write a function to remove all whitespaces from the given string using regex.", + "test_case": "assert remove_whitespaces(' Google Flutter ') == 'GoogleFlutter'" + }, + { + "task_id": 452, + "function_signature": "def loss_amount(actual_cost: int, sale_amount: int) -> None:", + "text": "Write a function that gives loss amount if the given amount has loss else return none.", + "test_case": "assert loss_amount(1500,1200)==None" + }, + { + "task_id": 453, + "function_signature": "def sumofFactors(None: int) -> int:", + "text": "Write a python function to find the sum of even factors of a number.", + "test_case": "assert sumofFactors(18) == 26" + }, + { + "task_id": 454, + "function_signature": "def text_match_wordz(text: str) -> str:", + "text": "Write a function that matches a word containing 'z'.", + "test_case": "assert text_match_wordz(\"pythonz.\")==('Found a match!')" + }, + { + "task_id": 455, + "function_signature": "def check_monthnumb_number(monthnum2: int) -> bool:", + "text": "Write a function to check whether the given month number contains 31 days or not.", + "test_case": "assert check_monthnumb_number(5)==True" + }, + { + "task_id": 456, + "function_signature": "def reverse_string_list(stringlist: list[str]) -> list[str]:", + "text": "Write a function to reverse strings in a given list of string values.", + "test_case": "assert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black'])==['deR', 'neerG', 'eulB', 'etihW', 'kcalB']" + }, + { + "task_id": 457, + "function_signature": "def Find_Min(lst: list[list[int]]) -> list[int]:", + "text": "Write a python function to find the sublist having minimum length.", + "test_case": "assert Find_Min([[1],[1,2],[1,2,3]]) == [1]" + }, + { + "task_id": 458, + "function_signature": "def rectangle_area(l: int, b: int) -> int:", + "text": "Write a function to find the area of a rectangle.", + "test_case": "assert rectangle_area(10,20)==200" + }, + { + "task_id": 459, + "function_signature": "def remove_uppercase(str1: str) -> str:", + "text": "Write a function to remove uppercase substrings from a given string by using regex.", + "test_case": "assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'" + }, + { + "task_id": 460, + "function_signature": "def Extract(lst: list[list[int]]) -> list[int]:", + "text": "Write a python function to get the first element of each sublist.", + "test_case": "assert Extract([[1, 2], [3, 4, 5], [6, 7, 8, 9]]) == [1, 3, 6]" + }, + { + "task_id": 461, + "function_signature": "def upper_ctr(str: str) -> int:", + "text": "Write a python function to count the upper case characters in a given string.", + "test_case": "assert upper_ctr('PYthon') == 1" + }, + { + "task_id": 462, + "function_signature": "def combinations_list(list1: list[str]) -> list[list]:", + "text": "Write a function to find all possible combinations of the elements of a given list.", + "test_case": "assert combinations_list(['orange', 'red', 'green', 'blue'])==[[], ['orange'], ['red'], ['red', 'orange'], ['green'], ['green', 'orange'], ['green', 'red'], ['green', 'red', 'orange'], ['blue'], ['blue', 'orange'], ['blue', 'red'], ['blue', 'red', 'orange'], ['blue', 'green'], ['blue', 'green', 'orange'], ['blue', 'green', 'red'], ['blue', 'green', 'red', 'orange']]" + }, + { + "task_id": 463, + "function_signature": "def max_subarray_product(arr: list[int]) -> int:", + "text": "Write a function to find the maximum product subarray of the given array.", + "test_case": "assert max_subarray_product([1, -2, -3, 0, 7, -8, -2]) == 112" + }, + { + "task_id": 464, + "function_signature": "def check_value(dict: dict, n: int) -> bool:", + "text": "Write a function to check if all values are same in a dictionary.", + "test_case": "assert check_value({'Cierra Vega': 12, 'Alden Cantrell': 12, 'Kierra Gentry': 12, 'Pierre Cox': 12},10)==False" + }, + { + "task_id": 465, + "function_signature": "def drop_empty(dict1: dict) -> dict:", + "text": "Write a function to drop empty items from a given dictionary.", + "test_case": "assert drop_empty({'c1': 'Red', 'c2': 'Green', 'c3':None})=={'c1': 'Red', 'c2': 'Green'}" + }, + { + "task_id": 466, + "function_signature": "def find_peak(arr: list[int], n: int) -> int:", + "text": "Write a function to find the peak element in the given array.", + "test_case": "assert find_peak([1, 3, 20, 4, 1, 0], 6) == 2" + }, + { + "task_id": 467, + "function_signature": "def decimal_to_Octal(deciNum: int) -> int:", + "text": "Write a python function to convert decimal number to octal number.", + "test_case": "assert decimal_to_Octal(10) == 12" + }, + { + "task_id": 468, + "function_signature": "def max_product(arr: list[int], n: int) -> int:", + "text": "Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.", + "test_case": "assert max_product([3, 100, 4, 5, 150, 6], 6) == 45000 " + }, + { + "task_id": 469, + "function_signature": "def max_profit(price: list[int], k: int) -> int:", + "text": "Write a function to find the maximum profit earned from a maximum of k stock transactions", + "test_case": "assert max_profit([1, 5, 2, 3, 7, 6, 4, 5], 3) == 10" + }, + { + "task_id": 470, + "function_signature": "def add_pairwise(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to find the pairwise addition of the elements of the given tuples.", + "test_case": "assert add_pairwise((1, 5, 7, 8, 10)) == (6, 12, 15, 18)" + }, + { + "task_id": 471, + "function_signature": "def find_remainder(arr: list[int], lens: int, n: int) -> int:", + "text": "Write a python function to find remainder of array multiplication divided by n.", + "test_case": "assert find_remainder([ 100, 10, 5, 25, 35, 14 ],6,11) ==9" + }, + { + "task_id": 472, + "function_signature": "def check_Consecutive(l: list[int]) -> bool:", + "text": "Write a python function to check whether the given list contains consecutive numbers or not.", + "test_case": "assert check_Consecutive([1,2,3,4,5]) == True" + }, + { + "task_id": 473, + "function_signature": "def tuple_intersection(test_list1: list[tuple[int, ...]], test_list2: list[tuple[int, ...]]) -> set:", + "text": "Write a function to find the tuple intersection of elements in the given tuple list irrespective of their order.", + "test_case": "assert tuple_intersection([(3, 4), (5, 6), (9, 10), (4, 5)] , [(5, 4), (3, 4), (6, 5), (9, 11)]) == {(4, 5), (3, 4), (5, 6)}" + }, + { + "task_id": 474, + "function_signature": "def replace_char(str1: str, ch: str, newch: str) -> str:", + "text": "Write a function to replace characters in a string.", + "test_case": "assert replace_char(\"polygon\",'y','l')==(\"pollgon\")" + }, + { + "task_id": 475, + "function_signature": "def sort_counter(dict1: dict) -> list[tuple[str, ...]]:", + "text": "Write a function to sort counter by value.", + "test_case": "assert sort_counter({'Math':81, 'Physics':83, 'Chemistry':87})==[('Chemistry', 87), ('Physics', 83), ('Math', 81)]" + }, + { + "task_id": 476, + "function_signature": "def big_sum(nums: list[int]) -> int:", + "text": "Write a python function to find the sum of the largest and smallest value in a given array.", + "test_case": "assert big_sum([1,2,3]) == 4" + }, + { + "task_id": 477, + "function_signature": "def is_lower(string: str) -> str:", + "text": "Write a python function to convert the given string to lower case.", + "test_case": "assert is_lower(\"InValid\") == \"invalid\"" + }, + { + "task_id": 478, + "function_signature": "def remove_lowercase(str1: str) -> str:", + "text": "Write a function to remove lowercase substrings from a given string.", + "test_case": "assert remove_lowercase(\"PYTHon\")==('PYTH')" + }, + { + "task_id": 479, + "function_signature": "def first_Digit(None: int) -> int:", + "text": "Write a python function to find the first digit of a given number.", + "test_case": "assert first_Digit(123) == 1" + }, + { + "task_id": 480, + "function_signature": "def get_max_occuring_char(str1: str) -> str:", + "text": "Write a python function to find the maximum occurring character in a given string.", + "test_case": "assert get_max_occuring_char(\"data\") == \"a\"" + }, + { + "task_id": 481, + "function_signature": "def is_subset_sum(set: list[int], n: int, sum: int) -> bool:", + "text": "Write a function to determine if there is a subset of the given set with sum equal to the given sum.", + "test_case": "assert is_subset_sum([3, 34, 4, 12, 5, 2], 6, 9) == True" + }, + { + "task_id": 482, + "function_signature": "def match(text: str) -> str:", + "text": "Write a function to find sequences of one upper case letter followed by lower case letters in the given string by using regex.", + "test_case": "assert match(\"Geeks\") == 'Yes'" + }, + { + "task_id": 483, + "function_signature": "def first_Factorial_Divisible_Number(x: int) -> int:", + "text": "Write a python function to find the first natural number whose factorial is divisible by x.", + "test_case": "assert first_Factorial_Divisible_Number(10) == 5" + }, + { + "task_id": 484, + "function_signature": "def remove_matching_tuple(test_list1: list[tuple[str, ...]], test_list2: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to remove the matching tuples from the given two tuples.", + "test_case": "assert remove_matching_tuple([('Hello', 'dude'), ('How', 'are'), ('you', '?')], [('Hello', 'dude'), ('How', 'are')]) == [('you', '?')]" + }, + { + "task_id": 485, + "function_signature": "def largest_palindrome(None: list[int]) -> int:", + "text": "Write a function to find the largest palindromic number in the given array.", + "test_case": "assert largest_palindrome([1, 232, 54545, 999991], 4) == 54545" + }, + { + "task_id": 486, + "function_signature": "def binomial_probability(n, k, p):", + "text": "Write a function to compute binomial probability for the given number.", + "test_case": "assert binomial_probability(10, 5, 1.0/3) == 0.13656454808718185" + }, + { + "task_id": 487, + "function_signature": "def sort_tuple(tup: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to sort a list of tuples in increasing order by the last element in each tuple.", + "test_case": "assert sort_tuple([(1, 3), (3, 2), (2, 1)] ) == [(2, 1), (3, 2), (1, 3)]" + }, + { + "task_id": 488, + "function_signature": "def area_pentagon(a: int) -> float:", + "text": "Write a function to find the area of a pentagon.", + "test_case": "assert area_pentagon(5)==43.01193501472417" + }, + { + "task_id": 489, + "function_signature": "def frequency_Of_Largest(n: int, arr: list[int]) -> int:", + "text": "Write a python function to find the frequency of the largest value in a given array.", + "test_case": "assert frequency_Of_Largest(5,[1,2,3,4,4]) == 2" + }, + { + "task_id": 490, + "function_signature": "def extract_symmetric(test_list: list[tuple[int, ...]]) -> set:", + "text": "Write a function to extract all the pairs which are symmetric in the given tuple list.", + "test_case": "assert extract_symmetric([(6, 7), (2, 3), (7, 6), (9, 8), (10, 2), (8, 9)] ) == {(8, 9), (6, 7)}" + }, + { + "task_id": 491, + "function_signature": "def sum_gp(a: int, n: int, r: int) -> int:", + "text": "Write a function to find the sum of geometric progression series.", + "test_case": "assert sum_gp(1,5,2)==31" + }, + { + "task_id": 492, + "function_signature": "def binary_search(item_list: list[int], item: int) -> bool:", + "text": "Write a function to search an element in the given array by using binary search.", + "test_case": "assert binary_search([1,2,3,5,8], 6) == False" + }, + { + "task_id": 493, + "function_signature": "def calculate_polygons(startx: int, starty: int, endx: int, endy: int, radius: int) -> list[list[tuple[float, ...]]]:", + "text": "Write a function to calculate a grid of hexagon coordinates where function returns a list of lists containing 6 tuples of x, y point coordinates.", + "test_case": "assert calculate_polygons(1,1, 4, 4, 3)==[[(-5.0, -4.196152422706632), (-5.0, -0.7320508075688767), (-2.0, 1.0), (1.0, -0.7320508075688767), (1.0, -4.196152422706632), (-2.0, -5.928203230275509), (-5.0, -4.196152422706632)], [(1.0, -4.196152422706632), (1.0, -0.7320508075688767), (4.0, 1.0), (7.0, -0.7320508075688767), (7.0, -4.196152422706632), (4.0, -5.928203230275509), (1.0, -4.196152422706632)], [(7.0, -4.196152422706632), (7.0, -0.7320508075688767), (10.0, 1.0), (13.0, -0.7320508075688767), (13.0, -4.196152422706632), (10.0, -5.928203230275509), (7.0, -4.196152422706632)], [(-2.0, 1.0000000000000004), (-2.0, 4.464101615137755), (1.0, 6.196152422706632), (4.0, 4.464101615137755), (4.0, 1.0000000000000004), (1.0, -0.7320508075688767), (-2.0, 1.0000000000000004)], [(4.0, 1.0000000000000004), (4.0, 4.464101615137755), (7.0, 6.196152422706632), (10.0, 4.464101615137755), (10.0, 1.0000000000000004), (7.0, -0.7320508075688767), (4.0, 1.0000000000000004)], [(-5.0, 6.196152422706632), (-5.0, 9.660254037844387), (-2.0, 11.392304845413264), (1.0, 9.660254037844387), (1.0, 6.196152422706632), (-2.0, 4.464101615137755), (-5.0, 6.196152422706632)], [(1.0, 6.196152422706632), (1.0, 9.660254037844387), (4.0, 11.392304845413264), (7.0, 9.660254037844387), (7.0, 6.196152422706632), (4.0, 4.464101615137755), (1.0, 6.196152422706632)], [(7.0, 6.196152422706632), (7.0, 9.660254037844387), (10.0, 11.392304845413264), (13.0, 9.660254037844387), (13.0, 6.196152422706632), (10.0, 4.464101615137755), (7.0, 6.196152422706632)], [(-2.0, 11.392304845413264), (-2.0, 14.85640646055102), (1.0, 16.588457268119896), (4.0, 14.85640646055102), (4.0, 11.392304845413264), (1.0, 9.660254037844387), (-2.0, 11.392304845413264)], [(4.0, 11.392304845413264), (4.0, 14.85640646055102), (7.0, 16.588457268119896), (10.0, 14.85640646055102), (10.0, 11.392304845413264), (7.0, 9.660254037844387), (4.0, 11.392304845413264)]]" + }, + { + "task_id": 494, + "function_signature": "def binary_to_integer(test_tup: tuple[int, ...]) -> str:", + "text": "Write a function to convert the given binary tuple to integer.", + "test_case": "assert binary_to_integer((1, 1, 0, 1, 0, 0, 1)) == '105'" + }, + { + "task_id": 495, + "function_signature": "def remove_lowercase(str1: str) -> str:", + "text": "Write a function to remove lowercase substrings from a given string by using regex.", + "test_case": "assert remove_lowercase('KDeoALOklOOHserfLoAJSIskdsf') == 'KDALOOOHLAJSI'" + }, + { + "task_id": 496, + "function_signature": "def heap_queue_smallest(nums: list[int], n: int) -> list[int]:", + "text": "Write a function to find the smallest integers from a given list of numbers using heap queue algorithm.", + "test_case": "assert heap_queue_smallest( [25, 35, 22, 85, 14, 65, 75, 25, 58],3)==[14, 22, 25] " + }, + { + "task_id": 497, + "function_signature": "def surfacearea_cone(r: int, h: int) -> float:", + "text": "Write a function to find the surface area of a cone.", + "test_case": "assert surfacearea_cone(5,12)==282.7433388230814" + }, + { + "task_id": 498, + "function_signature": "def gcd(x: int, y: int) -> int:", + "text": "Write a python function to find gcd of two positive integers.", + "test_case": "assert gcd(12, 17) == 1" + }, + { + "task_id": 499, + "function_signature": "def diameter_circle(r: int) -> int:", + "text": "Write a function to find the diameter of a circle.", + "test_case": "assert diameter_circle(10)==20" + }, + { + "task_id": 500, + "function_signature": "def concatenate_elements(list: list[str]) -> str:", + "text": "Write a function to concatenate all elements of the given list into a string.", + "test_case": "assert concatenate_elements(['hello','there','have','a','rocky','day'] ) == ' hello there have a rocky day'" + }, + { + "task_id": 501, + "function_signature": "def num_comm_div(x: int, y: int) -> int:", + "text": "Write a python function to find common divisor between two numbers in a given pair.", + "test_case": "assert num_comm_div(2,4) == 2" + }, + { + "task_id": 502, + "function_signature": "def find(n: int, m: int) -> int:", + "text": "Write a python function to find remainder of two numbers.", + "test_case": "assert find(3,3) == 0" + }, + { + "task_id": 503, + "function_signature": "def add_consecutive_nums(nums: list[int]) -> list[int]:", + "text": "Write a function to add consecutive numbers of a given list.", + "test_case": "assert add_consecutive_nums([1, 1, 3, 4, 4, 5, 6, 7])==[2, 4, 7, 8, 9, 11, 13]" + }, + { + "task_id": 504, + "function_signature": "def sum_Of_Series(n: int) -> int:", + "text": "Write a python function to find the cube sum of first n natural numbers.", + "test_case": "assert sum_Of_Series(5) == 225" + }, + { + "task_id": 505, + "function_signature": "def re_order(A: list[int]) -> list[int]:", + "text": "Write a function to move all zeroes to the end of the given array.", + "test_case": "assert re_order([6, 0, 8, 2, 3, 0, 4, 0, 1]) == [6, 8, 2, 3, 4, 1, 0, 0, 0]" + }, + { + "task_id": 506, + "function_signature": "def permutation_coefficient(n: int, k: int) -> int:", + "text": "Write a function to calculate the permutation coefficient of given p(n, k).", + "test_case": "assert permutation_coefficient(10, 2) == 90" + }, + { + "task_id": 507, + "function_signature": "def remove_words(list1: list[str], removewords: list[str]) -> list[str]:", + "text": "Write a function to remove specific words from a given list.", + "test_case": "assert remove_words(['red', 'green', 'blue', 'white', 'black', 'orange'],['white', 'orange'])==['red', 'green', 'blue', 'black']" + }, + { + "task_id": 508, + "function_signature": "def same_order(l1: list[str], l2: list[str]) -> bool:", + "text": "Write a function to check if the common elements between two given lists are in the same order or not.", + "test_case": "assert same_order([\"red\",\"green\",\"black\",\"orange\"],[\"red\",\"pink\",\"green\",\"white\",\"black\"])==True" + }, + { + "task_id": 509, + "function_signature": "def average_Odd(None: int) -> int:", + "text": "Write a python function to find the average of odd numbers till a given odd number.", + "test_case": "assert average_Odd(9) == 5" + }, + { + "task_id": 510, + "function_signature": "def no_of_subsequences(arr: list[int], k: int) -> int:", + "text": "Write a function to find the number of subsequences having product smaller than k for the given non negative array.", + "test_case": "assert no_of_subsequences([1,2,3,4], 10) == 11" + }, + { + "task_id": 511, + "function_signature": "def find_Min_Sum(num: int) -> int:", + "text": "Write a python function to find minimum sum of factors of a given number.", + "test_case": "assert find_Min_Sum(12) == 7" + }, + { + "task_id": 512, + "function_signature": "def count_element_freq(test_tuple: tuple[int, ...]) -> dict:", + "text": "Write a function to count the element frequency in the mixed nested tuple.", + "test_case": "assert count_element_freq((5, 6, (5, 6), 7, (8, 9), 9) ) == {5: 2, 6: 2, 7: 1, 8: 1, 9: 2}" + }, + { + "task_id": 513, + "function_signature": "def add_str(test_tup: tuple[int, ...], K: str) -> list[int]:", + "text": "Write a function to convert tuple into list by adding the given string after every element.", + "test_case": "assert add_str((5, 6, 7, 4, 9) , \"FDF\") == [5, 'FDF', 6, 'FDF', 7, 'FDF', 4, 'FDF', 9, 'FDF']" + }, + { + "task_id": 514, + "function_signature": "def sum_elements(test_tup: tuple[int, ...]) -> int:", + "text": "Write a function to find the summation of tuple elements in the given tuple list.", + "test_case": "assert sum_elements((7, 8, 9, 1, 10, 7)) == 42" + }, + { + "task_id": 515, + "function_signature": "def modular_sum(arr: list[int], n: int, m: int) -> bool:", + "text": "Write a function to check if there is a subset with sum divisible by m.", + "test_case": "assert modular_sum([3, 1, 7, 5], 4, 6) == True" + }, + { + "task_id": 516, + "function_signature": "def radix_sort(nums: list[int]) -> list[int]:", + "text": "Write a function to sort a list of elements using radix sort.", + "test_case": "assert radix_sort([15, 79, 25, 68, 37]) == [15, 25, 37, 68, 79]" + }, + { + "task_id": 517, + "function_signature": "def largest_pos(list1: list[int]) -> int:", + "text": "Write a python function to find the largest postive number from the given list.", + "test_case": "assert largest_pos([1,2,3,4,-1]) == 4" + }, + { + "task_id": 518, + "function_signature": "def sqrt_root(num: int) -> int:", + "text": "Write a function to find the square root of a perfect number.", + "test_case": "assert sqrt_root(4)==2" + }, + { + "task_id": 519, + "function_signature": "def volume_tetrahedron(num: int) -> float:", + "text": "Write a function to calculate volume of a tetrahedron.", + "test_case": "assert volume_tetrahedron(10)==117.85" + }, + { + "task_id": 520, + "function_signature": "def get_lcm(l: list[int]) -> int:", + "text": "Write a function to find the lcm of the given array elements.", + "test_case": "assert get_lcm([2, 7, 3, 9, 4]) == 252" + }, + { + "task_id": 521, + "function_signature": "def check_isosceles(x: int, y: int, z: int) -> bool:", + "text": "Write a function to print check if the triangle is scalene or not.", + "test_case": "assert check_isosceles(6,8,12)==True" + }, + { + "task_id": 522, + "function_signature": "def lbs(arr: list[int]) -> int:", + "text": "Write a function to find the longest bitonic subsequence for the given array.", + "test_case": "assert lbs([0 , 8 , 4, 12, 2, 10 , 6 , 14 , 1 , 9 , 5 , 13, 3, 11 , 7 , 15]) == 7" + }, + { + "task_id": 523, + "function_signature": "def check_string(str1: str) -> list[str]:", + "text": "Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.", + "test_case": "assert check_string('python')==['String must have 1 upper case character.', 'String must have 1 number.', 'String length should be atleast 8.']" + }, + { + "task_id": 524, + "function_signature": "def max_sum_increasing_subsequence(arr: list[int], n: int) -> int:", + "text": "Write a function to find the sum of maximum increasing subsequence of the given array.", + "test_case": "assert max_sum_increasing_subsequence([1, 101, 2, 3, 100, 4, 5], 7) == 106" + }, + { + "task_id": 525, + "function_signature": "def parallel_lines(line1: list[int], line2: list[int]) -> bool:", + "text": "Write a python function to check whether two given lines are parallel or not.", + "test_case": "assert parallel_lines([2,3,4], [2,3,8]) == True" + }, + { + "task_id": 526, + "function_signature": "def capitalize_first_last_letters(str1: str) -> str:", + "text": "Write a python function to capitalize first and last letters of each word of a given string.", + "test_case": "assert capitalize_first_last_letters(\"python\") == \"PythoN\"" + }, + { + "task_id": 527, + "function_signature": "def get_pairs_count(arr: list[int], n: int, sum: int) -> int:", + "text": "Write a function to find all pairs in an integer array whose sum is equal to a given number.", + "test_case": "assert get_pairs_count([1, 5, 7, -1, 5], 5, 6) == 3" + }, + { + "task_id": 528, + "function_signature": "def min_length(list1: list[list[int]]) -> tuple[int, ...]:", + "text": "Write a function to find the list of lists with minimum length.", + "test_case": "assert min_length([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==(1, [0])" + }, + { + "task_id": 529, + "function_signature": "def jacobsthal_lucas(n: int) -> int:", + "text": "Write a function to find the nth jacobsthal-lucas number.", + "test_case": "assert jacobsthal_lucas(5) == 31" + }, + { + "task_id": 530, + "function_signature": "def negative_count(nums: list[int]) -> float:", + "text": "Write a function to find the ration of negative numbers in an array of integers.", + "test_case": "assert negative_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.31" + }, + { + "task_id": 531, + "function_signature": "def min_coins(coins: list[int], m: int, V: int) -> int:", + "text": "Write a function to find minimum number of coins that make a given value.", + "test_case": "assert min_coins([9, 6, 5, 1] ,4,11)==2" + }, + { + "task_id": 532, + "function_signature": "def check_permutation(str1: str, str2: str) -> bool:", + "text": "Write a function to check if the two given strings are permutations of each other.", + "test_case": "assert check_permutation(\"abc\", \"cba\") == True" + }, + { + "task_id": 533, + "function_signature": "def remove_datatype(test_tuple, data_type):", + "text": "Write a function to remove particular data type elements from the given tuple.", + "test_case": "assert remove_datatype((4, 5, 4, 7.7, 1.2), int) == [7.7, 1.2]" + }, + { + "task_id": 534, + "function_signature": "def search_literal(pattern: str, text: str) -> tuple[int, ...]:", + "text": "Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.", + "test_case": "assert search_literal('python','python programming language')==(0,6)" + }, + { + "task_id": 535, + "function_signature": "def topbottom_surfacearea(r: int) -> float:", + "text": "Write a function to find the top or bottom surface area of a cylinder.", + "test_case": "assert topbottom_surfacearea(10)==314.15000000000003" + }, + { + "task_id": 536, + "function_signature": "def nth_items(list: list[int], n: int) -> list[int]:", + "text": "Write a function to select the nth items of a list.", + "test_case": "assert nth_items([1, 2, 3, 4, 5, 6, 7, 8, 9],2)==[1, 3, 5, 7, 9] " + }, + { + "task_id": 537, + "function_signature": "def first_repeated_word(str1: str) -> str:", + "text": "Write a python function to find the first repeated word in a given string.", + "test_case": "assert first_repeated_word(\"ab ca bc ab\") == \"ab\"" + }, + { + "task_id": 538, + "function_signature": "def string_list_to_tuple(str1: str) -> tuple[str, ...]:", + "text": "Write a python function to convert a given string list to a tuple.", + "test_case": "assert string_list_to_tuple((\"python 3.0\")) == ('p', 'y', 't', 'h', 'o', 'n', '3', '.', '0')" + }, + { + "task_id": 539, + "function_signature": "def basesnum_coresspondingnum(bases_num: list[int], index: list[int]) -> list[int]:", + "text": "Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.", + "test_case": "assert basesnum_coresspondingnum([10, 20, 30, 40, 50, 60, 70, 80, 90, 100],[1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]" + }, + { + "task_id": 540, + "function_signature": "def find_Diff(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the difference between highest and least frequencies in a given array.", + "test_case": "assert find_Diff([1,1,2,2,7,8,4,5,1,4],10) == 2" + }, + { + "task_id": 541, + "function_signature": "def check_abundant(n: int) -> bool:", + "text": "Write a function to find if the given number is abundant or not.", + "test_case": "assert check_abundant(12) == True" + }, + { + "task_id": 542, + "function_signature": "def fill_spaces(text: str) -> str:", + "text": "Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.", + "test_case": "assert fill_spaces('Boult Curve Wireless Neckband') == 'Boult:Curve:Wireless:Neckband'" + }, + { + "task_id": 543, + "function_signature": "def count_digits(num1: int, num2: int) -> int:", + "text": "Write a function to add two numbers and print number of digits of sum.", + "test_case": "assert count_digits(9875,10)==(4)" + }, + { + "task_id": 544, + "function_signature": "def flatten_tuple(test_list: list[tuple[str, ...]]) -> str:", + "text": "Write a function to flatten the tuple list to a string.", + "test_case": "assert flatten_tuple([('1', '4', '6'), ('5', '8'), ('2', '9'), ('1', '10')]) == '1 4 6 5 8 2 9 1 10'" + }, + { + "task_id": 545, + "function_signature": "def toggle_F_and_L_bits(None: int) -> int:", + "text": "Write a python function to toggle only first and last bits of a given number.", + "test_case": "assert toggle_F_and_L_bits(10) == 3" + }, + { + "task_id": 546, + "function_signature": "def last_occurence_char(string: str, char: str) -> int:", + "text": "Write a function to find the last occurrence of a character in a string.", + "test_case": "assert last_occurence_char(\"hello world\",'l')==10" + }, + { + "task_id": 547, + "function_signature": "def Total_Hamming_Distance(n: int) -> int:", + "text": "Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.", + "test_case": "assert Total_Hamming_Distance(4) == 7" + }, + { + "task_id": 548, + "function_signature": "def longest_increasing_subsequence(arr: list[int]) -> int:", + "text": "Write a function to find the length of the longest increasing subsequence of the given sequence.", + "test_case": "assert longest_increasing_subsequence([10, 22, 9, 33, 21, 50, 41, 60]) == 5" + }, + { + "task_id": 549, + "function_signature": "def odd_Num_Sum(None: int) -> int:", + "text": "Write a python function to find the sum of fifth power of first n odd natural numbers.", + "test_case": "assert odd_Num_Sum(1) == 1" + }, + { + "task_id": 550, + "function_signature": "def find_Max(arr: list[int], low: int, high: int) -> int:", + "text": "Write a python function to find the maximum element in a sorted and rotated array.", + "test_case": "assert find_Max([2,3,5,6,9],0,4) == 9" + }, + { + "task_id": 551, + "function_signature": "def extract_column(list1: list[list[int]], n: int) -> list[int]:", + "text": "Write a function to extract a specified column from a given nested list.", + "test_case": "assert extract_column([[1, 2, 3], [2, 4, 5], [1, 1, 1]],0)==[1, 2, 1]" + }, + { + "task_id": 552, + "function_signature": "def Seq_Linear(seq_nums: list[int]) -> str:", + "text": "Write a python function to check whether a given sequence is linear or not.", + "test_case": "assert Seq_Linear([0,2,4,6,8,10]) == \"Linear Sequence\"" + }, + { + "task_id": 553, + "function_signature": "def tuple_to_float(test_tup: tuple[int, ...]) -> float:", + "text": "Write a function to convert the given tuple to a floating-point number.", + "test_case": "assert tuple_to_float((4, 56)) == 4.56" + }, + { + "task_id": 554, + "function_signature": "def Split(list: list[int]) -> list[int]:", + "text": "Write a python function to find odd numbers from a mixed list.", + "test_case": "assert Split([1,2,3,4,5,6]) == [1,3,5]" + }, + { + "task_id": 555, + "function_signature": "def difference(None: int) -> int:", + "text": "Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.", + "test_case": "assert difference(3) == 30" + }, + { + "task_id": 556, + "function_signature": "def find_Odd_Pair(A,N) : \r\n oddPair = 0\r\n for i in range(0,N) : \r\n for j in range(i+1,N) : \r\n if ((A[i] ^ A[j]) % 2 != 0):", + "text": "Write a python function to count the pairs with xor as an odd number.", + "test_case": "assert find_Odd_Pair([5,4,7,2,1],5) == 6" + }, + { + "task_id": 557, + "function_signature": "def toggle_string(string: str) -> str:", + "text": "Write a function to toggle characters case in a string.", + "test_case": "assert toggle_string(\"Python\")==(\"pYTHON\")" + }, + { + "task_id": 558, + "function_signature": "def digit_distance_nums(n1: int, n2: int) -> int:", + "text": "Write a python function to find the digit distance between two integers.", + "test_case": "assert digit_distance_nums(1,2) == 1" + }, + { + "task_id": 559, + "function_signature": "def max_sub_array_sum(a: list[int], size: int) -> int:", + "text": "Write a function to find the largest sum of contiguous subarray in the given array.", + "test_case": "assert max_sub_array_sum([-2, -3, 4, -1, -2, 1, 5, -3], 8) == 7" + }, + { + "task_id": 560, + "function_signature": "def union_elements(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to find the union of elements of the given tuples.", + "test_case": "assert union_elements((3, 4, 5, 6),(5, 7, 4, 10) ) == (3, 4, 5, 6, 7, 10)" + }, + { + "task_id": 561, + "function_signature": "def assign_elements(test_list: list[tuple[int, ...]]) -> dict:", + "text": "Write a function to assign with each element, its pair elements from other similar pairs in the given tuple.", + "test_case": "assert assign_elements([(5, 3), (7, 5), (2, 7), (3, 8), (8, 4)] ) == {3: [8], 5: [3], 7: [5], 2: [7], 8: [4], 4: []}" + }, + { + "task_id": 562, + "function_signature": "def Find_Max_Length(lst: list[list[int]]) -> int:", + "text": "Write a python function to find the maximum length of sublist.", + "test_case": "assert Find_Max_Length([[1],[1,4],[5,6,7,8]]) == 4" + }, + { + "task_id": 563, + "function_signature": "def extract_values(text: str) -> list[str]:", + "text": "Write a function to extract values between quotation marks of a string.", + "test_case": "assert extract_values('\"Python\", \"PHP\", \"Java\"')==['Python', 'PHP', 'Java']" + }, + { + "task_id": 564, + "function_signature": "def count_Pairs(arr: list[int], n: int) -> int:", + "text": "Write a python function to count unequal element pairs from the given array.", + "test_case": "assert count_Pairs([1,2,1],3) == 2" + }, + { + "task_id": 565, + "function_signature": "def split(word: str) -> list[str]:", + "text": "Write a python function to split a string into characters.", + "test_case": "assert split('python') == ['p','y','t','h','o','n']" + }, + { + "task_id": 566, + "function_signature": "def sum_digits(n: int) -> int:", + "text": "Write a function to get the sum of a non-negative integer.", + "test_case": "assert sum_digits(345)==12" + }, + { + "task_id": 567, + "function_signature": "def issort_list(list1: list[int]) -> bool:", + "text": "Write a function to check whether a specified list is sorted or not.", + "test_case": "assert issort_list([1,2,4,6,8,10,12,14,16,17])==True" + }, + { + "task_id": 568, + "function_signature": "def empty_list(length: int) -> list[dict]:", + "text": "Write a function to create a list of empty dictionaries.", + "test_case": "assert empty_list(5)==[{},{},{},{},{}]" + }, + { + "task_id": 569, + "function_signature": "def sort_sublists(list1: list[list[str]]) -> list[list[str]]:", + "text": "Write a function to sort each sublist of strings in a given list of lists.", + "test_case": "assert sort_sublists([['green', 'orange'], ['black', 'white'], ['white', 'black', 'orange']])==[['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]" + }, + { + "task_id": 570, + "function_signature": "def remove_words(list1: list[str], charlist: list[str]) -> list[str]:", + "text": "Write a function to remove words from a given list of strings containing a character or string.", + "test_case": "assert remove_words(['Red color', 'Orange#', 'Green', 'Orange @', \"White\"],['#', 'color', '@'])==['Red', '', 'Green', 'Orange', 'White']" + }, + { + "task_id": 571, + "function_signature": "def max_sum_pair_diff_lessthan_K(arr: list[int], N: int, K: int) -> int:", + "text": "Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.", + "test_case": "assert max_sum_pair_diff_lessthan_K([3, 5, 10, 15, 17, 12, 9], 7, 4) == 62" + }, + { + "task_id": 572, + "function_signature": "def two_unique_nums(nums: list[int]) -> list[int]:", + "text": "Write a python function to remove two duplicate numbers from a given number of lists.", + "test_case": "assert two_unique_nums([1,2,3,2,3,4,5]) == [1, 4, 5]" + }, + { + "task_id": 573, + "function_signature": "def unique_product(list_data: list[int]) -> int:", + "text": "Write a python function to calculate the product of the unique numbers of a given list.", + "test_case": "assert unique_product([10, 20, 30, 40, 20, 50, 60, 40]) == 720000000" + }, + { + "task_id": 574, + "function_signature": "def surfacearea_cylinder(r: int, h: int) -> float:", + "text": "Write a function to find the surface area of a cylinder.", + "test_case": "assert surfacearea_cylinder(10,5)==942.45" + }, + { + "task_id": 575, + "function_signature": "def count_no(A: int, N: int, L: int, R: int) -> int:", + "text": "Write a python function to find nth number in a sequence which is not a multiple of a given number.", + "test_case": "assert count_no(2,3,1,10) == 5" + }, + { + "task_id": 576, + "function_signature": "def is_Sub_Array(A: list[int], B: list[int], n: int, m: int) -> bool:", + "text": "Write a python function to check whether an array is subarray of another or not.", + "test_case": "assert is_Sub_Array([1,4,3,5],[1,2],4,2) == False" + }, + { + "task_id": 577, + "function_signature": "def last_Digit_Factorial(n: int) -> int:", + "text": "Write a python function to find the last digit in factorial of a given number.", + "test_case": "assert last_Digit_Factorial(4) == 4" + }, + { + "task_id": 578, + "function_signature": "def interleave_lists(list1: list[int], list2: list[int], list3: list[int]) -> list[int]:", + "text": "Write a function to interleave lists of the same length.", + "test_case": "assert interleave_lists([1,2,3,4,5,6,7],[10,20,30,40,50,60,70],[100,200,300,400,500,600,700])==[1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]" + }, + { + "task_id": 579, + "function_signature": "def find_dissimilar(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to find the dissimilar elements in the given two tuples.", + "test_case": "assert find_dissimilar((3, 4, 5, 6), (5, 7, 4, 10)) == (3, 6, 7, 10)" + }, + { + "task_id": 580, + "function_signature": "def extract_even(test_tuple: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to extract the even elements in the nested mixed tuple.", + "test_case": "assert extract_even((4, 5, (7, 6, (2, 4)), 6, 8)) == (4, (6, (2, 4)), 6, 8)" + }, + { + "task_id": 581, + "function_signature": "def surface_Area(b: int, s: int) -> int:", + "text": "Write a python function to find the surface area of the square pyramid.", + "test_case": "assert surface_Area(3,4) == 33" + }, + { + "task_id": 582, + "function_signature": "def my_dict(dict1: set) -> bool:", + "text": "Write a function to check if a dictionary is empty or not.", + "test_case": "assert my_dict({10})==False" + }, + { + "task_id": 583, + "function_signature": "def catalan_number(num: int) -> int:", + "text": "Write a function for nth catalan number.", + "test_case": "assert catalan_number(10)==16796" + }, + { + "task_id": 584, + "function_signature": "def find_adverbs(text: str) -> str:", + "text": "Write a function to find all adverbs and their positions in a given sentence by using regex.", + "test_case": "assert find_adverbs(\"Clearly, he has no excuse for such behavior.\") == '0-7: Clearly'" + }, + { + "task_id": 585, + "function_signature": "def expensive_items(items: list[dict], n: int) -> list[dict]:", + "text": "Write a function to find the n - expensive price items from a given dataset using heap queue algorithm.", + "test_case": "assert expensive_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-2', 'price': 555.22}]" + }, + { + "task_id": 586, + "function_signature": "def split_Arr(a: list[int], n: int, k: int) -> list[int]:", + "text": "Write a python function to split the array and add the first part to the end.", + "test_case": "assert split_Arr([12,10,5,6,52,36],6,2) == [5,6,52,36,12,10]" + }, + { + "task_id": 587, + "function_signature": "def list_tuple(listx: list[int]) -> tuple[int, ...]:", + "text": "Write a function to convert a list to a tuple.", + "test_case": "assert list_tuple([5, 10, 7, 4, 15, 3])==(5, 10, 7, 4, 15, 3)" + }, + { + "task_id": 588, + "function_signature": "def big_diff(nums: list[int]) -> int:", + "text": "Write a python function to find the difference between largest and smallest value in a given array.", + "test_case": "assert big_diff([1,2,3,4]) == 3" + }, + { + "task_id": 589, + "function_signature": "def perfect_squares(a: int, b: int) -> list[int]:", + "text": "Write a function to find perfect squares between two given numbers.", + "test_case": "assert perfect_squares(1,30)==[1, 4, 9, 16, 25]" + }, + { + "task_id": 590, + "function_signature": "def polar_rect(x: int, y: int) -> tuple[tuple[float, ...], ...]:", + "text": "Write a function to convert polar coordinates to rectangular coordinates.", + "test_case": "assert polar_rect(3,4)==((5.0, 0.9272952180016122), (-2+2.4492935982947064e-16j))" + }, + { + "task_id": 591, + "function_signature": "def swap_List(newList: list[int]) -> list[int]:", + "text": "Write a python function to interchange the first and last elements in a list.", + "test_case": "assert swap_List([12, 35, 9, 56, 24]) == [24, 35, 9, 56, 12]" + }, + { + "task_id": 592, + "function_signature": "def sum_Of_product(n: int) -> int:", + "text": "Write a python function to find sum of product of binomial co-efficients.", + "test_case": "assert sum_Of_product(3) == 15" + }, + { + "task_id": 593, + "function_signature": "def removezero_ip(ip: str) -> str:", + "text": "Write a function to remove leading zeroes from an ip address.", + "test_case": "assert removezero_ip(\"216.08.094.196\")==('216.8.94.196') " + }, + { + "task_id": 594, + "function_signature": "def diff_even_odd(list1: list[int]) -> int:", + "text": "Write a function to find the difference of first even and odd number of a given list.", + "test_case": "assert diff_even_odd([1,3,5,7,4,1,6,8])==3" + }, + { + "task_id": 595, + "function_signature": "def min_Swaps(None: str) -> int:", + "text": "Write a python function to count minimum number of swaps required to convert one binary string to another.", + "test_case": "assert min_Swaps(\"1101\",\"1110\") == 1" + }, + { + "task_id": 596, + "function_signature": "def tuple_size(tuple_list):", + "text": "Write a function to find the size of the given tuple.", + "test_case": "assert tuple_size((\"A\", 1, \"B\", 2, \"C\", 3) ) == sys.getsizeof((\"A\", 1, \"B\", 2, \"C\", 3))" + }, + { + "task_id": 597, + "function_signature": "def find_kth(arr1: list[int], arr2: list[int], m: int, n: int, k: int) -> int:", + "text": "Write a function to find kth element from the given two sorted arrays.", + "test_case": "assert find_kth([2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5) == 6" + }, + { + "task_id": 598, + "function_signature": "def armstrong_number(number: int) -> bool:", + "text": "Write a function to check whether the given number is armstrong or not.", + "test_case": "assert armstrong_number(153)==True" + }, + { + "task_id": 599, + "function_signature": "def sum_average(number: int) -> tuple[int, ...]:", + "text": "Write a function to find sum and average of first n natural numbers.", + "test_case": "assert sum_average(10)==(55, 5.5)" + }, + { + "task_id": 600, + "function_signature": "def is_Even(None: int) -> bool:", + "text": "Write a python function to check whether the given number is even or not using bitwise operator.", + "test_case": "assert is_Even(1) == False" + }, + { + "task_id": 601, + "function_signature": "def max_chain_length(arr, n):", + "text": "Write a function to find the longest chain which can be formed from the given set of pairs.", + "test_case": "assert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), Pair(50, 60)], 4) == 3" + }, + { + "task_id": 602, + "function_signature": "def first_repeated_char(str1: str) -> str:", + "text": "Write a python function to find the first repeated character in a given string.", + "test_case": "assert first_repeated_char(\"abcabc\") == \"a\"" + }, + { + "task_id": 603, + "function_signature": "def get_ludic(n: int) -> list[int]:", + "text": "Write a function to get a lucid number smaller than or equal to n.", + "test_case": "assert get_ludic(10) == [1, 2, 3, 5, 7]" + }, + { + "task_id": 604, + "function_signature": "def reverse_words(s: str) -> str:", + "text": "Write a function to reverse words in a given string.", + "test_case": "assert reverse_words(\"python program\")==(\"program python\")" + }, + { + "task_id": 605, + "function_signature": "def prime_num(num: int) -> bool:", + "text": "Write a function to check if the given integer is a prime number.", + "test_case": "assert prime_num(13)==True" + }, + { + "task_id": 606, + "function_signature": "def radian_degree(degree: int) -> float:", + "text": "Write a function to convert degrees to radians.", + "test_case": "assert radian_degree(90)==1.5707963267948966" + }, + { + "task_id": 607, + "function_signature": "def find_literals(text: str, pattern: str) -> tuple[str, ...]:", + "text": "Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs by using regex.", + "test_case": "assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)" + }, + { + "task_id": 608, + "function_signature": "def bell_Number(n: int) -> int:", + "text": "Write a python function to find nth bell number.", + "test_case": "assert bell_Number(2) == 2" + }, + { + "task_id": 609, + "function_signature": "def floor_Min(A: int, B: int, N: int) -> int:", + "text": "Write a python function to find minimum possible value for the given periodic function.", + "test_case": "assert floor_Min(10,20,30) == 15" + }, + { + "task_id": 610, + "function_signature": "def remove_kth_element(list1: list[int], L: int) -> list[int]:", + "text": "Write a python function to remove the k'th element from a given list.", + "test_case": "assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]" + }, + { + "task_id": 611, + "function_signature": "def max_of_nth(test_list: list[tuple[int, ...]], N: int) -> int:", + "text": "Write a function to find the maximum of nth column from the given tuple list.", + "test_case": "assert max_of_nth([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 19" + }, + { + "task_id": 612, + "function_signature": "def merge(lst: list[list[str]]) -> list[list[str]]:", + "text": "Write a python function to merge the first and last elements separately in a list of lists.", + "test_case": "assert merge([['x', 'y'], ['a', 'b'], ['m', 'n']]) == [['x', 'a', 'm'], ['y', 'b', 'n']]" + }, + { + "task_id": 613, + "function_signature": "def maximum_value(test_list: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to find the maximum value in record list as tuple attribute in the given tuple list.", + "test_case": "assert maximum_value([('key1', [3, 4, 5]), ('key2', [1, 4, 2]), ('key3', [9, 3])]) == [('key1', 5), ('key2', 4), ('key3', 9)]" + }, + { + "task_id": 614, + "function_signature": "def cummulative_sum(test_list: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the cumulative sum of all the values that are present in the given tuple list.", + "test_case": "assert cummulative_sum([(1, 3), (5, 6, 7), (2, 6)]) == 30" + }, + { + "task_id": 615, + "function_signature": "def average_tuple(nums: tuple[tuple[int, ...], ...]) -> list[float]:", + "text": "Write a function to find average value of the numbers in a given tuple of tuples.", + "test_case": "assert average_tuple(((10, 10, 10, 12), (30, 45, 56, 45), (81, 80, 39, 32), (1, 2, 3, 4)))==[30.5, 34.25, 27.0, 23.25]" + }, + { + "task_id": 616, + "function_signature": "def tuple_modulo(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to perfom the modulo of tuple elements in the given two tuples.", + "test_case": "assert tuple_modulo((10, 4, 5, 6), (5, 6, 7, 5)) == (0, 4, 5, 1)" + }, + { + "task_id": 617, + "function_signature": "def min_Jumps(a: int, b: int, d: int) -> float:", + "text": "Write a function to check for the number of jumps required of given length to reach a point of form (d, 0) from origin in a 2d plane.", + "test_case": "assert min_Jumps(3,4,11)==3.5" + }, + { + "task_id": 618, + "function_signature": "def div_list(nums1: list[int], nums2: list[int]) -> list[float]:", + "text": "Write a function to divide two lists using map and lambda function.", + "test_case": "assert div_list([4,5,6],[1, 2, 3])==[4.0,2.5,2.0]" + }, + { + "task_id": 619, + "function_signature": "def move_num(test_str: str) -> str:", + "text": "Write a function to move all the numbers in it to the given string.", + "test_case": "assert move_num('I1love143you55three3000thousand') == 'Iloveyouthreethousand1143553000'" + }, + { + "task_id": 620, + "function_signature": "def largest_subset(a: list[int], n: int) -> int:", + "text": "Write a function to find the largest subset where each pair is divisible.", + "test_case": "assert largest_subset([ 1, 3, 6, 13, 17, 18 ], 6) == 4" + }, + { + "task_id": 621, + "function_signature": "def increment_numerics(test_list: list[str], K: int) -> list[str]:", + "text": "Write a function to increment the numeric values in the given strings by k.", + "test_case": "assert increment_numerics([\"MSM\", \"234\", \"is\", \"98\", \"123\", \"best\", \"4\"] , 6) == ['MSM', '240', 'is', '104', '129', 'best', '10']" + }, + { + "task_id": 622, + "function_signature": "def get_median(arr1: list[int], arr2: list[int], n: int) -> float:", + "text": "Write a function to find the median of two sorted arrays of same size.", + "test_case": "assert get_median([1, 12, 15, 26, 38], [2, 13, 17, 30, 45], 5) == 16.0" + }, + { + "task_id": 623, + "function_signature": "def nth_nums(nums: list[int], n: int) -> list[int]:", + "text": "Write a function to find the n-th power of individual elements in a list using lambda function.", + "test_case": "assert nth_nums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],2)==[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" + }, + { + "task_id": 624, + "function_signature": "def is_upper(string: str) -> str:", + "text": "Write a python function to convert the given string to upper case.", + "test_case": "assert is_upper(\"person\") ==\"PERSON\"" + }, + { + "task_id": 625, + "function_signature": "def swap_List(newList: list[int]) -> list[int]:", + "text": "Write a python function to interchange first and last elements in a given list.", + "test_case": "assert swap_List([1,2,3]) == [3,2,1]" + }, + { + "task_id": 626, + "function_signature": "def triangle_area(None: int) -> int:", + "text": "Write a python function to find the largest triangle that can be inscribed in the semicircle.", + "test_case": "assert triangle_area(0) == 0" + }, + { + "task_id": 627, + "function_signature": "def find_First_Missing(array: list[int], start: int, end: int) -> int:", + "text": "Write a python function to find the smallest missing number from the given array.", + "test_case": "assert find_First_Missing([0,1,2,3],0,3) == 4" + }, + { + "task_id": 628, + "function_signature": "def replace_spaces(string: str) -> str:", + "text": "Write a function to replace all spaces in the given string with character * list item * list item * list item * list item '%20'.", + "test_case": "assert replace_spaces(\"My Name is Dawood\") == 'My%20Name%20is%20Dawood'" + }, + { + "task_id": 629, + "function_signature": "def Split(list: list[int]) -> list[int]:", + "text": "Write a python function to find even numbers from a mixed list.", + "test_case": "assert Split([1,2,3,4,5]) == [2,4]" + }, + { + "task_id": 630, + "function_signature": "def get_coordinates(test_tup: tuple[int, ...]) -> list[list[int]]:", + "text": "Write a function to extract all the adjacent coordinates of the given coordinate tuple.", + "test_case": "assert get_coordinates((3, 4)) == [[2, 3], [2, 4], [2, 5], [3, 3], [3, 4], [3, 5], [4, 3], [4, 4], [4, 5]]" + }, + { + "task_id": 631, + "function_signature": "def replace_spaces(text: str) -> str:", + "text": "Write a function to replace whitespaces with an underscore and vice versa in a given string by using regex.", + "test_case": "assert replace_spaces('Jumanji The Jungle') == 'Jumanji_The_Jungle'" + }, + { + "task_id": 632, + "function_signature": "def move_zero(num_list: list[int]) -> list[int]:", + "text": "Write a python function to move all zeroes to the end of the given list.", + "test_case": "assert move_zero([1,0,2,0,3,4]) == [1,2,3,4,0,0]" + }, + { + "task_id": 633, + "function_signature": "def pair_OR_Sum(None: list[int]) -> int:", + "text": "Write a python function to find the sum of xor of all pairs of numbers in the given array.", + "test_case": "assert pair_OR_Sum([5,9,7,6],4) == 47" + }, + { + "task_id": 634, + "function_signature": "def even_Power_Sum(n: int) -> int:", + "text": "Write a python function to find the sum of fourth power of first n even natural numbers.", + "test_case": "assert even_Power_Sum(2) == 272" + }, + { + "task_id": 635, + "function_signature": "def heap_sort(iterable: list[int]) -> list[int]:", + "text": "Write a function to push all values into a heap and then pop off the smallest values one at a time.", + "test_case": "assert heap_sort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" + }, + { + "task_id": 636, + "function_signature": "def Check_Solution(a: int, b: int, c: int) -> str:", + "text": "Write a python function to check if roots of a quadratic equation are reciprocal of each other or not.", + "test_case": "assert Check_Solution(2,0,2) == \"Yes\"" + }, + { + "task_id": 637, + "function_signature": "def noprofit_noloss(actual_cost: int, sale_amount: int) -> bool:", + "text": "Write a function to check whether the given amount has no profit and no loss", + "test_case": "assert noprofit_noloss(1500,1200)==False" + }, + { + "task_id": 638, + "function_signature": "def wind_chill(v: int, t: int) -> int:", + "text": "Write a function to calculate wind chill index.", + "test_case": "assert wind_chill(120,35)==40" + }, + { + "task_id": 639, + "function_signature": "def sample_nam(sample_names: list[str]) -> int:", + "text": "Write a function to sum the length of the names of a given list of names after removing the names that start with a lowercase letter.", + "test_case": "assert sample_nam(['sally', 'Dylan', 'rebecca', 'Diana', 'Joanne', 'keith'])==16" + }, + { + "task_id": 640, + "function_signature": "def remove_parenthesis(items: list[str]) -> str:", + "text": "Write a function to remove the parenthesis area in a string.", + "test_case": "assert remove_parenthesis([\"python (chrome)\"])==(\"python\")" + }, + { + "task_id": 641, + "function_signature": "def is_nonagonal(n: int) -> int:", + "text": "Write a function to find the nth nonagonal number.", + "test_case": "assert is_nonagonal(10) == 325" + }, + { + "task_id": 642, + "function_signature": "def remove_similar_row(test_list: list[list[tuple[int, ...]]]) -> set:", + "text": "Write a function to remove similar rows from the given tuple matrix.", + "test_case": "assert remove_similar_row([[(4, 5), (3, 2)], [(2, 2), (4, 6)], [(3, 2), (4, 5)]] ) == {((2, 2), (4, 6)), ((3, 2), (4, 5))}" + }, + { + "task_id": 643, + "function_signature": "def text_match_wordz_middle(text: str) -> str:", + "text": "Write a function that matches a word containing 'z', not at the start or end of the word.", + "test_case": "assert text_match_wordz_middle(\"pythonzabc.\")==('Found a match!')" + }, + { + "task_id": 644, + "function_signature": "def reverse_Array_Upto_K(input: list[int], k: int) -> list[int]:", + "text": "Write a python function to reverse an array upto a given position.", + "test_case": "assert reverse_Array_Upto_K([1, 2, 3, 4, 5, 6],4) == [4, 3, 2, 1, 5, 6]" + }, + { + "task_id": 645, + "function_signature": "def find_k_product(test_list: list[tuple[int, ...]], K: int) -> int:", + "text": "Write a function to find the product of it’s kth index in the given tuples.", + "test_case": "assert find_k_product([(5, 6, 7), (1, 3, 5), (8, 9, 19)], 2) == 665" + }, + { + "task_id": 646, + "function_signature": "def No_of_cubes(N: int, K: int) -> int:", + "text": "Write a python function to count number of cubes of size k in a cube of size n.", + "test_case": "assert No_of_cubes(2,1) == 8" + }, + { + "task_id": 647, + "function_signature": "def split_upperstring(text: str) -> list[str]:", + "text": "Write a function to split a string at uppercase letters.", + "test_case": "assert split_upperstring(\"PythonProgramLanguage\")==['Python','Program','Language']" + }, + { + "task_id": 648, + "function_signature": "def exchange_elements(lst: list[int]) -> list[int]:", + "text": "Write a function to exchange the position of every n-th value with (n+1)th value and (n+1)th value with n-th value in a given list.", + "test_case": "assert exchange_elements([0,1,2,3,4,5])==[1, 0, 3, 2, 5, 4] " + }, + { + "task_id": 649, + "function_signature": "def sum_Range_list(nums: list[int], m: int, n: int) -> int:", + "text": "Write a python function to calculate the sum of the numbers in a list between the indices of a specified range.", + "test_case": "assert sum_Range_list([2, 1, 5, 6, 8, 3, 4, 9, 10, 11, 8, 12],8,10) == 29" + }, + { + "task_id": 650, + "function_signature": "def are_Equal(arr1: list[int], arr2: list[int], n: int, m: int) -> bool:", + "text": "Write a python function to check whether the given two arrays are equal or not.", + "test_case": "assert are_Equal([1,2,3],[3,2,1],3,3) == True" + }, + { + "task_id": 651, + "function_signature": "def check_subset(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> bool:", + "text": "Write a function to check if one tuple is a subset of another tuple.", + "test_case": "assert check_subset((10, 4, 5, 6), (5, 10)) == True" + }, + { + "task_id": 652, + "function_signature": "def matrix_to_list(test_list: list[list[tuple[int, ...]]]) -> str:", + "text": "Write a function to flatten the given tuple matrix into the tuple list with each tuple representing each column.", + "test_case": "assert matrix_to_list([[(4, 5), (7, 8)], [(10, 13), (18, 17)], [(0, 4), (10, 1)]]) == '[(4, 7, 10, 18, 0, 10), (5, 8, 13, 17, 4, 1)]'" + }, + { + "task_id": 653, + "function_signature": "def grouping_dictionary(l: list[tuple[str, ...]]) -> dict:", + "text": "Write a function to group a sequence of key-value pairs into a dictionary of lists using collections module.", + "test_case": "assert grouping_dictionary([('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)])== ({'yellow': [1, 3], 'blue': [2, 4], 'red': [1]})" + }, + { + "task_id": 654, + "function_signature": "def rectangle_perimeter(l: int, b: int) -> int:", + "text": "Write a function to find the perimeter of a rectangle.", + "test_case": "assert rectangle_perimeter(10,20)==60" + }, + { + "task_id": 655, + "function_signature": "def fifth_Power_Sum(None: int) -> int:", + "text": "Write a python function to find the sum of fifth power of n natural numbers.", + "test_case": "assert fifth_Power_Sum(2) == 33" + }, + { + "task_id": 656, + "function_signature": "def find_Min_Sum(a: list[int], b: list[int], n: int) -> int:", + "text": "Write a python function to find the minimum sum of absolute differences of two arrays.", + "test_case": "assert find_Min_Sum([3,2,1],[2,1,3],3) == 0" + }, + { + "task_id": 657, + "function_signature": "def first_Digit(None: int) -> int:", + "text": "Write a python function to find the first digit in factorial of a given number.", + "test_case": "assert first_Digit(5) == 1" + }, + { + "task_id": 658, + "function_signature": "def max_occurrences(list1: list[int]) -> int:", + "text": "Write a function to find the item with maximum occurrences in a given list.", + "test_case": "assert max_occurrences([2,3,8,4,7,9,8,2,6,5,1,6,1,2,3,4,6,9,1,2])==2" + }, + { + "task_id": 659, + "function_signature": "def Repeat(x: list[int]) -> list[int]:", + "text": "Write a python function to print duplicants from a list of integers.", + "test_case": "assert Repeat([10, 20, 30, 20, 20, 30, 40, 50, -20, 60, 60, -20, -20]) == [20, 30, -20, 60]" + }, + { + "task_id": 660, + "function_signature": "def find_Points(l1: int, r1: int, l2: int, r2: int) -> tuple[int, ...]:", + "text": "Write a python function to choose points from two ranges such that no point lies in both the ranges.", + "test_case": "assert find_Points(5,10,1,5) == (1,10)" + }, + { + "task_id": 661, + "function_signature": "def max_sum_of_three_consecutive(arr: list[int], n: int) -> int:", + "text": "Write a function to find the maximum sum that can be formed which has no three consecutive elements present.", + "test_case": "assert max_sum_of_three_consecutive([100, 1000, 100, 1000, 1], 5) == 2101" + }, + { + "task_id": 662, + "function_signature": "def sorted_dict(dict1: dict) -> dict:", + "text": "Write a function to sort a list in a dictionary.", + "test_case": "assert sorted_dict({'n1': [2, 3, 1], 'n2': [5, 1, 2], 'n3': [3, 2, 4]})=={'n1': [1, 2, 3], 'n2': [1, 2, 5], 'n3': [2, 3, 4]}" + }, + { + "task_id": 663, + "function_signature": "def find_max_val(n: int, x: int, y: int) -> int:", + "text": "Write a function to find the largest possible value of k such that k modulo x is y.", + "test_case": "assert find_max_val(15, 10, 5) == 15" + }, + { + "task_id": 664, + "function_signature": "def average_Even(None: int) -> int:", + "text": "Write a python function to find the average of even numbers till a given even number.", + "test_case": "assert average_Even(2) == 2" + }, + { + "task_id": 665, + "function_signature": "def move_last(num_list: list[int]) -> list[int]:", + "text": "Write a python function to shift first element to the end of given list.", + "test_case": "assert move_last([1,2,3,4]) == [2,3,4,1]" + }, + { + "task_id": 666, + "function_signature": "def count_char(string: str, char: str) -> int:", + "text": "Write a function to count occurrence of a character in a string.", + "test_case": "assert count_char(\"Python\",'o')==1" + }, + { + "task_id": 667, + "function_signature": "def Check_Vow(string: str, vowels: str) -> int:", + "text": "Write a python function to count number of vowels in the string.", + "test_case": "assert Check_Vow('corner','AaEeIiOoUu') == 2" + }, + { + "task_id": 668, + "function_signature": "def replace(string: str, char: str) -> str:", + "text": "Write a python function to replace multiple occurence of character by single.", + "test_case": "assert replace('peep','e') == 'pep'" + }, + { + "task_id": 669, + "function_signature": "def check_IP(Ip: str) -> str:", + "text": "Write a function to check whether the given ip address is valid or not using regex.", + "test_case": "assert check_IP(\"192.168.0.1\") == 'Valid IP address'" + }, + { + "task_id": 670, + "function_signature": "def decreasing_trend(nums: list[int]) -> bool:", + "text": "Write a python function to check whether a sequence of numbers has a decreasing trend or not.", + "test_case": "assert decreasing_trend([-4,-3,-2,-1]) == True" + }, + { + "task_id": 671, + "function_signature": "def set_Right_most_Unset_Bit(n: int) -> int:", + "text": "Write a python function to set the right most unset bit.", + "test_case": "assert set_Right_most_Unset_Bit(21) == 23" + }, + { + "task_id": 672, + "function_signature": "def max_of_three(num1: int, num2: int, num3: int) -> int:", + "text": "Write a function to find maximum of three numbers.", + "test_case": "assert max_of_three(10,20,30)==30" + }, + { + "task_id": 673, + "function_signature": "def convert(list: list[int]) -> int:", + "text": "Write a python function to convert a list of multiple integers into a single integer.", + "test_case": "assert convert([1,2,3]) == 123" + }, + { + "task_id": 674, + "function_signature": "def remove_duplicate(string: str) -> str:", + "text": "Write a function to remove duplicate words from a given string using collections module.", + "test_case": "assert remove_duplicate(\"Python Exercises Practice Solution Exercises\")==(\"Python Exercises Practice Solution\")" + }, + { + "task_id": 675, + "function_signature": "def sum_nums(x: int, y: int, m: int, n: int) -> int:", + "text": "Write a function to add two integers. however, if the sum is between the given range it will return 20.", + "test_case": "assert sum_nums(2,10,11,20)==20" + }, + { + "task_id": 676, + "function_signature": "def remove_extra_char(text1: str) -> str:", + "text": "Write a function to remove everything except alphanumeric characters from the given string by using regex.", + "test_case": "assert remove_extra_char('**//Google Android// - 12. ') == 'GoogleAndroid12'" + }, + { + "task_id": 677, + "function_signature": "def validity_triangle(a: int, b: int, c: int) -> bool:", + "text": "Write a function to check if the triangle is valid or not.", + "test_case": "assert validity_triangle(60,50,90)==False" + }, + { + "task_id": 678, + "function_signature": "def remove_spaces(str1: str) -> str:", + "text": "Write a python function to remove spaces from a given string.", + "test_case": "assert remove_spaces(\"a b c\") == \"abc\"" + }, + { + "task_id": 679, + "function_signature": "def access_key(ditionary: dict, key: int) -> str:", + "text": "Write a function to access dictionary key’s element by index.", + "test_case": "assert access_key({'physics': 80, 'math': 90, 'chemistry': 86},0)== 'physics'" + }, + { + "task_id": 680, + "function_signature": "def increasing_trend(nums: list[int]) -> bool:", + "text": "Write a python function to check whether a sequence of numbers has an increasing trend or not.", + "test_case": "assert increasing_trend([1,2,3,4]) == True" + }, + { + "task_id": 681, + "function_signature": "def smallest_Divisor(n: int) -> int:", + "text": "Write a python function to find the smallest prime divisor of a number.", + "test_case": "assert smallest_Divisor(10) == 2" + }, + { + "task_id": 682, + "function_signature": "def mul_list(nums1: list[int], nums2: list[int]) -> list[int]:", + "text": "Write a function to multiply two lists using map and lambda function.", + "test_case": "assert mul_list([1, 2, 3],[4,5,6])==[4,10,18]" + }, + { + "task_id": 683, + "function_signature": "def sum_Square(None: int) -> bool:", + "text": "Write a python function to check whether the given number can be represented by sum of two squares or not.", + "test_case": "assert sum_Square(25) == True" + }, + { + "task_id": 684, + "function_signature": "def count_Char(str: str, x: str) -> int:", + "text": "Write a python function to count occurences of a character in a repeated string.", + "test_case": "assert count_Char(\"abcac\",'a') == 4" + }, + { + "task_id": 685, + "function_signature": "def sum_Of_Primes(n: int) -> int:", + "text": "Write a python function to find sum of prime numbers between 1 to n.", + "test_case": "assert sum_Of_Primes(10) == 17" + }, + { + "task_id": 686, + "function_signature": "def freq_element(test_tup: tuple[int, ...]) -> str:", + "text": "Write a function to find the frequency of each element in the given list.", + "test_case": "assert freq_element((4, 5, 4, 5, 6, 6, 5, 5, 4) ) == '{4: 3, 5: 4, 6: 2}'" + }, + { + "task_id": 687, + "function_signature": "def recur_gcd(a: int, b: int) -> int:", + "text": "Write a function to find the greatest common divisor (gcd) of two integers by using recursion.", + "test_case": "assert recur_gcd(12,14) == 2" + }, + { + "task_id": 688, + "function_signature": "def len_complex(a: int, b: int) -> float:", + "text": "Write a function to get the length of a complex number.", + "test_case": "assert len_complex(3,4)==5.0" + }, + { + "task_id": 689, + "function_signature": "def min_jumps(arr: list[int], n: int) -> int:", + "text": "## write a function to find the minimum number of jumps to reach the end of the array for the given array of integers where each element represents the max number of steps that can be made forward from that element. > indented block > indented block", + "test_case": "assert min_jumps([1, 3, 6, 1, 0, 9], 6) == 3" + }, + { + "task_id": 690, + "function_signature": "def mul_consecutive_nums(nums: list[int]) -> list[int]:", + "text": "Write a function to multiply consecutive numbers of a given list.", + "test_case": "assert mul_consecutive_nums([1, 1, 3, 4, 4, 5, 6, 7])==[1, 3, 12, 16, 20, 30, 42]" + }, + { + "task_id": 691, + "function_signature": "def group_element(test_list: list[tuple[int, ...]]) -> dict:", + "text": "Write a function to group the 1st elements on the basis of 2nd elements in the given tuple list.", + "test_case": "assert group_element([(6, 5), (2, 7), (2, 5), (8, 7), (9, 8), (3, 7)]) == {5: [6, 2], 7: [2, 8, 3], 8: [9]}" + }, + { + "task_id": 692, + "function_signature": "def last_Two_Digits(N: int) -> int:", + "text": "Write a python function to find the last two digits in factorial of a given number.", + "test_case": "assert last_Two_Digits(7) == 40" + }, + { + "task_id": 693, + "function_signature": "def remove_multiple_spaces(text1: str) -> str:", + "text": "Write a function to remove multiple spaces in a string by using regex.", + "test_case": "assert remove_multiple_spaces('Google Assistant') == 'Google Assistant'" + }, + { + "task_id": 694, + "function_signature": "def extract_unique(test_dict: dict) -> list[int]:", + "text": "Write a function to extract unique values from the given dictionary values.", + "test_case": "assert extract_unique({'msm' : [5, 6, 7, 8],'is' : [10, 11, 7, 5],'best' : [6, 12, 10, 8],'for' : [1, 2, 5]} ) == [1, 2, 5, 6, 7, 8, 10, 11, 12]" + }, + { + "task_id": 695, + "function_signature": "def check_greater(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> bool:", + "text": "Write a function to check if each element of the second tuple is greater than its corresponding index in the first tuple.", + "test_case": "assert check_greater((10, 4, 5), (13, 5, 18)) == True" + }, + { + "task_id": 696, + "function_signature": "def zip_list(list1: list[list[int]], list2: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to zip two given lists of lists.", + "test_case": "assert zip_list([[1, 3], [5, 7], [9, 11]] ,[[2, 4], [6, 8], [10, 12, 14]] )==[[1, 3, 2, 4], [5, 7, 6, 8], [9, 11, 10, 12, 14]]" + }, + { + "task_id": 697, + "function_signature": "def count_even(array_nums: list[int]) -> int:", + "text": "Write a function to find number of even elements in the given list using lambda function.", + "test_case": "assert count_even([1, 2, 3, 5, 7, 8, 9, 10])==3" + }, + { + "task_id": 698, + "function_signature": "def sort_dict_item(test_dict: dict) -> dict:", + "text": "Write a function to sort dictionary items by tuple product of keys for the given dictionary with tuple keys.", + "test_case": "assert sort_dict_item({(5, 6) : 3, (2, 3) : 9, (8, 4): 10, (6, 4): 12} ) == {(2, 3): 9, (6, 4): 12, (5, 6): 3, (8, 4): 10}" + }, + { + "task_id": 699, + "function_signature": "def min_Swaps(None: str) -> int:", + "text": "Write a python function to find the minimum number of swaps required to convert one binary string to another.", + "test_case": "assert min_Swaps(\"1101\",\"1110\") == 1" + }, + { + "task_id": 700, + "function_signature": "def count_range_in_list(li: list[int], min: int, max: int) -> int:", + "text": "Write a function to count the number of elements in a list which are within a specific range.", + "test_case": "assert count_range_in_list([10,20,30,40,40,40,70,80,99],40,100)==6" + }, + { + "task_id": 701, + "function_signature": "def equilibrium_index(arr: list[int]) -> int:", + "text": "Write a function to find the equilibrium index of the given array.", + "test_case": "assert equilibrium_index([1, 2, 3, 4, 1, 2, 3]) == 3" + }, + { + "task_id": 702, + "function_signature": "def removals(arr: list[int], n: int, k: int) -> int:", + "text": "Write a function to find the minimum number of elements that should be removed such that amax-amin<=k.", + "test_case": "assert removals([1, 3, 4, 9, 10,11, 12, 17, 20], 9, 4) == 5" + }, + { + "task_id": 703, + "function_signature": "def is_key_present(d: dict, x: int) -> bool:", + "text": "Write a function to check whether the given key is present in the dictionary or not.", + "test_case": "assert is_key_present({1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60},5)==True" + }, + { + "task_id": 704, + "function_signature": "def harmonic_sum(n: int) -> float:", + "text": "Write a function to calculate the harmonic sum of n-1.", + "test_case": "assert harmonic_sum(10)==2.9289682539682538" + }, + { + "task_id": 705, + "function_signature": "def sort_sublists(list1: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to sort a list of lists by length and value.", + "test_case": "assert sort_sublists([[2], [0], [1, 3], [0, 7], [9, 11], [13, 15, 17]])==[[0], [2], [0, 7], [1, 3], [9, 11], [13, 15, 17]]" + }, + { + "task_id": 706, + "function_signature": "def is_subset(arr1: list[int], m: int, arr2: list[int], n: int) -> bool:", + "text": "Write a function to find whether an array is subset of another array.", + "test_case": "assert is_subset([11, 1, 13, 21, 3, 7], 6, [11, 3, 7, 1], 4) == True" + }, + { + "task_id": 707, + "function_signature": "def count_Set_Bits(None: int) -> int:", + "text": "Write a python function to count the total set bits from 1 to n.", + "test_case": "assert count_Set_Bits(16) == 33" + }, + { + "task_id": 708, + "function_signature": "def Convert(string: str) -> list[str]:", + "text": "Write a python function to convert a string to a list.", + "test_case": "assert Convert('python program') == ['python','program']" + }, + { + "task_id": 709, + "function_signature": "def get_unique(test_list: list[tuple[int, ...]]) -> str:", + "text": "Write a function to count unique keys for each value present in the tuple.", + "test_case": "assert get_unique([(3, 4), (1, 2), (2, 4), (8, 2), (7, 2), (8, 1), (9, 1), (8, 4), (10, 4)] ) == '{4: 4, 2: 3, 1: 2}'" + }, + { + "task_id": 710, + "function_signature": "def front_and_rear(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to access the initial and last data of the given tuple record.", + "test_case": "assert front_and_rear((10, 4, 5, 6, 7)) == (10, 7)" + }, + { + "task_id": 711, + "function_signature": "def product_Equal(n: int) -> bool:", + "text": "Write a python function to check whether the product of digits of a number at even and odd places is equal or not.", + "test_case": "assert product_Equal(2841) == True" + }, + { + "task_id": 712, + "function_signature": "def remove_duplicate(list1: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to remove duplicates from a list of lists.", + "test_case": "assert remove_duplicate([[10, 20], [40], [30, 56, 25], [10, 20], [33], [40]])==[[10, 20], [30, 56, 25], [33], [40]] " + }, + { + "task_id": 713, + "function_signature": "def check_valid(test_tup: tuple[bool, ...]) -> bool:", + "text": "Write a function to check if the given tuple contains all valid values or not.", + "test_case": "assert check_valid((True, True, True, True) ) == True" + }, + { + "task_id": 714, + "function_signature": "def count_Fac(n: int) -> int:", + "text": "Write a python function to count the number of distinct power of prime factor of given number.", + "test_case": "assert count_Fac(24) == 3" + }, + { + "task_id": 715, + "function_signature": "def str_to_tuple(test_str: str) -> tuple[int, ...]:", + "text": "Write a function to convert the given string of integers into a tuple.", + "test_case": "assert str_to_tuple(\"1, -5, 4, 6, 7\") == (1, -5, 4, 6, 7)" + }, + { + "task_id": 716, + "function_signature": "def rombus_perimeter(a: int) -> int:", + "text": "Write a function to find the perimeter of a rombus.", + "test_case": "assert rombus_perimeter(10)==40" + }, + { + "task_id": 717, + "function_signature": "def sd_calc(data: list[int]) -> float:", + "text": "Write a function to calculate the standard deviation.", + "test_case": "assert sd_calc([4, 2, 5, 8, 6])== 2.23606797749979" + }, + { + "task_id": 718, + "function_signature": "def alternate_elements(list1: list[str]) -> list[str]:", + "text": "Write a function to create a list taking alternate elements from another given list.", + "test_case": "assert alternate_elements([\"red\", \"black\", \"white\", \"green\", \"orange\"])==['red', 'white', 'orange']" + }, + { + "task_id": 719, + "function_signature": "def text_match(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by zero or more b's.", + "test_case": "assert text_match(\"ac\")==('Found a match!')" + }, + { + "task_id": 720, + "function_signature": "def add_dict_to_tuple(test_tup: tuple[int, ...], test_dict: dict) -> tuple[int, ...]:", + "text": "Write a function to add a dictionary to the tuple.", + "test_case": "assert add_dict_to_tuple((4, 5, 6), {\"MSAM\" : 1, \"is\" : 2, \"best\" : 3} ) == (4, 5, 6, {'MSAM': 1, 'is': 2, 'best': 3})" + }, + { + "task_id": 721, + "function_signature": "def maxAverageOfPath(cost: list[list[int]], N: int) -> float:", + "text": "Write a function to find a path with the maximum average over all existing paths for the given square matrix of size n*n.", + "test_case": "assert maxAverageOfPath([[1, 2, 3], [6, 5, 4], [7, 3, 9]], 3) == 5.2" + }, + { + "task_id": 722, + "function_signature": "def filter_data(students: dict, h: float, w: int) -> dict:", + "text": "Write a function to filter the height and width of students which are stored in a dictionary.", + "test_case": "assert filter_data({'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)},6.0,70)=={'Cierra Vega': (6.2, 70)}" + }, + { + "task_id": 723, + "function_signature": "def count_same_pair(nums1: list[int], nums2: list[int]) -> int:", + "text": "Write a function to count the same pair in two given lists using map function.", + "test_case": "assert count_same_pair([1, 2, 3, 4, 5, 6, 7, 8],[2, 2, 3, 1, 2, 6, 7, 9])==4" + }, + { + "task_id": 724, + "function_signature": "def power_base_sum(base: int, power: int) -> int:", + "text": "Write a function to calculate the sum of all digits of the base to the specified power.", + "test_case": "assert power_base_sum(2,100)==115" + }, + { + "task_id": 725, + "function_signature": "def extract_quotation(text1: str) -> list[str]:", + "text": "Write a function to extract values between quotation marks of the given string by using regex.", + "test_case": "assert extract_quotation('Cortex \"A53\" Based \"multi\" tasking \"Processor\"') == ['A53', 'multi', 'Processor']" + }, + { + "task_id": 726, + "function_signature": "def multiply_elements(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to multiply the adjacent elements of the given tuple.", + "test_case": "assert multiply_elements((1, 5, 7, 8, 10)) == (5, 35, 56, 80)" + }, + { + "task_id": 727, + "function_signature": "def remove_char(S: str) -> str:", + "text": "Write a function to remove all characters except letters and numbers using regex", + "test_case": "assert remove_char(\"123abcjw:, .@! eiw\") == '123abcjweiw'" + }, + { + "task_id": 728, + "function_signature": "def sum_list(lst1: list[int], lst2: list[int]) -> list[int]:", + "text": "Write a function to sum elements in two lists.", + "test_case": "assert sum_list([10,20,30],[15,25,35])==[25,45,65]" + }, + { + "task_id": 729, + "function_signature": "def add_list(nums1: list[int], nums2: list[int]) -> list[int]:", + "text": "Write a function to add two lists using map and lambda function.", + "test_case": "assert add_list([1, 2, 3],[4,5,6])==[5, 7, 9]" + }, + { + "task_id": 730, + "function_signature": "def consecutive_duplicates(nums: list[int]) -> list[int]:", + "text": "Write a function to remove consecutive duplicates of a given list.", + "test_case": "assert consecutive_duplicates([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4 ])==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 4]" + }, + { + "task_id": 731, + "function_signature": "def lateralsurface_cone(r: int, h: int) -> float:", + "text": "Write a function to find the lateral surface area of a cone.", + "test_case": "assert lateralsurface_cone(5,12)==204.20352248333654" + }, + { + "task_id": 732, + "function_signature": "def replace_specialchar(text: str) -> str:", + "text": "Write a function to replace all occurrences of spaces, commas, or dots with a colon.", + "test_case": "assert replace_specialchar('Python language, Programming language.')==('Python:language::Programming:language:')" + }, + { + "task_id": 733, + "function_signature": "def find_first_occurrence(A: list[int], x: int) -> int:", + "text": "Write a function to find the index of the first occurrence of a given number in a sorted array.", + "test_case": "assert find_first_occurrence([2, 5, 5, 5, 6, 6, 8, 9, 9, 9], 5) == 1" + }, + { + "task_id": 734, + "function_signature": "def sum_Of_Subarray_Prod(arr: list[int], n: int) -> int:", + "text": "Write a python function to find sum of products of all possible subarrays.", + "test_case": "assert sum_Of_Subarray_Prod([1,2,3],3) == 20" + }, + { + "task_id": 735, + "function_signature": "def toggle_middle_bits(n: int) -> int:", + "text": "Write a python function to toggle bits of the number except the first and the last bit.", + "test_case": "assert toggle_middle_bits(9) == 15" + }, + { + "task_id": 736, + "function_signature": "def left_insertion(a: list[int], x: int) -> int:", + "text": "Write a function to locate the left insertion point for a specified value in sorted order.", + "test_case": "assert left_insertion([1,2,4,5],6)==4" + }, + { + "task_id": 737, + "function_signature": "def check_str(string: str) -> str:", + "text": "Write a function to check whether the given string is starting with a vowel or not using regex.", + "test_case": "assert check_str(\"annie\") == 'Valid'" + }, + { + "task_id": 738, + "function_signature": "def geometric_sum(n: int) -> float:", + "text": "Write a function to calculate the geometric sum of n-1.", + "test_case": "assert geometric_sum(7) == 1.9921875" + }, + { + "task_id": 739, + "function_signature": "def find_Index(n: int) -> int:", + "text": "Write a python function to find the index of smallest triangular number with n digits.", + "test_case": "assert find_Index(2) == 4" + }, + { + "task_id": 740, + "function_signature": "def tuple_to_dict(test_tup: tuple[int, ...]) -> dict:", + "text": "Write a function to convert the given tuple to a key-value dictionary using adjacent elements.", + "test_case": "assert tuple_to_dict((1, 5, 7, 10, 13, 5)) == {1: 5, 7: 10, 13: 5}" + }, + { + "task_id": 741, + "function_signature": "def all_Characters_Same(None: str) -> bool:", + "text": "Write a python function to check whether all the characters are same or not.", + "test_case": "assert all_Characters_Same(\"python\") == False" + }, + { + "task_id": 742, + "function_signature": "def area_tetrahedron(side: int) -> float:", + "text": "Write a function to caluclate the area of a tetrahedron.", + "test_case": "assert area_tetrahedron(3)==15.588457268119894" + }, + { + "task_id": 743, + "function_signature": "def rotate_right(list1: list[int], m: int, n: int) -> list[int]:", + "text": "Write a function to rotate a given list by specified number of items to the right direction.", + "test_case": "assert rotate_right([1, 2, 3, 4, 5, 6, 7, 8, 9, 10],3,4)==[8, 9, 10, 1, 2, 3, 4, 5, 6]" + }, + { + "task_id": 744, + "function_signature": "def check_none(test_tup: tuple[int, ...]) -> bool:", + "text": "Write a function to check if the given tuple has any none value or not.", + "test_case": "assert check_none((10, 4, 5, 6, None)) == True" + }, + { + "task_id": 745, + "function_signature": "def divisible_by_digits(startnum: int, endnum: int) -> list[int]:", + "text": "Write a function to find numbers within a given range where every number is divisible by every digit it contains.", + "test_case": "assert divisible_by_digits(1,22)==[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22]" + }, + { + "task_id": 746, + "function_signature": "def sector_area(r: int, a: int) -> float:", + "text": "Write a function to find area of a sector.", + "test_case": "assert sector_area(4,45)==6.285714285714286" + }, + { + "task_id": 747, + "function_signature": "def lcs_of_three(X: str, Y: str, Z: str, m: int, n: int, o: int) -> int:", + "text": "Write a function to find the longest common subsequence for the given three string sequence.", + "test_case": "assert lcs_of_three('AGGT12', '12TXAYB', '12XBA', 6, 7, 5) == 2" + }, + { + "task_id": 748, + "function_signature": "def capital_words_spaces(str1: str) -> str:", + "text": "Write a function to put spaces between words starting with capital letters in a given string by using regex.", + "test_case": "assert capital_words_spaces(\"Python\") == 'Python'" + }, + { + "task_id": 749, + "function_signature": "def sort_numeric_strings(nums_str: list[str]) -> list[int]:", + "text": "Write a function to sort a given list of strings of numbers numerically.", + "test_case": "assert sort_numeric_strings( ['4','12','45','7','0','100','200','-12','-500'])==[-500, -12, 0, 4, 7, 12, 45, 100, 200]" + }, + { + "task_id": 750, + "function_signature": "def add_tuple(test_list: list[int], test_tup: tuple[int, ...]) -> list[int]:", + "text": "Write a function to add the given tuple to the given list.", + "test_case": "assert add_tuple([5, 6, 7], (9, 10)) == [5, 6, 7, 9, 10]" + }, + { + "task_id": 751, + "function_signature": "def check_min_heap(arr: list[int], i: int) -> bool:", + "text": "Write a function to check if the given array represents min heap or not.", + "test_case": "assert check_min_heap([1, 2, 3, 4, 5, 6], 0) == True" + }, + { + "task_id": 752, + "function_signature": "def jacobsthal_num(n: int) -> int:", + "text": "Write a function to find the nth jacobsthal number.", + "test_case": "assert jacobsthal_num(5) == 11" + }, + { + "task_id": 753, + "function_signature": "def min_k(test_list: list[tuple[str, ...]], K: int) -> list[tuple[str, ...]]:", + "text": "Write a function to find minimum k records from tuple list.", + "test_case": "assert min_k([('Manjeet', 10), ('Akshat', 4), ('Akash', 2), ('Nikhil', 8)], 2) == [('Akash', 2), ('Akshat', 4)]" + }, + { + "task_id": 754, + "function_signature": "def extract_index_list(l1: list[int], l2: list[int], l3: list[int]) -> list[int]:", + "text": "Write a function to find common index elements from three lists.", + "test_case": "assert extract_index_list([1, 1, 3, 4, 5, 6, 7],[0, 1, 2, 3, 4, 5, 7],[0, 1, 2, 3, 4, 5, 7])==[1, 7]" + }, + { + "task_id": 755, + "function_signature": "def second_smallest(numbers: list[int]) -> int:", + "text": "Write a function to find the second smallest number in a list.", + "test_case": "assert second_smallest([1, 2, -8, -2, 0, -2])==-2" + }, + { + "task_id": 756, + "function_signature": "def text_match_zero_one(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by zero or one 'b'.", + "test_case": "assert text_match_zero_one(\"ac\")==('Found a match!')" + }, + { + "task_id": 757, + "function_signature": "def count_reverse_pairs(test_list: list[str]) -> str:", + "text": "Write a function to count the pairs of reverse strings in the given string list.", + "test_case": "assert count_reverse_pairs([\"julia\", \"best\", \"tseb\", \"for\", \"ailuj\"])== '2'" + }, + { + "task_id": 758, + "function_signature": "def unique_sublists(list1: list[list[int]]) -> dict:", + "text": "Write a function to count number of unique lists within a list.", + "test_case": "assert unique_sublists([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]] )=={(1, 3): 2, (5, 7): 2, (13, 15, 17): 1, (9, 11): 1}" + }, + { + "task_id": 759, + "function_signature": "def is_decimal(num: str) -> bool:", + "text": "Write a function to check a decimal with a precision of 2.", + "test_case": "assert is_decimal('123.11')==True" + }, + { + "task_id": 760, + "function_signature": "def unique_Element(arr: list[int], n: int) -> str:", + "text": "Write a python function to check whether an array contains only one distinct element or not.", + "test_case": "assert unique_Element([1,1,1],3) == 'YES'" + }, + { + "task_id": 761, + "function_signature": "def arc_length(d: int, a: int) -> float:", + "text": "Write a function to caluclate arc length of an angle.", + "test_case": "assert arc_length(9,45)==3.5357142857142856" + }, + { + "task_id": 762, + "function_signature": "def check_monthnumber_number(monthnum3: int) -> bool:", + "text": "Write a function to check whether the given month number contains 30 days or not.", + "test_case": "assert check_monthnumber_number(6)==True" + }, + { + "task_id": 763, + "function_signature": "def find_Min_Diff(arr: tuple[int, ...], n: int) -> int:", + "text": "Write a python function to find the minimum difference between any two elements in a given array.", + "test_case": "assert find_Min_Diff((1,5,3,19,18,25),6) == 1" + }, + { + "task_id": 764, + "function_signature": "def number_ctr(str: str) -> int:", + "text": "Write a python function to count numeric values in a given string.", + "test_case": "assert number_ctr('program2bedone') == 1" + }, + { + "task_id": 765, + "function_signature": "def is_polite(n: int) -> int:", + "text": "Write a function to find nth polite number.", + "test_case": "assert is_polite(7) == 11" + }, + { + "task_id": 766, + "function_signature": "def pair_wise(l1: list[int]) -> list[tuple[int, ...]]:", + "text": "Write a function to iterate over all pairs of consecutive items in a given list.", + "test_case": "assert pair_wise([1,1,2,3,3,4,4,5])==[(1, 1), (1, 2), (2, 3), (3, 3), (3, 4), (4, 4), (4, 5)]" + }, + { + "task_id": 767, + "function_signature": "def get_Pairs_Count(arr: list[int], n: int, sum: int) -> int:", + "text": "Write a python function to count the number of pairs whose sum is equal to ‘sum’.", + "test_case": "assert get_Pairs_Count([1,1,1,1],4,2) == 6" + }, + { + "task_id": 768, + "function_signature": "def check_Odd_Parity(x: int) -> bool:", + "text": "Write a python function to check for odd parity of a given number.", + "test_case": "assert check_Odd_Parity(13) == True" + }, + { + "task_id": 769, + "function_signature": "def None(None):", + "text": "Write a python function to get the difference between two lists.", + "test_case": "assert (Diff([10, 15, 20, 25, 30, 35, 40], [25, 40, 35])) == [10, 20, 30, 15]" + }, + { + "task_id": 770, + "function_signature": "def odd_Num_Sum(None: int) -> int:", + "text": "Write a python function to find the sum of fourth power of first n odd natural numbers.", + "test_case": "assert odd_Num_Sum(2) == 82" + }, + { + "task_id": 771, + "function_signature": "def check_expression(exp: str) -> bool:", + "text": "Write a function to check if the given expression is balanced or not.", + "test_case": "assert check_expression(\"{()}[{}]\") == True" + }, + { + "task_id": 772, + "function_signature": "def remove_length(test_str: str, K: int) -> str:", + "text": "Write a function to remove all the words with k length in the given string.", + "test_case": "assert remove_length('The person is most value tet', 3) == 'person is most value'" + }, + { + "task_id": 773, + "function_signature": "def occurance_substring(text: str, pattern: str) -> tuple[str, ...]:", + "text": "Write a function to find the occurrence and position of the substrings within a string.", + "test_case": "assert occurance_substring('python programming, python language','python')==('python', 0, 6)" + }, + { + "task_id": 774, + "function_signature": "def check_email(email: str) -> str:", + "text": "Write a function to check if the string is a valid email address or not using regex.", + "test_case": "assert check_email(\"ankitrai326@gmail.com\") == 'Valid Email'" + }, + { + "task_id": 775, + "function_signature": "def odd_position(nums: list[int]) -> bool:", + "text": "Write a python function to check whether every odd index contains odd numbers of a given list.", + "test_case": "assert odd_position([2,1,4,3,6,7,6,3]) == True" + }, + { + "task_id": 776, + "function_signature": "def count_vowels(test_str: str) -> int:", + "text": "Write a function to count those characters which have vowels as their neighbors in the given string.", + "test_case": "assert count_vowels('bestinstareels') == 7" + }, + { + "task_id": 777, + "function_signature": "def find_Sum(arr: list[int], n: int) -> int:", + "text": "Write a python function to find the sum of non-repeated elements in a given array.", + "test_case": "assert find_Sum([1,2,3,1,1,4,5,6],8) == 21" + }, + { + "task_id": 778, + "function_signature": "def pack_consecutive_duplicates(list1: list[int]) -> list[list[int]]:", + "text": "Write a function to pack consecutive duplicates of a given list elements into sublists.", + "test_case": "assert pack_consecutive_duplicates([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4])==[[0, 0], [1], [2], [3], [4, 4], [5], [6, 6, 6], [7], [8], [9], [4, 4]]" + }, + { + "task_id": 779, + "function_signature": "def unique_sublists(list1: list[list[int]]) -> dict:", + "text": "Write a function to count the number of unique lists within a list.", + "test_case": "assert unique_sublists([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]])=={(1, 3): 2, (5, 7): 2, (13, 15, 17): 1, (9, 11): 1}" + }, + { + "task_id": 780, + "function_signature": "def find_combinations(test_list: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to find the combinations of sums with tuples in the given tuple list.", + "test_case": "assert find_combinations([(2, 4), (6, 7), (5, 1), (6, 10)]) == [(8, 11), (7, 5), (8, 14), (11, 8), (12, 17), (11, 11)]" + }, + { + "task_id": 781, + "function_signature": "def count_Divisors(None: int) -> str:", + "text": "Write a python function to check whether the count of divisors is even or odd.", + "test_case": "assert count_Divisors(10) == \"Even\"" + }, + { + "task_id": 782, + "function_signature": "def Odd_Length_Sum(arr: list[int]) -> int:", + "text": "Write a python function to find the sum of all odd length subarrays.", + "test_case": "assert Odd_Length_Sum([1,2,4]) == 14" + }, + { + "task_id": 783, + "function_signature": "def rgb_to_hsv(r: int, g: int, b: int) -> tuple[int, ...]:", + "text": "Write a function to convert rgb color to hsv color.", + "test_case": "assert rgb_to_hsv(255, 255, 255)==(0, 0.0, 100.0)" + }, + { + "task_id": 784, + "function_signature": "def mul_even_odd(list1: list[int]) -> int:", + "text": "Write a function to find the product of first even and odd number of a given list.", + "test_case": "assert mul_even_odd([1,3,5,7,4,1,6,8])==4" + }, + { + "task_id": 785, + "function_signature": "def tuple_str_int(test_str: str) -> tuple[int, ...]:", + "text": "Write a function to convert tuple string to integer tuple.", + "test_case": "assert tuple_str_int(\"(7, 8, 9)\") == (7, 8, 9)" + }, + { + "task_id": 786, + "function_signature": "def right_insertion(a: list[int], x: int) -> int:", + "text": "Write a function to locate the right insertion point for a specified value in sorted order.", + "test_case": "assert right_insertion([1,2,4,5],6)==4" + }, + { + "task_id": 787, + "function_signature": "def text_match_three(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by three 'b'.", + "test_case": "assert text_match_three(\"ac\")==('Not matched!')" + }, + { + "task_id": 788, + "function_signature": "def new_tuple(test_list: list[str], test_str: str) -> tuple[str, ...]:", + "text": "Write a function to create a new tuple from the given string and list.", + "test_case": "assert new_tuple([\"WEB\", \"is\"], \"best\") == ('WEB', 'is', 'best')" + }, + { + "task_id": 789, + "function_signature": "def perimeter_polygon(s: int, l: int) -> int:", + "text": "Write a function to calculate the perimeter of a regular polygon.", + "test_case": "assert perimeter_polygon(4,20)==80" + }, + { + "task_id": 790, + "function_signature": "def even_position(nums: list[int]) -> bool:", + "text": "Write a python function to check whether every even index contains even numbers of a given list.", + "test_case": "assert even_position([3,2,1]) == False" + }, + { + "task_id": 791, + "function_signature": "def remove_nested(test_tup: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to remove the nested record from the given tuple.", + "test_case": "assert remove_nested((1, 5, 7, (4, 6), 10)) == (1, 5, 7, 10)" + }, + { + "task_id": 792, + "function_signature": "def count_list(input_list: list[list[int]]) -> int:", + "text": "Write a python function to count the number of lists in a given number of lists.", + "test_case": "assert count_list([[1, 3], [5, 7], [9, 11], [13, 15, 17]]) == 4" + }, + { + "task_id": 793, + "function_signature": "def last(arr: list[int], x: int, n: int) -> int:", + "text": "Write a python function to find the last position of an element in a sorted array.", + "test_case": "assert last([1,2,3],1,3) == 0" + }, + { + "task_id": 794, + "function_signature": "def text_starta_endb(text: str) -> str:", + "text": "Write a function that matches a string that has an 'a' followed by anything, ending in 'b'.", + "test_case": "assert text_starta_endb(\"aabbbb\")==('Found a match!')" + }, + { + "task_id": 795, + "function_signature": "def cheap_items(items: list[dict], n: int) -> list[dict]:", + "text": "Write a function to find the n - cheap price items from a given dataset using heap queue algorithm.", + "test_case": "assert cheap_items([{'name': 'Item-1', 'price': 101.1},{'name': 'Item-2', 'price': 555.22}],1)==[{'name': 'Item-1', 'price': 101.1}]" + }, + { + "task_id": 796, + "function_signature": "def return_sum(dict: dict) -> int:", + "text": "Write function to find the sum of all items in the given dictionary.", + "test_case": "assert return_sum({'a': 100, 'b':200, 'c':300}) == 600" + }, + { + "task_id": 797, + "function_signature": "def sum_in_Range(l: int, r: int) -> int:", + "text": "Write a python function to find the sum of all odd natural numbers within the range l and r.", + "test_case": "assert sum_in_Range(2,5) == 8" + }, + { + "task_id": 798, + "function_signature": "def _sum(arr: list[int]) -> int:", + "text": "Write a python function to find the sum of an array.", + "test_case": "assert _sum([1, 2, 3]) == 6" + }, + { + "task_id": 799, + "function_signature": "def left_Rotate(n: int, d: int) -> int:", + "text": "Write a python function to left rotate the bits of a given number.", + "test_case": "assert left_Rotate(16,2) == 64" + }, + { + "task_id": 800, + "function_signature": "def remove_all_spaces(text: str) -> str:", + "text": "Write a function to remove all whitespaces from a string.", + "test_case": "assert remove_all_spaces('python program')==('pythonprogram')" + }, + { + "task_id": 801, + "function_signature": "def test_three_equal(x: int, y: int, z: int) -> int:", + "text": "Write a python function to count the number of equal numbers from three given integers.", + "test_case": "assert test_three_equal(1,1,1) == 3" + }, + { + "task_id": 802, + "function_signature": "def count_Rotation(arr: list[int], n: int) -> int:", + "text": "Write a python function to count the number of rotations required to generate a sorted array.", + "test_case": "assert count_Rotation([3,2,1],3) == 1" + }, + { + "task_id": 803, + "function_signature": "def is_Perfect_Square(n) :\r\n i = 1\r\n while (i * i<= n):", + "text": "Write a python function to check whether the given number is a perfect square or not.", + "test_case": "assert is_Perfect_Square(10) == False" + }, + { + "task_id": 804, + "function_signature": "def is_Product_Even(arr: list[int], n: int) -> bool:", + "text": "Write a python function to check whether the product of numbers is even or not.", + "test_case": "assert is_Product_Even([1,2,3],3) == True" + }, + { + "task_id": 805, + "function_signature": "def max_sum_list(lists: list[list[int]]) -> list[int]:", + "text": "Write a function to find the list in a list of lists whose sum of elements is the highest.", + "test_case": "assert max_sum_list([[1,2,3], [4,5,6], [10,11,12], [7,8,9]])==[10, 11, 12] " + }, + { + "task_id": 806, + "function_signature": "def max_run_uppercase(test_str: str) -> int:", + "text": "Write a function to find maximum run of uppercase characters in the given string.", + "test_case": "assert max_run_uppercase('GeMKSForGERksISBESt') == 5" + }, + { + "task_id": 807, + "function_signature": "def first_odd(nums: list[int]) -> int:", + "text": "Write a python function to find the first odd number in a given list of numbers.", + "test_case": "assert first_odd([1,3,5]) == 1" + }, + { + "task_id": 808, + "function_signature": "def check_K(test_tup: tuple[int, ...], K: int) -> bool:", + "text": "Write a function to check if the given tuples contain the k or not.", + "test_case": "assert check_K((10, 4, 5, 6, 8), 6) == True" + }, + { + "task_id": 809, + "function_signature": "def check_smaller(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> bool:", + "text": "Write a function to check if each element of second tuple is smaller than its corresponding index in first tuple.", + "test_case": "assert check_smaller((1, 2, 3), (2, 3, 4)) == False" + }, + { + "task_id": 810, + "function_signature": "def count_variable(a: int, b: int, c: int, d: int) -> list[str]:", + "text": "Write a function to iterate over elements repeating each as many times as its count.", + "test_case": "assert count_variable(4,2,0,-2)==['p', 'p', 'p', 'p', 'q', 'q'] " + }, + { + "task_id": 811, + "function_signature": "def check_identical(test_list1: list[tuple[int, ...]], test_list2: list[tuple[int, ...]]) -> bool:", + "text": "Write a function to check if two lists of tuples are identical or not.", + "test_case": "assert check_identical([(10, 4), (2, 5)], [(10, 4), (2, 5)]) == True" + }, + { + "task_id": 812, + "function_signature": "def road_rd(street: str) -> str:", + "text": "Write a function to abbreviate 'road' as 'rd.' in a given string.", + "test_case": "assert road_rd(\"ravipadu Road\")==('ravipadu Rd.')" + }, + { + "task_id": 813, + "function_signature": "def string_length(str1: str) -> int:", + "text": "Write a function to find length of the string.", + "test_case": "assert string_length('python')==6" + }, + { + "task_id": 814, + "function_signature": "def rombus_area(p: int, q: int) -> int:", + "text": "Write a function to find the area of a rombus.", + "test_case": "assert rombus_area(10,20)==100" + }, + { + "task_id": 815, + "function_signature": "def sort_by_dnf(arr: list[int], n: int) -> list[int]:", + "text": "Write a function to sort the given array without using any sorting algorithm. the given array consists of only 0, 1, and 2.", + "test_case": "assert sort_by_dnf([1,2,0,1,0,1,2,1,1], 9) == [0, 0, 1, 1, 1, 1, 1, 2, 2]" + }, + { + "task_id": 816, + "function_signature": "def clear_tuple(test_tup: tuple[int, ...]) -> tuple:", + "text": "Write a function to clear the values of the given tuples.", + "test_case": "assert clear_tuple((1, 5, 3, 6, 8)) == ()" + }, + { + "task_id": 817, + "function_signature": "def div_of_nums(nums: list[int], m: int, n: int) -> list[int]:", + "text": "Write a function to find numbers divisible by m or n from a list of numbers using lambda function.", + "test_case": "assert div_of_nums([19, 65, 57, 39, 152, 639, 121, 44, 90, 190],19,13)==[19, 65, 57, 39, 152, 190]" + }, + { + "task_id": 818, + "function_signature": "def lower_ctr(str: str) -> int:", + "text": "Write a python function to count lower case letters in a given string.", + "test_case": "assert lower_ctr('abc') == 3" + }, + { + "task_id": 819, + "function_signature": "def count_duplic(lists: list[int]) -> tuple[list[int], ...]:", + "text": "Write a function to count the frequency of consecutive duplicate elements in a given list of numbers.", + "test_case": "assert count_duplic([1,2,2,2,4,4,4,5,5,5,5])==([1, 2, 4, 5], [1, 3, 3, 4])" + }, + { + "task_id": 820, + "function_signature": "def check_monthnum_number(monthnum1: int) -> bool:", + "text": "Write a function to check whether the given month number contains 28 days or not.", + "test_case": "assert check_monthnum_number(2)==True" + }, + { + "task_id": 821, + "function_signature": "def merge_dictionaries(dict1: dict, dict2: dict) -> dict:", + "text": "Write a function to merge two dictionaries into a single expression.", + "test_case": "assert merge_dictionaries({ \"R\": \"Red\", \"B\": \"Black\", \"P\": \"Pink\" }, { \"G\": \"Green\", \"W\": \"White\" })=={'B': 'Black', 'R': 'Red', 'P': 'Pink', 'G': 'Green', 'W': 'White'}" + }, + { + "task_id": 822, + "function_signature": "def pass_validity(p: str) -> bool:", + "text": "Write a function to return true if the password is valid.", + "test_case": "assert pass_validity(\"password\")==False" + }, + { + "task_id": 823, + "function_signature": "def check_substring(string, sample) : \r\n if (sample in string):", + "text": "Write a function to check if the given string starts with a substring using regex.", + "test_case": "assert check_substring(\"dreams for dreams makes life fun\", \"makes\") == 'string doesnt start with the given substring'" + }, + { + "task_id": 824, + "function_signature": "def remove_even(l: list[int]) -> list[int]:", + "text": "Write a python function to remove even numbers from a given list.", + "test_case": "assert remove_even([1,3,5,2]) == [1,3,5]" + }, + { + "task_id": 825, + "function_signature": "def access_elements(nums: list[int], list_index: list[int]) -> list[int]:", + "text": "Write a python function to access multiple elements of specified index from a given list.", + "test_case": "assert access_elements([2,3,8,4,7,9],[0,3,5]) == [2, 4, 9]" + }, + { + "task_id": 826, + "function_signature": "def check_Type_Of_Triangle(a: int, b: int, c: int) -> str:", + "text": "Write a python function to find the type of triangle from the given sides.", + "test_case": "assert check_Type_Of_Triangle(1,2,3) == \"Obtuse-angled Triangle\"" + }, + { + "task_id": 827, + "function_signature": "def sum_column(list1: list[list[int]], C: int) -> int:", + "text": "Write a function to sum a specific column of a list in a given list of lists.", + "test_case": "assert sum_column( [[1,2,3,2],[4,5,6,2],[7,8,9,5],],0)==12" + }, + { + "task_id": 828, + "function_signature": "def count_alpha_dig_spl(string: str) -> tuple[int, ...]:", + "text": "Write a function to count alphabets,digits and special charactes in a given string.", + "test_case": "assert count_alpha_dig_spl(\"abc!@#123\")==(3,3,3)" + }, + { + "task_id": 829, + "function_signature": "def second_frequent(input: list[str]) -> str:", + "text": "Write a function to find out the second most repeated (or frequent) string in the given sequence.", + "test_case": "assert second_frequent(['aaa','bbb','ccc','bbb','aaa','aaa']) == 'bbb'" + }, + { + "task_id": 830, + "function_signature": "def round_up(a: float, digits: int) -> int:", + "text": "Write a function to round up a number to specific digits.", + "test_case": "assert round_up(123.01247,0)==124" + }, + { + "task_id": 831, + "function_signature": "def count_Pairs(arr: list[int], n: int) -> int:", + "text": "Write a python function to count equal element pairs from the given array.", + "test_case": "assert count_Pairs([1,1,1,1],4) == 6" + }, + { + "task_id": 832, + "function_signature": "def extract_max(input: str) -> int:", + "text": "Write a function to extract the maximum numeric value from a string by using regex.", + "test_case": "assert extract_max('100klh564abc365bg') == 564" + }, + { + "task_id": 833, + "function_signature": "def get_key(dict: dict) -> list[int]:", + "text": "Write a function to get dictionary keys as a list.", + "test_case": "assert get_key({1:'python',2:'java'})==[1,2]" + }, + { + "task_id": 834, + "function_signature": "def generate_matrix(n: int) -> list[list[int]]:", + "text": "Write a function to generate a square matrix filled with elements from 1 to n raised to the power of 2 in spiral order.", + "test_case": "assert generate_matrix(3)==[[1, 2, 3], [8, 9, 4], [7, 6, 5]] " + }, + { + "task_id": 835, + "function_signature": "def slope(x1: int, y1: int, x2: int, y2: int) -> float:", + "text": "Write a python function to find the slope of a line.", + "test_case": "assert slope(4,2,2,5) == -1.5" + }, + { + "task_id": 836, + "function_signature": "def max_sub_array_sum(a: list[int], size: int) -> int:", + "text": "Write a function to find length of the subarray having maximum sum.", + "test_case": "assert max_sub_array_sum([-2, -3, 4, -1, -2, 1, 5, -3],8) == 5" + }, + { + "task_id": 837, + "function_signature": "def cube_Sum(n: int) -> int:", + "text": "Write a python function to find the cube sum of first n odd natural numbers.", + "test_case": "assert cube_Sum(2) == 28" + }, + { + "task_id": 838, + "function_signature": "def min_Swaps(None: str) -> int:", + "text": "Write a python function to find minimum number swaps required to make two binary strings equal.", + "test_case": "assert min_Swaps(\"0011\",\"1111\") == 1" + }, + { + "task_id": 839, + "function_signature": "def sort_tuple(tup: list[tuple[str, ...]]) -> list[tuple[str, ...]]:", + "text": "Write a function to sort the tuples alphabetically by the first item of each tuple.", + "test_case": "assert sort_tuple([(\"Amana\", 28), (\"Zenat\", 30), (\"Abhishek\", 29),(\"Nikhil\", 21), (\"B\", \"C\")]) == [('Abhishek', 29), ('Amana', 28), ('B', 'C'), ('Nikhil', 21), ('Zenat', 30)]" + }, + { + "task_id": 840, + "function_signature": "def Check_Solution(a: int, b: int, c: int) -> str:", + "text": "Write a python function to check whether the roots of a quadratic equation are numerically equal but opposite in sign or not.", + "test_case": "assert Check_Solution(2,0,-1) == \"Yes\"" + }, + { + "task_id": 841, + "function_signature": "def get_inv_count(arr: list[int], n: int) -> int:", + "text": "Write a function to count the number of inversions in the given array.", + "test_case": "assert get_inv_count([1, 20, 6, 4, 5], 5) == 5" + }, + { + "task_id": 842, + "function_signature": "def get_odd_occurence(arr: list[int], arr_size: int) -> int:", + "text": "Write a function to find the number which occurs for odd number of times in the given array.", + "test_case": "assert get_odd_occurence([2, 3, 5, 4, 5, 2, 4, 3, 5, 2, 4, 4, 2], 13) == 5" + }, + { + "task_id": 843, + "function_signature": "def nth_super_ugly_number(n: int, primes: list[int]) -> int:", + "text": "Write a function to find the nth super ugly number from a given prime list of size k using heap queue algorithm.", + "test_case": "assert nth_super_ugly_number(12,[2,7,13,19])==32" + }, + { + "task_id": 844, + "function_signature": "def get_Number(n: int, k: int) -> int:", + "text": "Write a python function to find the kth element in an array containing odd elements first and then even elements.", + "test_case": "assert get_Number(8,5) == 2" + }, + { + "task_id": 845, + "function_signature": "def find_Digits(n: int) -> int:", + "text": "Write a python function to count the number of digits in factorial of a given number.", + "test_case": "assert find_Digits(7) == 4" + }, + { + "task_id": 846, + "function_signature": "def find_platform(arr: list[int], dep: list[int], n: int) -> int:", + "text": "Write a function to find the minimum number of platforms required for a railway/bus station.", + "test_case": "assert find_platform([900, 940, 950, 1100, 1500, 1800],[910, 1200, 1120, 1130, 1900, 2000],6)==3" + }, + { + "task_id": 847, + "function_signature": "def lcopy(xs: list[int]) -> list[int]:", + "text": "Write a python function to copy a list from a singleton tuple.", + "test_case": "assert lcopy([1, 2, 3]) == [1, 2, 3]" + }, + { + "task_id": 848, + "function_signature": "def area_trapezium(base1: int, base2: int, height: int) -> int:", + "text": "Write a function to find the area of a trapezium.", + "test_case": "assert area_trapezium(6,9,4)==30" + }, + { + "task_id": 849, + "function_signature": "def Sum(N: int) -> int:", + "text": "Write a python function to find sum of all prime divisors of a given number.", + "test_case": "assert Sum(60) == 10" + }, + { + "task_id": 850, + "function_signature": "def is_triangleexists(a: int, b: int, c: int) -> bool:", + "text": "Write a function to check if a triangle of positive area is possible with the given angles.", + "test_case": "assert is_triangleexists(50,60,70)==True" + }, + { + "task_id": 851, + "function_signature": "def Sum_of_Inverse_Divisors(N: int, Sum: int) -> int:", + "text": "Write a python function to find sum of inverse of divisors.", + "test_case": "assert Sum_of_Inverse_Divisors(6,12) == 2" + }, + { + "task_id": 852, + "function_signature": "def remove_negs(num_list: list[int]) -> list[int]:", + "text": "Write a python function to remove negative numbers from a list.", + "test_case": "assert remove_negs([1,-2,3,-4]) == [1,3]" + }, + { + "task_id": 853, + "function_signature": "def sum_of_odd_Factors(n: int) -> int:", + "text": "Write a python function to find sum of odd factors of a number.", + "test_case": "assert sum_of_odd_Factors(30) == 24" + }, + { + "task_id": 854, + "function_signature": "def raw_heap(rawheap: list[int]) -> list[int]:", + "text": "Write a function which accepts an arbitrary list and converts it to a heap using heap queue algorithm.", + "test_case": "assert raw_heap([25, 44, 68, 21, 39, 23, 89])==[21, 25, 23, 44, 39, 68, 89]" + }, + { + "task_id": 855, + "function_signature": "def check_Even_Parity(x: int) -> bool:", + "text": "Write a python function to check for even parity of a given number.", + "test_case": "assert check_Even_Parity(10) == True" + }, + { + "task_id": 856, + "function_signature": "def find_Min_Swaps(None: list[int]) -> int:", + "text": "Write a python function to find minimum adjacent swaps required to sort binary array.", + "test_case": "assert find_Min_Swaps([1,0,1,0],4) == 3" + }, + { + "task_id": 857, + "function_signature": "def listify_list(list1: list[str]) -> list[list[str]]:", + "text": "Write a function to list out the list of given strings individually using map function.", + "test_case": "assert listify_list(['Red', 'Blue', 'Black', 'White', 'Pink'])==[['R', 'e', 'd'], ['B', 'l', 'u', 'e'], ['B', 'l', 'a', 'c', 'k'], ['W', 'h', 'i', 't', 'e'], ['P', 'i', 'n', 'k']]" + }, + { + "task_id": 858, + "function_signature": "def count_list(input_list: list[list[int]]) -> int:", + "text": "Write a function to count number of lists in a given list of lists and square the count.", + "test_case": "assert count_list([[0], [1, 3], [5, 7], [9, 11], [13, 15, 17]])==25" + }, + { + "task_id": 859, + "function_signature": "def sub_lists(my_list: list[int]) -> list[list]:", + "text": "Write a function to generate all sublists of a given list.", + "test_case": "assert sub_lists([10, 20, 30, 40])==[[], [10], [20], [30], [40], [10, 20], [10, 30], [10, 40], [20, 30], [20, 40], [30, 40], [10, 20, 30], [10, 20, 40], [10, 30, 40], [20, 30, 40], [10, 20, 30, 40]]" + }, + { + "task_id": 860, + "function_signature": "def check_alphanumeric(string: str) -> str:", + "text": "Write a function to check whether the given string is ending with only alphanumeric characters or not using regex.", + "test_case": "assert check_alphanumeric(\"dawood@\") == 'Discard'" + }, + { + "task_id": 861, + "function_signature": "def anagram_lambda(texts: list[str], str: str) -> list[str]:", + "text": "Write a function to find all anagrams of a string in a given list of strings using lambda function.", + "test_case": "assert anagram_lambda([\"bcda\", \"abce\", \"cbda\", \"cbea\", \"adcb\"],\"abcd\")==['bcda', 'cbda', 'adcb']" + }, + { + "task_id": 862, + "function_signature": "def n_common_words(text: str, n: int) -> list[tuple[str, ...]]:", + "text": "Write a function to find the occurrences of n most common words in a given text.", + "test_case": "assert n_common_words(\"python is a programming language\",1)==[('python', 1)]" + }, + { + "task_id": 863, + "function_signature": "def find_longest_conseq_subseq(arr: list[int], n: int) -> int:", + "text": "Write a function to find the length of the longest sub-sequence such that elements in the subsequences are consecutive integers.", + "test_case": "assert find_longest_conseq_subseq([1, 2, 2, 3], 4) == 3" + }, + { + "task_id": 864, + "function_signature": "def palindrome_lambda(texts: list[str]) -> list[str]:", + "text": "Write a function to find palindromes in a given list of strings using lambda function.", + "test_case": "assert palindrome_lambda([\"php\", \"res\", \"Python\", \"abcd\", \"Java\", \"aaa\"])==['php', 'aaa']" + }, + { + "task_id": 865, + "function_signature": "def ntimes_list(nums: list[int], n: int) -> list[int]:", + "text": "Write a function to print n-times a list using map function.", + "test_case": "assert ntimes_list([1, 2, 3, 4, 5, 6, 7],3)==[3, 6, 9, 12, 15, 18, 21]" + }, + { + "task_id": 866, + "function_signature": "def check_monthnumb(monthname2: str) -> bool:", + "text": "Write a function to check whether the given month name contains 31 days or not.", + "test_case": "assert check_monthnumb(\"February\")==False" + }, + { + "task_id": 867, + "function_signature": "def min_Num(arr: list[int], n: int) -> int:", + "text": "Write a python function to add a minimum number such that the sum of array becomes even.", + "test_case": "assert min_Num([1,2,3,4,5,6,7,8,9],9) == 1" + }, + { + "task_id": 868, + "function_signature": "def length_Of_Last_Word(a: str) -> int:", + "text": "Write a python function to find the length of the last word in a given string.", + "test_case": "assert length_Of_Last_Word(\"python language\") == 8" + }, + { + "task_id": 869, + "function_signature": "def remove_list_range(list1: list[list[int]], leftrange: int, rigthrange: int) -> list[list[int]]:", + "text": "Write a function to remove sublists from a given list of lists, which are outside a given range.", + "test_case": "assert remove_list_range([[2], [0], [1, 2, 3], [0, 1, 2, 3, 6, 7], [9, 11], [13, 14, 15, 17]],13,17)==[[13, 14, 15, 17]]" + }, + { + "task_id": 870, + "function_signature": "def sum_positivenum(nums: list[int]) -> int:", + "text": "Write a function to calculate the sum of the positive numbers of a given list of numbers using lambda function.", + "test_case": "assert sum_positivenum([2, 4, -6, -9, 11, -12, 14, -5, 17])==48" + }, + { + "task_id": 871, + "function_signature": "def are_Rotations(string1: str, string2: str) -> bool:", + "text": "Write a python function to check whether the given strings are rotations of each other or not.", + "test_case": "assert are_Rotations(\"abc\",\"cba\") == False" + }, + { + "task_id": 872, + "function_signature": "def check_subset(list1: list[list[int]], list2: list[list[int]]) -> bool:", + "text": "Write a function to check if a nested list is a subset of another nested list.", + "test_case": "assert check_subset([[1, 3], [5, 7], [9, 11], [13, 15, 17]] ,[[1, 3],[13,15,17]])==True" + }, + { + "task_id": 873, + "function_signature": "def fibonacci(n: int) -> int:", + "text": "Write a function to solve the fibonacci sequence using recursion.", + "test_case": "assert fibonacci(7) == 13" + }, + { + "task_id": 874, + "function_signature": "def check_Concat(str1: str, str2: str) -> bool:", + "text": "Write a python function to check if the string is a concatenation of another string.", + "test_case": "assert check_Concat(\"abcabcabc\",\"abc\") == True" + }, + { + "task_id": 875, + "function_signature": "def min_difference(test_list: list[tuple[int, ...]]) -> int:", + "text": "Write a function to find the minimum difference in the tuple pairs of given tuples.", + "test_case": "assert min_difference([(3, 5), (1, 7), (10, 3), (1, 2)]) == 1" + }, + { + "task_id": 876, + "function_signature": "def lcm(x: int, y: int) -> int:", + "text": "Write a python function to find lcm of two positive integers.", + "test_case": "assert lcm(4,6) == 12" + }, + { + "task_id": 877, + "function_signature": "def sort_String(None: str) -> str:", + "text": "Write a python function to sort the given string.", + "test_case": "assert sort_String(\"cba\") == \"abc\"" + }, + { + "task_id": 878, + "function_signature": "def check_tuples(test_tuple: tuple[int, ...], K: list[int]) -> bool:", + "text": "Write a function to check if the given tuple contains only k elements.", + "test_case": "assert check_tuples((3, 5, 6, 5, 3, 6),[3, 6, 5]) == True" + }, + { + "task_id": 879, + "function_signature": "def text_match(text: str) -> str:", + "text": "Write a function that matches a string that has an 'a' followed by anything, ending in 'b' by using regex.", + "test_case": "assert text_match(\"aabbbbd\") == 'Not matched!'" + }, + { + "task_id": 880, + "function_signature": "def Check_Solution(None: int) -> str:", + "text": "Write a python function to find number of solutions in quadratic equation.", + "test_case": "assert Check_Solution(2,5,2) == \"2 solutions\"" + }, + { + "task_id": 881, + "function_signature": "def sum_even_odd(list1: list[int]) -> int:", + "text": "Write a function to find the sum of first even and odd number of a given list.", + "test_case": "assert sum_even_odd([1,3,5,7,4,1,6,8])==5" + }, + { + "task_id": 882, + "function_signature": "def parallelogram_perimeter(b: int, h: int) -> int:", + "text": "Write a function to caluclate perimeter of a parallelogram.", + "test_case": "assert parallelogram_perimeter(10,20)==400" + }, + { + "task_id": 883, + "function_signature": "def div_of_nums(nums: list[int], m: int, n: int) -> list[int]:", + "text": "Write a function to find numbers divisible by m and n from a list of numbers using lambda function.", + "test_case": "assert div_of_nums([19, 65, 57, 39, 152, 639, 121, 44, 90, 190],2,4)==[ 152,44]" + }, + { + "task_id": 884, + "function_signature": "def all_Bits_Set_In_The_Given_Range(n: int, l: int, r: int) -> bool:", + "text": "Write a python function to check whether all the bits are within a given range or not.", + "test_case": "assert all_Bits_Set_In_The_Given_Range(10,2,1) == True " + }, + { + "task_id": 885, + "function_signature": "def is_Isomorphic(str1: str, str2: str) -> bool:", + "text": "Write a python function to check whether the two given strings are isomorphic to each other or not.", + "test_case": "assert is_Isomorphic(\"paper\",\"title\") == True" + }, + { + "task_id": 886, + "function_signature": "def sum_num(numbers: tuple[int, ...]) -> float:", + "text": "Write a function to add all the numbers in a list and divide it with the length of the list.", + "test_case": "assert sum_num((8, 2, 3, 0, 7))==4.0" + }, + { + "task_id": 887, + "function_signature": "def is_odd(None: int) -> bool:", + "text": "Write a python function to check whether the given number is odd or not using bitwise operator.", + "test_case": "assert is_odd(5) == True" + }, + { + "task_id": 888, + "function_signature": "def substract_elements(test_tup1: tuple[tuple[int, ...], ...], test_tup2: tuple[tuple[int, ...], ...]) -> tuple[tuple[int, ...], ...]:", + "text": "Write a function to substract the elements of the given nested tuples.", + "test_case": "assert substract_elements(((1, 3), (4, 5), (2, 9), (1, 10)), ((6, 7), (3, 9), (1, 1), (7, 3))) == ((-5, -4), (1, -4), (1, 8), (-6, 7))" + }, + { + "task_id": 889, + "function_signature": "def reverse_list_lists(lists: list[list[int]]) -> list[list[int]]:", + "text": "Write a function to reverse each list in a given list of lists.", + "test_case": "assert reverse_list_lists([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]])==[[4, 3, 2, 1], [8, 7, 6, 5], [12, 11, 10, 9], [16, 15, 14, 13]]" + }, + { + "task_id": 890, + "function_signature": "def find_Extra(None: list[int]) -> int:", + "text": "Write a python function to find the index of an extra element present in one sorted array.", + "test_case": "assert find_Extra([1,2,3,4],[1,2,3],3) == 3" + }, + { + "task_id": 891, + "function_signature": "def same_Length(A: int, B: int) -> bool:", + "text": "Write a python function to check whether the given two numbers have same number of digits or not.", + "test_case": "assert same_Length(12,1) == False" + }, + { + "task_id": 892, + "function_signature": "def remove_spaces(text: str) -> str:", + "text": "Write a function to remove multiple spaces in a string.", + "test_case": "assert remove_spaces('python program')==('python program')" + }, + { + "task_id": 893, + "function_signature": "def Extract(lst: list[list[int]]) -> list[int]:", + "text": "Write a python function to get the last element of each sublist.", + "test_case": "assert Extract([[1, 2, 3], [4, 5], [6, 7, 8, 9]]) == [3, 5, 9]" + }, + { + "task_id": 894, + "function_signature": "def float_to_tuple(test_str: str) -> tuple[float, ...]:", + "text": "Write a function to convert the given string of float type into tuple.", + "test_case": "assert float_to_tuple(\"1.2, 1.3, 2.3, 2.4, 6.5\") == (1.2, 1.3, 2.3, 2.4, 6.5)" + }, + { + "task_id": 895, + "function_signature": "def max_sum_subseq(A: list[int]) -> int:", + "text": "Write a function to find the maximum sum of subsequences of given array with no adjacent elements.", + "test_case": "assert max_sum_subseq([1, 2, 9, 4, 5, 0, 4, 11, 6]) == 26" + }, + { + "task_id": 896, + "function_signature": "def sort_list_last(tuples: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to sort a list in increasing order by the last element in each tuple from a given list of non-empty tuples.", + "test_case": "assert sort_list_last([(2, 5), (1, 2), (4, 4), (2, 3), (2, 1)])==[(2, 1), (1, 2), (2, 3), (4, 4), (2, 5)] " + }, + { + "task_id": 897, + "function_signature": "def is_Word_Present(sentence: str, word: str) -> bool:", + "text": "Write a python function to check whether the word is present in a given sentence or not.", + "test_case": "assert is_Word_Present(\"machine learning\",\"machine\") == True" + }, + { + "task_id": 898, + "function_signature": "def extract_elements(numbers: list[int], n: int) -> list[int]:", + "text": "Write a function to extract specified number of elements from a given list, which follow each other continuously.", + "test_case": "assert extract_elements([1, 1, 3, 4, 4, 5, 6, 7],2)==[1, 4]" + }, + { + "task_id": 899, + "function_signature": "def check(arr: list[int], n: int) -> bool:", + "text": "Write a python function to check whether an array can be sorted or not by picking only the corner elements.", + "test_case": "assert check([3,2,1,2,3,4],6) == True" + }, + { + "task_id": 900, + "function_signature": "def match_num(string: str) -> bool:", + "text": "Write a function where a string will start with a specific number.", + "test_case": "assert match_num('5-2345861')==True" + }, + { + "task_id": 901, + "function_signature": "def smallest_multiple(n: int) -> int:", + "text": "Write a function to find the smallest multiple of the first n numbers.", + "test_case": "assert smallest_multiple(13)==360360" + }, + { + "task_id": 902, + "function_signature": "def add_dict(d1: dict, d2: dict) -> dict:", + "text": "Write a function to combine two dictionaries by adding values for common keys.", + "test_case": "assert add_dict({'a': 100, 'b': 200, 'c':300},{'a': 300, 'b': 200, 'd':400})==({'b': 400, 'd': 400, 'a': 400, 'c': 300}) " + }, + { + "task_id": 903, + "function_signature": "def count_Unset_Bits(None: int) -> int:", + "text": "Write a python function to count the total unset bits from 1 to n.", + "test_case": "assert count_Unset_Bits(2) == 1" + }, + { + "task_id": 904, + "function_signature": "def even_num(x: float) -> bool:", + "text": "Write a function to return true if the given number is even else return false.", + "test_case": "assert even_num(13.5)==False" + }, + { + "task_id": 905, + "function_signature": "def sum_of_square(n: int) -> int:", + "text": "Write a python function to find the sum of squares of binomial co-efficients.", + "test_case": "assert sum_of_square(4) == 70" + }, + { + "task_id": 906, + "function_signature": "def extract_date(url: str) -> list[tuple[str, ...]]:", + "text": "Write a function to extract year, month and date from a url by using regex.", + "test_case": "assert extract_date(\"https://www.washingtonpost.com/news/football-insider/wp/2016/09/02/odell-beckhams-fame-rests-on-one-stupid-little-ball-josh-norman-tells-author/\") == [('2016', '09', '02')]" + }, + { + "task_id": 907, + "function_signature": "def lucky_num(n: int) -> list[int]:", + "text": "Write a function to print the first n lucky numbers.", + "test_case": "assert lucky_num(10)==[1, 3, 7, 9, 13, 15, 21, 25, 31, 33] " + }, + { + "task_id": 908, + "function_signature": "def find_fixed_point(arr: list[int], n: int) -> int:", + "text": "Write a function to find the fixed point in the given array.", + "test_case": "assert find_fixed_point([-10, -1, 0, 3, 10, 11, 30, 50, 100],9) == 3" + }, + { + "task_id": 909, + "function_signature": "def previous_palindrome(num: int) -> int:", + "text": "Write a function to find the previous palindrome of a specified number.", + "test_case": "assert previous_palindrome(99)==88" + }, + { + "task_id": 910, + "function_signature": "def check_date(m: int, d: int, y: int) -> bool:", + "text": "Write a function to validate a gregorian date.", + "test_case": "assert check_date(11,11,2002)==True" + }, + { + "task_id": 911, + "function_signature": "def maximum_product(nums: list[int]) -> int:", + "text": "Write a function to compute maximum product of three numbers of a given array of integers using heap queue algorithm.", + "test_case": "assert maximum_product( [12, 74, 9, 50, 61, 41])==225700" + }, + { + "task_id": 912, + "function_signature": "def int(None):", + "text": "Write a function to find ln, m lobb number.", + "test_case": "assert int(lobb_num(5, 3)) == 35" + }, + { + "task_id": 913, + "function_signature": "def end_num(string: str) -> bool:", + "text": "Write a function to check for a number at the end of a string.", + "test_case": "assert end_num('abcdef')==False" + }, + { + "task_id": 914, + "function_signature": "def is_Two_Alter(s: str) -> bool:", + "text": "Write a python function to check whether the given string is made up of two alternating characters or not.", + "test_case": "assert is_Two_Alter(\"abab\") == True" + }, + { + "task_id": 915, + "function_signature": "def rearrange_numbs(array_nums: list[int]) -> list[int]:", + "text": "Write a function to rearrange positive and negative numbers in a given array using lambda function.", + "test_case": "assert rearrange_numbs([-1, 2, -3, 5, 7, 8, 9, -10])==[2, 5, 7, 8, 9, -10, -3, -1]" + }, + { + "task_id": 916, + "function_signature": "def find_triplet_array(A: list[int], arr_size: int, sum: int) -> tuple[int, ...]:", + "text": "Write a function to find if there is a triplet in the array whose sum is equal to a given value.", + "test_case": "assert find_triplet_array([1, 4, 45, 6, 10, 8], 6, 22) == (4, 10, 8)" + }, + { + "task_id": 917, + "function_signature": "def text_uppercase_lowercase(text: str) -> str:", + "text": "Write a function to find the sequences of one upper case letter followed by lower case letters.", + "test_case": "assert text_uppercase_lowercase(\"AaBbGg\")==('Found a match!')" + }, + { + "task_id": 918, + "function_signature": "def coin_change(S: list[int], m: int, n: int) -> int:", + "text": "Write a function to count coin change.", + "test_case": "assert coin_change([1, 2, 3],3,4)==4" + }, + { + "task_id": 919, + "function_signature": "def multiply_list(items: list[int]) -> int:", + "text": "Write a python function to multiply all items in the list.", + "test_case": "assert multiply_list([1,-2,3]) == -6" + }, + { + "task_id": 920, + "function_signature": "def remove_tuple(test_list: list[tuple[None, ...]]) -> str:", + "text": "Write a function to remove all tuples with all none values in the given tuple list.", + "test_case": "assert remove_tuple([(None, 2), (None, None), (3, 4), (12, 3), (None, )] ) == '[(None, 2), (3, 4), (12, 3)]'" + }, + { + "task_id": 921, + "function_signature": "def chunk_tuples(test_tup: tuple[int, ...], N: int) -> list[tuple[int, ...]]:", + "text": "Write a function to perform chunking of tuples each of size n.", + "test_case": "assert chunk_tuples((10, 4, 5, 6, 7, 6, 8, 3, 4), 3) == [(10, 4, 5), (6, 7, 6), (8, 3, 4)]" + }, + { + "task_id": 922, + "function_signature": "def max_product(arr: list[int]) -> tuple[int, ...]:", + "text": "Write a function to find a pair with the highest product from a given array of integers.", + "test_case": "assert max_product([1, 2, 3, 4, 7, 0, 8, 4])==(7, 8)" + }, + { + "task_id": 923, + "function_signature": "def super_seq(X: str, Y: str, m: int, n: int) -> int:", + "text": "Write a function to find the length of the shortest string that has both str1 and str2 as subsequences.", + "test_case": "assert super_seq(\"AGGTAB\", \"GXTXAYB\", 6, 7) == 9" + }, + { + "task_id": 924, + "function_signature": "def max_of_two(x: int, y: int) -> int:", + "text": "Write a function to find maximum of two numbers.", + "test_case": "assert max_of_two(10,20)==20" + }, + { + "task_id": 925, + "function_signature": "def mutiple_tuple(nums: tuple[int, ...]) -> int:", + "text": "Write a python function to calculate the product of all the numbers of a given tuple.", + "test_case": "assert mutiple_tuple((4, 3, 2, 2, -1, 18)) == -864" + }, + { + "task_id": 926, + "function_signature": "def rencontres_number(n: int, m: int) -> int:", + "text": "Write a function to find n-th rencontres number.", + "test_case": "assert rencontres_number(7, 2) == 924" + }, + { + "task_id": 927, + "function_signature": "def None(None):", + "text": "Write a function to calculate the height of the given binary tree.", + "test_case": "assert (max_height(root)) == 3" + }, + { + "task_id": 928, + "function_signature": "def change_date_format(dt: str) -> str:", + "text": "Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.", + "test_case": "assert change_date_format('2026-01-02')=='02-01-2026'" + }, + { + "task_id": 929, + "function_signature": "def count_tuplex(tuplex: tuple[int, ...], value: int) -> int:", + "text": "Write a function to count repeated items of a tuple.", + "test_case": "assert count_tuplex((2, 4, 5, 6, 2, 3, 4, 4, 7),4)==3" + }, + { + "task_id": 930, + "function_signature": "def text_match(text: str) -> str:", + "text": "Write a function that matches a string that has an a followed by zero or more b's by using regex.", + "test_case": "assert text_match(\"msb\") == 'Not matched!'" + }, + { + "task_id": 931, + "function_signature": "def sum_series(number: int) -> int:", + "text": "Write a function to calculate the sum of series 1³+2³+3³+….+n³.", + "test_case": "assert sum_series(7)==784" + }, + { + "task_id": 932, + "function_signature": "def remove_duplic_list(l: list[str]) -> list[str]:", + "text": "Write a function to remove duplicate words from a given list of strings.", + "test_case": "assert remove_duplic_list([\"Python\", \"Exercises\", \"Practice\", \"Solution\", \"Exercises\"])==['Python', 'Exercises', 'Practice', 'Solution']" + }, + { + "task_id": 933, + "function_signature": "def camel_to_snake(text: str) -> str:", + "text": "Write a function to convert camel case string to snake case string by using regex.", + "test_case": "assert camel_to_snake('GoogleAssistant') == 'google_assistant'" + }, + { + "task_id": 934, + "function_signature": "def dealnnoy_num(n: int, m: int) -> int:", + "text": "Write a function to find the nth delannoy number.", + "test_case": "assert dealnnoy_num(3, 4) == 129" + }, + { + "task_id": 935, + "function_signature": "def series_sum(number: int) -> int:", + "text": "Write a function to calculate the sum of series 1²+2²+3²+….+n².", + "test_case": "assert series_sum(6)==91" + }, + { + "task_id": 936, + "function_signature": "def re_arrange_tuples(test_list: list[tuple[int, ...]], ord_list: list[int]) -> list[tuple[int, ...]]:", + "text": "Write a function to re-arrange the given tuples based on the given ordered list.", + "test_case": "assert re_arrange_tuples([(4, 3), (1, 9), (2, 10), (3, 2)], [1, 4, 2, 3]) == [(1, 9), (4, 3), (2, 10), (3, 2)]" + }, + { + "task_id": 937, + "function_signature": "def max_char(str1: str) -> str:", + "text": "Write a function to count the most common character in a given string.", + "test_case": "assert max_char(\"hello world\")==('l')" + }, + { + "task_id": 938, + "function_signature": "def find_closet(A: list[int], B: list[int], C: list[int], p: int, q: int, r: int) -> tuple[int, ...]:", + "text": "Write a function to find three closest elements from three sorted arrays.", + "test_case": "assert find_closet([1, 4, 10],[2, 15, 20],[10, 12],3,3,2) == (10, 15, 10)" + }, + { + "task_id": 939, + "function_signature": "def sorted_models(models: list[dict]) -> list[dict]:", + "text": "Write a function to sort a list of dictionaries using lambda function.", + "test_case": "assert sorted_models([{'make':'Nokia', 'model':216, 'color':'Black'}, {'make':'Mi Max', 'model':2, 'color':'Gold'}, {'make':'Samsung', 'model': 7, 'color':'Blue'}])==[{'make': 'Nokia', 'model': 216, 'color': 'Black'}, {'make': 'Samsung', 'model': 7, 'color': 'Blue'}, {'make': 'Mi Max', 'model': 2, 'color': 'Gold'}]" + }, + { + "task_id": 940, + "function_signature": "def heap_sort(arr: list[int]) -> list[int]:", + "text": "Write a function to sort the given array by using heap sort.", + "test_case": "assert heap_sort([12, 2, 4, 5, 2, 3]) == [2, 2, 3, 4, 5, 12]" + }, + { + "task_id": 941, + "function_signature": "def count_elim(num: list[int]) -> int:", + "text": "Write a function to count the elements in a list until an element is a tuple.", + "test_case": "assert count_elim([10,20,30,(10,20),40])==3" + }, + { + "task_id": 942, + "function_signature": "def check_element(test_tup: tuple[int, ...], check_list: list[int]) -> bool:", + "text": "Write a function to check if any list element is present in the given list.", + "test_case": "assert check_element((4, 5, 7, 9, 3), [6, 7, 10, 11]) == True" + }, + { + "task_id": 943, + "function_signature": "def combine_lists(num1: list[int], num2: list[int]) -> list[int]:", + "text": "Write a function to combine two given sorted lists using heapq module.", + "test_case": "assert combine_lists([1, 3, 5, 7, 9, 11],[0, 2, 4, 6, 8, 10])==[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" + }, + { + "task_id": 944, + "function_signature": "def num_position(text: str) -> int:", + "text": "Write a function to separate and print the numbers and their position of a given string.", + "test_case": "assert num_position(\"there are 70 flats in this apartment\")==10" + }, + { + "task_id": 945, + "function_signature": "def tuple_to_set(t: tuple[str, ...]) -> set:", + "text": "Write a function to convert the given tuples into set.", + "test_case": "assert tuple_to_set(('x', 'y', 'z') ) == {'y', 'x', 'z'}" + }, + { + "task_id": 946, + "function_signature": "def most_common_elem(s: str, a: int) -> list[tuple[str, ...]]:", + "text": "Write a function to find the most common elements and their counts of a specified text.", + "test_case": "assert most_common_elem('lkseropewdssafsdfafkpwe',3)==[('s', 4), ('e', 3), ('f', 3)] " + }, + { + "task_id": 947, + "function_signature": "def len_log(list1: list[str]) -> int:", + "text": "Write a python function to find the length of the shortest word.", + "test_case": "assert len_log([\"win\",\"lose\",\"great\"]) == 3" + }, + { + "task_id": 948, + "function_signature": "def get_item(tup1: tuple[str, ...], index: int) -> str:", + "text": "Write a function to get an item of a tuple.", + "test_case": "assert get_item((\"w\", 3, \"r\", \"e\", \"s\", \"o\", \"u\", \"r\", \"c\", \"e\"),3)==('e')" + }, + { + "task_id": 949, + "function_signature": "def sort_list(test_list: list[tuple[int, ...]]) -> str:", + "text": "Write a function to sort the given tuple list basis the total digits in tuple.", + "test_case": "assert sort_list([(3, 4, 6, 723), (1, 2), (12345,), (134, 234, 34)] ) == '[(1, 2), (12345,), (3, 4, 6, 723), (134, 234, 34)]'" + }, + { + "task_id": 950, + "function_signature": "def chinese_zodiac(year: int) -> str:", + "text": "Write a function to display sign of the chinese zodiac for given year.", + "test_case": "assert chinese_zodiac(1997)==('Ox')" + }, + { + "task_id": 951, + "function_signature": "def max_similar_indices(test_list1: list[tuple[int, ...]], test_list2: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to find the maximum of similar indices in two lists of tuples.", + "test_case": "assert max_similar_indices([(2, 4), (6, 7), (5, 1)],[(5, 4), (8, 10), (8, 14)]) == [(5, 4), (8, 10), (8, 14)]" + }, + { + "task_id": 952, + "function_signature": "def nCr_mod_p(n: int, r: int, p: int) -> int:", + "text": "Write a function to compute the value of ncr mod p.", + "test_case": "assert nCr_mod_p(10, 2, 13) == 6" + }, + { + "task_id": 953, + "function_signature": "def subset(ar: list[int], n: int) -> int:", + "text": "Write a python function to find the minimun number of subsets with distinct elements.", + "test_case": "assert subset([1, 2, 3, 4],4) == 1" + }, + { + "task_id": 954, + "function_signature": "def profit_amount(actual_cost: int, sale_amount: int) -> int:", + "text": "Write a function that gives profit amount if the given amount has profit else return none.", + "test_case": "assert profit_amount(1500,1200)==300" + }, + { + "task_id": 955, + "function_signature": "def is_abundant(n: int) -> bool:", + "text": "Write a function to find out, if the given number is abundant.", + "test_case": "assert is_abundant(12)==True" + }, + { + "task_id": 956, + "function_signature": "def split_list(text: str) -> list[str]:", + "text": "Write a function to split the given string at uppercase letters by using regex.", + "test_case": "assert split_list(\"LearnToBuildAnythingWithGoogle\") == ['Learn', 'To', 'Build', 'Anything', 'With', 'Google']" + }, + { + "task_id": 957, + "function_signature": "def get_First_Set_Bit_Pos(n: int) -> int:", + "text": "Write a python function to get the position of rightmost set bit.", + "test_case": "assert get_First_Set_Bit_Pos(12) == 3" + }, + { + "task_id": 958, + "function_signature": "def int_to_roman(num: int) -> str:", + "text": "Write a function to convert an integer into a roman numeral.", + "test_case": "assert int_to_roman(1)==(\"I\")" + }, + { + "task_id": 959, + "function_signature": "def Average(lst: list[int]) -> float:", + "text": "Write a python function to find the average of a list.", + "test_case": "assert Average([15, 9, 55, 41, 35, 20, 62, 49]) == 35.75" + }, + { + "task_id": 960, + "function_signature": "def get_noOfways(n: int) -> int:", + "text": "Write a function to solve tiling problem.", + "test_case": "assert get_noOfways(4)==3" + }, + { + "task_id": 961, + "function_signature": "def roman_to_int(s: str) -> int:", + "text": "Write a function to convert a roman numeral to an integer.", + "test_case": "assert roman_to_int('MMMCMLXXXVI')==3986" + }, + { + "task_id": 962, + "function_signature": "def sum_Even(l: int, r: int) -> int:", + "text": "Write a python function to find the sum of all even natural numbers within the range l and r.", + "test_case": "assert sum_Even(2,5) == 6" + }, + { + "task_id": 963, + "function_signature": "def discriminant_value(x: int, y: int, z: int) -> tuple[str, ...]:", + "text": "Write a function to calculate the discriminant value.", + "test_case": "assert discriminant_value(4,8,2)==(\"Two solutions\",32)" + }, + { + "task_id": 964, + "function_signature": "def word_len(s: str) -> bool:", + "text": "Write a python function to check whether the length of the word is even or not.", + "test_case": "assert word_len(\"program\") == False" + }, + { + "task_id": 965, + "function_signature": "def camel_to_snake(text: str) -> str:", + "text": "Write a function to convert camel case string to snake case string.", + "test_case": "assert camel_to_snake('PythonProgram')==('python_program')" + }, + { + "task_id": 966, + "function_signature": "def remove_empty(tuple1: list[tuple]) -> list[tuple[str, ...]]:", + "text": "Write a function to remove an empty tuple from a list of tuples.", + "test_case": "assert remove_empty([(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')])==[('',), ('a', 'b'), ('a', 'b', 'c'), 'd'] " + }, + { + "task_id": 967, + "function_signature": "def check(string: str) -> str:", + "text": "Write a python function to accept the strings which contains all vowels.", + "test_case": "assert check(\"SEEquoiaL\") == 'accepted'" + }, + { + "task_id": 968, + "function_signature": "def floor_Max(A: int, B: int, N: int) -> int:", + "text": "Write a python function to find maximum possible value for the given periodic function.", + "test_case": "assert floor_Max(11,10,9) == 9" + }, + { + "task_id": 969, + "function_signature": "def join_tuples(test_list: list[tuple[int, ...]]) -> list[tuple[int, ...]]:", + "text": "Write a function to join the tuples if they have similar initial elements.", + "test_case": "assert join_tuples([(5, 6), (5, 7), (6, 8), (6, 10), (7, 13)] ) == [(5, 6, 7), (6, 8, 10), (7, 13)]" + }, + { + "task_id": 970, + "function_signature": "def min_of_two(x: int, y: int) -> int:", + "text": "Write a function to find minimum of two numbers.", + "test_case": "assert min_of_two(10,20)==10" + }, + { + "task_id": 971, + "function_signature": "def maximum_segments(n, a, b, c) : \r\n\tdp = [-1] * (n + 10) \r\n\tdp[0] = 0\r\n\tfor i in range(0, n) : \r\n\t\tif (dp[i] != -1) : \r\n\t\t\tif(i + a <= n):", + "text": "Write a function to find the maximum number of segments of lengths a, b and c that can be formed from n.", + "test_case": "assert maximum_segments(7, 5, 2, 5) == 2" + }, + { + "task_id": 972, + "function_signature": "def concatenate_nested(test_tup1: tuple[int, ...], test_tup2: tuple[int, ...]) -> tuple[int, ...]:", + "text": "Write a function to concatenate the given two tuples to a nested tuple.", + "test_case": "assert concatenate_nested((3, 4), (5, 6)) == (3, 4, 5, 6)" + }, + { + "task_id": 973, + "function_signature": "def left_rotate(s: str, d: int) -> str:", + "text": "Write a python function to left rotate the string.", + "test_case": "assert left_rotate(\"python\",2) == \"thonpy\" " + }, + { + "task_id": 974, + "function_signature": "def min_sum_path(A: list[list[int]]) -> int:", + "text": "Write a function to find the minimum total path sum in the given triangle.", + "test_case": "assert min_sum_path([[ 2 ], [3, 9 ], [1, 6, 7 ]]) == 6" + } +] \ No newline at end of file