Prompt:
def volume_cube(l: int) -> int:
    """
	Write a function to find the volume of a cube given its side length.
	"""

def check(candidate):
    assert candidate(3) == 27
    assert candidate(2) == 8
    assert candidate(5) == 125

def test_check():
    check(volume_cube)

test_check()


Prompt:
def closest_num(N: int) -> int:
    """
	Write a function to find the closest smaller number than n.
	"""

def check(candidate):
    assert candidate(11) == 10
    assert candidate(7) == 6
    assert candidate(12) == 11

def test_check():
    check(closest_num)

test_check()


Prompt:
from typing import List

def max_sum(arr: List[int]) -> int:
    """
	Write a function that takes an array and finds the maximum sum of a bitonic subsequence for the given array, where a sequence is bitonic if it is first increasing and then decreasing.
	"""


Prompt:
from typing import List, Tuple, Dict

def check_occurences(test_list: List[Tuple[int, int]]) -> Dict[Tuple[int, int], int]:
    """
	Write a function that takes in a list of tuples and returns a dictionary mapping each unique tuple to the number of times it occurs in the list.
	"""


Prompt:
def is_Diff(n: int) -> bool:
    """
	Write a python function to find whether a number is divisible by 11.
	"""

def check(candidate):
    assert candidate(12345) == False
    assert candidate(1212112) == True
    assert candidate(1212) == False

def test_check():
    check(is_Diff)

test_check()


Prompt:
def amicable_numbers_sum(limit: int) -> int:
    """
	Write a function to sum all amicable numbers from 1 to a specified number.
	"""

def check(candidate):
    assert candidate(999) == 504
    assert candidate(9999) == 31626
    assert candidate(99) == 0

def test_check():
    check(amicable_numbers_sum)

test_check()


Prompt:
def cube_Sum(n: int) -> int:
    """
	Write a python function to find the cube sum of first n even natural numbers.
	"""

def check(candidate):
    assert candidate(2) == 72
    assert candidate(3) == 288
    assert candidate(4) == 800

def test_check():
    check(cube_Sum)

test_check()


Prompt:
from typing import List, Dict, Union

def expensive_items(items: List[Dict[str, Union[str, float]]], n: int) -> List[Dict[str, Union[str, float]]]:
    """
	Write a function to find the n most expensive items in a given dataset.
	"""


Prompt:
def is_woodall(x: int) -> bool:
    """
	Write a function to check if the given number is woodball or not.
	"""

def check(candidate):
    assert candidate(383) == True
    assert candidate(254) == False
    assert candidate(200) == False

def test_check():
    check(is_woodall)

test_check()


Prompt:
from typing import List

def max_sum_list(lists: List[List[int]]) -> List[int]:
    """
	Write a function that returns the list in a list of lists whose sum of elements is the highest.
	"""


Prompt:
def max_run_uppercase(test_str: str) -> int:
    """
	Write a function to find maximum run of uppercase characters in the given string.
	"""

def check(candidate):
    assert candidate('GeMKSForGERksISBESt') == 5
    assert candidate('PrECIOusMOVemENTSYT') == 6
    assert candidate('GooGLEFluTTER') == 4

def test_check():
    check(max_run_uppercase)

test_check()

assert max_run_uppercase('GeMKSForGERksISBESt') == 5


Prompt:
def check_monthnumb_number(monthnum2: int) -> bool:
    """
	Write a function to check whether the given month number contains 31 days or not.
	"""

def check(candidate):
    assert candidate(5) == True
    assert candidate(2) == False
    assert candidate(6) == False

def test_check():
    check(check_monthnumb_number)

test_check()

assert check_monthnumb_number(5) == True


Prompt:
def last_Digit_Factorial(n: int) -> int:
    """
	Write a python function to find the last digit in factorial of a given number.
	"""

def check(candidate):
    assert candidate(4) == 4
    assert candidate(21) == 0
    assert candidate(30) == 0

def test_check():
    check(last_Digit_Factorial)

test_check()


Prompt:
def difference(n: int) -> int:
    """
	Write a python function to find the difference between the sum of cubes of the first n natural numbers and the sum of the first n natural numbers.
	"""

def check(candidate):
    assert candidate(3) == 30
    assert candidate(5) == 210
    assert candidate(2) == 6

def test_check():
    check(difference)

test_check()


Prompt:
from typing import List

def reverse_string_list(stringlist: List[str]) -> List[str]:
    """
	Write a function to reverse each string in a given list of string values.
	"""

def check(candidate):
    assert candidate(['Red', 'Green', 'Blue', 'White', 'Black']) == ['deR', 'neerG', 'eulB', 'etihW', 'kcalB']
    assert candidate(['john', 'amal', 'joel', 'george']) == ['nhoj', 'lama', 'leoj', 'egroeg']
    assert candidate(['jack', 'john', 'mary']) == ['kcaj', 'nhoj', 'yram']

def test_check():
    check(reverse_string_list)

test_check()

assert reverse_string_list(['Red', 'Green', 'Blue', 'White', 'Black']) == ['deR', 'neerG', 'eulB', 'etihW', 'kcalB']


Prompt:
from typing import List, Any

def list_tuple(listx: List[int]) -> Any:
    """
	Write a function to convert a list to a tuple.
	"""


Prompt:
from typing import List, Any

def merge(lst: List[List[Any]]) -> List[List[Any]]:
    """
	Write a python function which takes a list of lists, where each sublist has two elements, and returns a list of two lists where the first list has the first element of each sublist and the second one has the second.
	"""


Prompt:
from typing import List

def sort_matrix(M: List[List[int]]) -> List[List[int]]:
    """
	Write a function to sort a given matrix in ascending order according to the sum of its rows.
	"""


Prompt:
def find_adverbs(text: str) -> str:
    """
	Write a function to find the first adverb ending with ly and its positions in a given string.
	"""

def check(candidate):
    assert candidate('Clearly, he has no excuse for such behavior.') == '0-7: Clearly'
    assert candidate('Please handle the situation carefuly') == '28-36: carefuly'
    assert candidate('Complete the task quickly') == '18-25: quickly'

def test_check():
    check(find_adverbs)

test_check()

assert find_adverbs('Clearly, he has no excuse for such behavior.') == '0-7: Clearly'


Prompt:
def centered_hexagonal_number(n: int) -> int:
    """
	Write a function to find nth centered hexagonal number.
	"""

def check(candidate):
    assert candidate(10) == 271
    assert candidate(2) == 7
    assert candidate(9) == 217

def test_check():
    check(centered_hexagonal_number)

test_check()

assert centered_hexagonal_number(10) == 271


Prompt:
from typing import List

def max_occurrences(nums: List[int]) -> int:
    """
	Write a function to find the item with maximum frequency in a given list.
	"""


Prompt:
from typing import Tuple, Any

def extract_even(test_tuple: Tuple[int, int, Tuple[int, int, Tuple[int, int]], int, int]) -> Any:
    """
	Write a function to remove uneven elements in the nested mixed tuple.
	"""


Prompt:
def area_tetrahedron(side: int) -> float:
    """
	Write a function to caluclate the area of a tetrahedron.
	"""

def check(candidate):
    assert candidate(3) == 15.588457268119894
    assert candidate(20) == 692.8203230275509
    assert candidate(10) == 173.20508075688772

def test_check():
    check(area_tetrahedron)

test_check()


Prompt:
from typing import List

def remove_kth_element(list1: List[int], L: int) -> List[int]:
    """
	Write a python function which takes a list and returns a list with the same elements, but the k'th element removed.
	"""


Prompt:
from typing import List

def check_distinct(test_tup: List[int]) -> bool:
    """
	Write a function to check if given list contains no duplicates.
	"""

def check(candidate):
    assert candidate([1, 4, 5, 6, 1, 4]) == False
    assert candidate([1, 4, 5, 6]) == True
    assert candidate([2, 3, 4, 5, 6]) == True

def test_check():
    check(check_distinct)

test_check()

assert check_distinct([1, 4, 5, 6, 1, 4]) == False


Prompt:
from typing import List

def last(arr: List[int], x: int) -> int:
    """
	Write a python function to find the last position of an element in a sorted array.
	"""

def check(candidate):
    assert candidate([1, 2, 3], 1) == 0
    assert candidate([1, 1, 1, 2, 3, 4], 1) == 2
    assert candidate([2, 3, 2, 3, 6, 8, 9], 3) == 3

def test_check():
    check(last)

test_check()


Prompt:
from typing import List

def sum_list(lst1: List[int], lst2: List[int]) -> List[int]:
    """
	Write a function takes as input two lists [a_1,...,a_n], [b_1,...,b_n] and returns [a_1+b_1,...,a_n+b_n].
	"""


Prompt:
def sum_digits(n: int) -> int:
    """
	Write a function to get the sum of the digits of a non-negative integer.
	"""

def check(candidate):
    assert candidate(345) == 12
    assert candidate(12) == 3
    assert candidate(97) == 16

def test_check():
    check(sum_digits)

test_check()


Prompt:
from typing import List, Tuple

def max_length(list1: List[List[int]]) -> Tuple[int, List[int]]:
    """
	Write a function to find the list of maximum length in a list of lists.
	"""


Prompt:
from typing import List, Tuple, Any

def extract_nth_element(list1: List[Tuple[str, int, int]], n: int) -> List[Any]:
    """
	Write a function to extract the nth element from a given list of tuples.
	"""

def check(candidate):
    assert candidate([('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']
    assert candidate([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)], 2) == [99, 96, 94, 98]
    assert candidate([('Greyson Fulton', 98, 99), ('Brady Kent', 97, 96), ('Wyatt Knott', 91, 94), ('Beau Turnbull', 94, 98)], 1) == [98, 97, 91, 94]

def test_check():
    check(extract_nth_element)

test_check()

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']


Prompt:
def replace_spaces(string: str) -> str:
    """
	Write a function to replace all spaces in the given string with '%20'.
	"""

def check(candidate):
    assert candidate('My Name is Dawood') == 'My%20Name%20is%20Dawood'
    assert candidate('I am a Programmer') == 'I%20am%20a%20Programmer'
    assert candidate('I love Coding') == 'I%20love%20Coding'

def test_check():
    check(replace_spaces)

test_check()

assert replace_spaces('My Name is Dawood') == 'My%20Name%20is%20Dawood'


Prompt:
from typing import List

def group_tuples(Input: List[List[str]]) -> List[List[str]]:
    """
	Write a function to find common first element in given list of lists.
	"""


Prompt:
from typing import List

def max_sub_array_sum_repeated(a: List[int], n: int, k: int) -> int:
    """
	Write a function to find the largest sum of a contiguous array in the modified array which is formed by repeating the given array k times.
	"""

def check(candidate):
    assert candidate([10, 20, -30, -1], 4, 3) == 30
    assert candidate([-1, 10, 20], 3, 2) == 59
    assert candidate([-1, -2, -3], 3, 3) == -1

def test_check():
    check(max_sub_array_sum_repeated)

test_check()

assert max_sub_array_sum_repeated([10, 20, -30, -1], 4, 3) == 30


Prompt:
from typing import List

def pos_count(list: List[int]) -> int:
    """
	Write a python function to count the number of positive numbers in a list.
	"""

def check(candidate):
    assert candidate([1, -2, 3, -4]) == 2
    assert candidate([3, 4, 5, -1]) == 3
    assert candidate([1, 2, 3, 4]) == 4

def test_check():
    check(pos_count)

test_check()


Prompt:
from typing import List

def extract_string(str: List[str], l: int) -> List[str]:
    """
	Write a function to extract specified size of strings from a given list of string values.
	"""

def check(candidate):
    assert candidate(['Python', 'list', 'exercises', 'practice', 'solution'], 8) == ['practice', 'solution']
    assert candidate(['Python', 'list', 'exercises', 'practice', 'solution'], 6) == ['Python']
    assert candidate(['Python', 'list', 'exercises', 'practice', 'solution'], 9) == ['exercises']

def test_check():
    check(extract_string)

test_check()

assert extract_string(['Python', 'list', 'exercises', 'practice', 'solution'], 8) == ['practice', 'solution']


Prompt:
from typing import List

def trim_tuple(test_list: List[List[int]], K: int) -> List[List[int]]:
    """
	Write a function to trim each list by k in the given lists.
	"""


Prompt:
from typing import List

def multiple_to_single(L: List[int]) -> int:
    """
	Write a function to join a list of multiple integers into a single integer.
	"""

def check(candidate):
    assert candidate([11, 33, 50]) == 113350
    assert candidate([-1, 2, 3, 4, 5, 6]) == -123456
    assert candidate([10, 15, 20, 25]) == 10152025

def test_check():
    check(multiple_to_single)

test_check()

assert multiple_to_single([11, 33, 50]) == 113350


Prompt:
def sum_series(n: int) -> int:
    """
	Write a function to calculate the sum (n - 2*i) from i=0 to n // 2, for instance n + (n-2) + (n-4)... (until n-x =< 0).
	"""

def check(candidate):
    assert candidate(6) == 12
    assert candidate(10) == 30
    assert candidate(9) == 25

def test_check():
    check(sum_series)

test_check()


Prompt:
def count_Set_Bits(n: int) -> int:
    """
	Write a python function to count the number of set bits (binary digits with value 1) in a given number.
	"""

def check(candidate):
    assert candidate(2) == 1
    assert candidate(4) == 1
    assert candidate(6) == 2

def test_check():
    check(count_Set_Bits)

test_check()


Prompt:
def maximum(a: int, b: int) -> int:
    """
	Write a python function to find the maximum of two numbers.
	"""

def check(candidate):
    assert candidate(5, 10) == 10
    assert candidate(-1, -2) == -1
    assert candidate(9, 7) == 9

def test_check():
    check(maximum)

test_check()


Prompt:
from typing import List

def move_zero(num_list: List[int]) -> List[int]:
    """
	Write a python function to move all zeroes to the end of the given list.
	"""


Prompt:
from typing import List

def frequency(a: List[int], x: int) -> int:
    """
	Write a function to count the number of occurrences of a number in a given list.
	"""

def check(candidate):
    assert candidate([1, 2, 3], 4) == 0
    assert candidate([1, 2, 2, 3, 3, 3, 4], 3) == 3
    assert candidate([0, 1, 2, 3, 1, 2], 1) == 2

def test_check():
    check(frequency)

test_check()


Prompt:
from typing import List

def sort_numeric_strings(nums_str: List[str]) -> List[int]:
    """
	Write a function to sort a given list of strings of numbers numerically. https://www.geeksforgeeks.org/python-sort-numeric-strings-in-a-list/
	"""


Prompt:
from typing import List, Dict

def frequency_lists(list1: List[List[int]]) -> Dict[int, int]:
    """
	Write a function to find frequency of each element in a flattened list of lists, returned in a dictionary.
	"""


Prompt:
from typing import Tuple

def and_tuples(test_tup1: Tuple[int, int, int, int], test_tup2: Tuple[int, int, int, int]) -> Tuple[int, int, int, int]:
    """
	Write a function to extract the elementwise and tuples from the given two tuples.
	"""


Prompt:
def is_decimal(num: str) -> bool:
    """
	Write a function to check whether a given string is a decimal number with a precision of 2.
	"""

def check(candidate):
    assert candidate('123.11') == True
    assert candidate('e666.86') == False
    assert candidate('3.124587') == False
    assert candidate('1.11') == True
    assert candidate('1.1.11') == False

def test_check():
    check(is_decimal)

test_check()


Prompt:
from typing import Tuple

def sum_average(number: int) -> Tuple[int, float]:
    """
	Write a function to find sum and average of first n natural numbers.
	"""

def check(candidate):
    assert candidate(10) == (55, 5.5)
    assert candidate(15) == (120, 8.0)
    assert candidate(20) == (210, 10.5)

def test_check():
    check(sum_average)

test_check()


Prompt:
from typing import List

def is_product_even(arr: List[int]) -> bool:
    """
	Write a function to check whether the product of numbers in a list is even or not.
	"""

def check(candidate):
    assert candidate([1, 2, 3]) == True
    assert candidate([1, 2, 1, 4]) == True
    assert candidate([1, 1]) == False

def test_check():
    check(is_product_even)

test_check()

assert is_product_even([1, 2, 3]) == True


Prompt:
def eulerian_num(n: int, m: int) -> int:
    """
	Write a function to find the Eulerian number a(n, m).
	"""

def check(candidate):
    assert candidate(3, 1) == 4
    assert candidate(4, 1) == 11
    assert candidate(5, 3) == 26

def test_check():
    check(eulerian_num)

test_check()


Prompt:
from typing import List, Dict

def convert_list_dictionary(l1: List[str], l2: List[str], l3: List[int]) -> List[Dict[str, Dict[str, int]]]:
    """
	Write a function to convert more than one list to nested dictionary.
	"""

assert convert_list_dictionary(['S001', 'S002', 'S003', 'S004'], ['Adina Park', 'Leyton Marsh', 'Duncan Boyle', 'Saim Richards'], [85, 98, 89, 92]) == [{ 'S001': { 'Adina Park': 85 } }]


Prompt:
from typing import List

def heap_sort(iterable: List[int]) -> List[int]:
    """
	Write a function to sort the given list.
	"""


Prompt:
from typing import List

def sum_even_and_even_index(arr: List[int]) -> int:
    """
	Write a python function to find the sum of even numbers at even positions of a list.
	"""

def check(candidate):
    assert candidate([5, 6, 12, 1, 18, 8]) == 30
    assert candidate([3, 20, 17, 9, 2, 10, 18, 13, 6, 18]) == 26
    assert candidate([5, 6, 12, 1]) == 12

def test_check():
    check(sum_even_and_even_index)

test_check()

assert sum_even_and_even_index([5, 6, 12, 1, 18, 8]) == 30


Prompt:
def text_match_three(text: str) -> bool:
    """
	Write a function that matches a string that has an a followed by three 'b'.
	"""

def check(candidate):
    assert candidate('ac') == False
    assert candidate('dc') == False
    assert candidate('abbbba') == True
    assert candidate('caacabbbba') == True

def test_check():
    check(text_match_three)

test_check()


Prompt:
def is_polite(n: int) -> int:
    """
	Write a function to find nth polite number. geeksforgeeks.org/n-th-polite-number/
	"""

def check(candidate):
    assert candidate(7) == 11
    assert candidate(4) == 7
    assert candidate(9) == 13

def test_check():
    check(is_polite)

test_check()


Prompt:
def remove_uppercase(str1: str) -> str:
    """
	Write a function to remove uppercase substrings from a given string.
	"""

def check(candidate):
    assert candidate('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'
    assert candidate('wAtchTheinTernEtrAdIo') == 'wtchheinerntrdo'
    assert candidate('VoicESeaRchAndreComMendaTionS') == 'oiceachndreomendaion'

def test_check():
    check(remove_uppercase)

test_check()

assert remove_uppercase('cAstyoUrFavoRitETVshoWs') == 'cstyoravoitshos'


Prompt:
def text_lowercase_underscore(text: str) -> bool:
    """
	Write a function to that returns true if the input string contains sequences of lowercase letters joined with an underscore and false otherwise.
	"""

def check(candidate):
    assert candidate('aab_cbbbc') == True
    assert candidate('aab_Abbbc') == False
    assert candidate('Aaab_abbbc') == False

def test_check():
    check(text_lowercase_underscore)

test_check()

assert text_lowercase_underscore('aab_cbbbc') == True


Prompt:
def lateralsurface_cone(r: int, h: int) -> float:
    """
	Write a function to find the lateral surface area of a cone given radius r and the height h.
	"""

def check(candidate):
    assert candidate(5, 12) == 204.20352248333654
    assert candidate(10, 15) == 566.3586699569488
    assert candidate(19, 17) == 1521.8090132193388

def test_check():
    check(lateralsurface_cone)

test_check()


Prompt:
from typing import List

def count_rotation(arr: List[int]) -> int:
    """
	Write a python function to count the number of rotations required to generate a sorted array. https://www.geeksforgeeks.org/count-of-rotations-required-to-generate-a-sorted-array/
	"""

def check(candidate):
    assert candidate([3, 2, 1]) == 1
    assert candidate([4, 5, 1, 2, 3]) == 2
    assert candidate([7, 8, 9, 1, 2, 3]) == 3
    assert candidate([1, 2, 3]) == 0
    assert candidate([1, 3, 2]) == 2

def test_check():
    check(count_rotation)

test_check()


Prompt:
from typing import List

def odd_length_sum(arr: List[int]) -> int:
    """
	Write a python function to find the sum of all odd length subarrays. https://www.geeksforgeeks.org/sum-of-all-odd-length-subarrays/
	"""

def check(candidate):
    assert candidate([1, 2, 4]) == 14
    assert candidate([1, 2, 1, 2]) == 15
    assert candidate([1, 7]) == 8

def test_check():
    check(odd_length_sum)

test_check()


Prompt:
from typing import Tuple

def add_pairwise(test_tup: Tuple[int, int, int, int, int]) -> Tuple[int, int, int, int]:
    """
	Write a function to find the pairwise addition of the neighboring elements of the given tuple.
	"""

def check(candidate):
    assert candidate((1, 5, 7, 8, 10)) == (6, 12, 15, 18)
    assert candidate((2, 6, 8, 9, 11)) == (8, 14, 17, 20)
    assert candidate((3, 7, 9, 10, 12)) == (10, 16, 19, 22)

def test_check():
    check(add_pairwise)

test_check()


Prompt:
def square_perimeter(a: int) -> int:
    """
	Write a function that returns the perimeter of a square given its side length as input.
	"""

def check(candidate):
    assert candidate(10) == 40
    assert candidate(5) == 20
    assert candidate(4) == 16

def test_check():
    check(square_perimeter)

test_check()


Prompt:
def all_Bits_Set_In_The_Given_Range(n: int, l: int, r: int) -> bool:
    """
	Write a python function to check whether all the bits are unset in the given range or not.
	"""

def check(candidate):
    assert candidate(4, 1, 2) == True
    assert candidate(17, 2, 4) == True
    assert candidate(39, 4, 6) == False

def test_check():
    check(all_Bits_Set_In_The_Given_Range)

test_check()

assert all_Bits_Set_In_The_Given_Range(4, 1, 2) == True


Prompt:
from typing import List, Any

def replace_list(list1: List[Any], list2: List[Any]) -> List[Any]:
    """
	Write a function that takes in two lists and replaces the last element of the first list with the elements of the second list.
	"""


Prompt:
from typing import List

def cube_nums(nums: List[int]) -> List[int]:
    """
	Write a function to find cubes of individual elements in a list.
	"""


Prompt:
from typing import Tuple

def division_elements(test_tup1: Tuple[int, int, int, int], test_tup2: Tuple[int, int, int, int]) -> Tuple[int, int, int, int]:
    """
	Write a function that takes in two tuples and performs mathematical division operation element-wise across the given tuples.
	"""


Prompt:
def surface_Area(b: int, s: int) -> int:
    """
	Write a python function to find the surface area of a square pyramid with a given base edge and height.
	"""

def check(candidate):
    assert candidate(3, 4) == 33
    assert candidate(4, 5) == 56
    assert candidate(1, 2) == 5

def test_check():
    check(surface_Area)

test_check()


Prompt:
def validate(n: int) -> bool:
    """
	Write a python function takes in an integer and check whether the frequency of each digit in the integer is less than or equal to the digit itself.
	"""

def check(candidate):
    assert candidate(1234) == True
    assert candidate(51241) == False
    assert candidate(321) == True

def test_check():
    check(validate)

test_check()


Prompt:
from typing import List, Any

def check_element(list: List[Any], element: Any) -> bool:
    """
	Write a function that takes in a list and element and checks whether all items in the list are equal to the given element.
	"""

def check(candidate):
    assert candidate(['green', 'orange', 'black', 'white'], 'blue') == False
    assert candidate([1, 2, 3, 4], 7) == False
    assert candidate(['green', 'green', 'green', 'green'], 'green') == True

def test_check():
    check(check_element)

test_check()

assert check_element(['green', 'orange', 'black', 'white'], 'blue') == False


Prompt:
from typing import List

def kth_element(arr: List[int], k: int) -> int:
    """
	Write a function to find the kth element in the given array using 1-based indexing.
	"""

def check(candidate):
    assert candidate([12, 3, 5, 7, 19], 2) == 3
    assert candidate([17, 24, 8, 23], 3) == 8
    assert candidate([16, 21, 25, 36, 4], 4) == 36

def test_check():
    check(kth_element)

test_check()


Prompt:
def upper_ctr(str: str) -> int:
    """
	Write a python function to count the upper case characters in a given string.
	"""

def check(candidate):
    assert candidate('PYthon') == 1
    assert candidate('BigData') == 1
    assert candidate('program') == 0

def test_check():
    check(upper_ctr)

test_check()


Prompt:
def removezero_ip(ip: str) -> str:
    """
	Write a function to remove leading zeroes from an ip address.
	"""


Prompt:
from typing import List, Tuple

def new_tuple(test_list: List[str], test_str: str) -> Tuple[str, str, str]:
    """
	Write a function to create a new tuple from the given string and list.
	"""

def check(candidate):
    assert candidate(['WEB', 'is'], 'best') == ('WEB', 'is', 'best')
    assert candidate(['We', 'are'], 'Developers') == ('We', 'are', 'Developers')
    assert candidate(['Part', 'is'], 'Wrong') == ('Part', 'is', 'Wrong')

def test_check():
    check(new_tuple)

test_check()

assert new_tuple(['WEB', 'is'], 'best') == ('WEB', 'is', 'best')


Prompt:
from typing import List

def find_sum(arr: List[int]) -> int:
    """
	Write a python function to find the sum of non-repeated elements in a given list.
	"""


Prompt:
from typing import List

def split_Arr(l: List[int], n: int) -> List[int]:
    """
	Write a python function to split a list at the nth eelment and add the first part to the end.
	"""


Prompt:
from typing import List

def sort_sublists(input_list: List[List[str]]) -> List[List[str]]:
    """
	Write a function to sort each sublist of strings in a given list of lists.
	"""

def check(candidate):
    assert candidate([['green', 'orange'], ['black', 'white'], ['white', 'black', 'orange']]) == [['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]
    assert candidate([[' red ', 'green'], ['blue ', ' black'], [' orange', 'brown']]) == [[' red ', 'green'], [' black', 'blue '], [' orange', 'brown']]
    assert candidate([['zilver', 'gold'], ['magnesium', 'aluminium'], ['steel', 'bronze']]) == [['gold', 'zilver'], ['aluminium', 'magnesium'], ['bronze', 'steel']]

def test_check():
    check(sort_sublists)

test_check()

assert sort_sublists([['green', 'orange'], ['black', 'white'], ['white', 'black', 'orange']]) == [['green', 'orange'], ['black', 'white'], ['black', 'orange', 'white']]


Prompt:
from typing import List

def check_Consecutive(l: List[int]) -> bool:
    """
	Write a python function to check whether the given list contains consecutive numbers or not.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5]) == True
    assert candidate([1, 2, 3, 5, 6]) == False
    assert candidate([1, 2, 1]) == False

def test_check():
    check(check_Consecutive)

test_check()

assert check_Consecutive([1, 2, 3, 4, 5]) == True


Prompt:
from typing import List

def string_to_tuple(str1: str) -> List[str]:
    """
	Write a function to convert a given string to a list of characters.
	"""

def check(candidate):
    assert candidate('python 3.0') == ['p', 'y', 't', 'h', 'o', 'n', '3', '.', '0']
    assert candidate('item1') == ['i', 't', 'e', 'm', '1']
    assert candidate('15.10') == ['1', '5', '.', '1', '0']

def test_check():
    check(string_to_tuple)

test_check()


Prompt:
def lateralsurface_cube(l: int) -> int:
    """
	Write a function to find the lateral surface area of a cube given its side length.
	"""

def check(candidate):
    assert candidate(5) == 100
    assert candidate(9) == 324
    assert candidate(10) == 400

def test_check():
    check(lateralsurface_cube)

test_check()


Prompt:
def even_Power_Sum(n: int) -> int:
    """
	Write a python function that takes in an integer n and finds the sum of the first n even natural numbers that are raised to the fifth power.
	"""

def check(candidate):
    assert candidate(2) == 1056
    assert candidate(3) == 8832
    assert candidate(1) == 32

def test_check():
    check(even_Power_Sum)

test_check()


Prompt:
def number_of_substrings(str: str) -> int:
    """
	Write a python function to count the number of non-empty substrings of a given string.
	"""

def check(candidate):
    assert candidate('abc') == 6
    assert candidate('abcd') == 10
    assert candidate('abcde') == 15

def test_check():
    check(number_of_substrings)

test_check()


Prompt:
def sum_Of_product(n: int) -> int:
    """
	Write a python function to find the sum of the product of consecutive binomial co-efficients.
	"""

def check(candidate):
    assert candidate(3) == 15
    assert candidate(4) == 56
    assert candidate(1) == 1

def test_check():
    check(sum_Of_product)

test_check()


Prompt:
from typing import List

def is_samepatterns(colors: List[str], patterns: List[str]) -> bool:
    """
	Write a function to check whether it follows the sequence given in the patterns array.
	"""

def check(candidate):
    assert candidate(['red', 'green', 'green'], ['a', 'b', 'b']) == True
    assert candidate(['red', 'green', 'greenn'], ['a', 'b', 'b']) == False
    assert candidate(['red', 'green', 'greenn'], ['a', 'b']) == False

def test_check():
    check(is_samepatterns)

test_check()

assert is_samepatterns(['red', 'green', 'green'], ['a', 'b', 'b']) == True


Prompt:
from typing import List, Tuple

def max_Product(arr: List[int]) -> Tuple[int, int]:
    """
	Write a python function to find a pair with highest product from a given array of integers.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 7, 0, 8, 4]) == (7, 8)
    assert candidate([0, -1, -2, -4, 5, 0, -6]) == (-4, -6)
    assert candidate([1, 2, 3]) == (2, 3)

def test_check():
    check(max_Product)

test_check()


Prompt:
def count_divisors(n: int) -> bool:
    """
	Write a python function to check whether the count of divisors is even. https://www.w3resource.com/python-exercises/basic/python-basic-1-exercise-24.php
	"""

def check(candidate):
    assert candidate(10) == True
    assert candidate(100) == False
    assert candidate(125) == True

def test_check():
    check(count_divisors)

test_check()


Prompt:
def surfacearea_cube(l: int) -> int:
    """
	Write a function to find the surface area of a cube of a given size.
	"""

def check(candidate):
    assert candidate(5) == 150
    assert candidate(3) == 54
    assert candidate(10) == 600

def test_check():
    check(surfacearea_cube)

test_check()


Prompt:
def check_char(string: str) -> str:
    """
	Write a function to check whether the given string starts and ends with the same character or not.
	"""

def check(candidate):
    assert candidate('abba') == 'Valid'
    assert candidate('a') == 'Valid'
    assert candidate('abcd') == 'Invalid'

def test_check():
    check(check_char)

test_check()


Prompt:
from typing import List

def count_reverse_pairs(test_list: List[str]) -> int:
    """
	Write a function to count the pairs of reverse strings in the given string list. https://www.geeksforgeeks.org/python-program-to-count-the-pairs-of-reverse-strings/
	"""

def check(candidate):
    assert candidate(['julia', 'best', 'tseb', 'for', 'ailuj']) == 2
    assert candidate(['geeks', 'best', 'for', 'skeeg']) == 1
    assert candidate(['makes', 'best', 'sekam', 'for', 'rof']) == 2

def test_check():
    check(count_reverse_pairs)

test_check()

assert count_reverse_pairs(['julia', 'best', 'tseb', 'for', 'ailuj']) == 2


Prompt:
from typing import List, Tuple

def find_tuples(test_list: List[Tuple[int, int, int]], K: int) -> List[Tuple[int, int, int]]:
    """
	Write a function to find tuples which have all elements divisible by k from the given list of tuples.
	"""


Prompt:
from typing import Tuple

def tuple_str_int(test_str: str) -> Tuple[int, int, int]:
    """
	Write a function to convert tuple string to integer tuple.
	"""

def check(candidate):
    assert candidate('(7, 8, 9)') == (7, 8, 9)
    assert candidate('(1, 2, 3)') == (1, 2, 3)
    assert candidate('(4, 5, 6)') == (4, 5, 6)
    assert candidate('(7, 81, 19)') == (7, 81, 19)

def test_check():
    check(tuple_str_int)

test_check()


Prompt:
def count_vowels(test_str: str) -> int:
    """
	Write a function to count those characters which have vowels as their neighbors in the given string.
	"""

def check(candidate):
    assert candidate('bestinstareels') == 7
    assert candidate('partofthejourneyistheend') == 12
    assert candidate('amazonprime') == 5

def test_check():
    check(count_vowels)

test_check()

assert count_vowels('bestinstareels') == 7


Prompt:
from typing import Dict

def dict_filter(dict: Dict[str, int], n: int) -> Dict[str, int]:
    """
	Write a function that takes in a dictionary and integer n and filters the dictionary to only include entries with values greater than or equal to n.
	"""

def check(candidate):
    assert candidate({ 'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190 }, 170) == { 'Cierra Vega': 175, 'Alden Cantrell': 180, 'Pierre Cox': 190 }
    assert candidate({ 'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190 }, 180) == { 'Alden Cantrell': 180, 'Pierre Cox': 190 }
    assert candidate({ 'Cierra Vega': 175, 'Alden Cantrell': 180, 'Kierra Gentry': 165, 'Pierre Cox': 190 }, 190) == { 'Pierre Cox': 190 }

def test_check():
    check(dict_filter)

test_check()


Prompt:
from typing import List

def max_product(arr: List[int]) -> int:
    """
	Write a function to find the maximum product formed by multiplying numbers of an increasing subsequence of that array.
	"""

def check(candidate):
    assert candidate([3, 100, 4, 5, 150, 6]) == 3000
    assert candidate([4, 42, 55, 68, 80]) == 50265600
    assert candidate([10, 22, 9, 33, 21, 50, 41, 60]) == 2460

def test_check():
    check(max_product)

test_check()


Prompt:
def is_num_decagonal(n: int) -> int:
    """
	Write a function to find the nth decagonal number.
	"""

def check(candidate):
    assert candidate(3) == 27
    assert candidate(7) == 175
    assert candidate(10) == 370

def test_check():
    check(is_num_decagonal)

test_check()


Prompt:
def is_not_prime(n: int) -> bool:
    """
	Write a python function to identify non-prime numbers.
	"""

def check(candidate):
    assert candidate(2) == False
    assert candidate(10) == True
    assert candidate(35) == True
    assert candidate(37) == False

def test_check():
    check(is_not_prime)

test_check()


Prompt:
from typing import List, Dict

def freq_count(list1: List[int]) -> Dict[int, int]:
    """
	Write a function to get the frequency of all the elements in a list, returned as a dictionary.
	"""


Prompt:
from typing import List

def maximize_elements(test_tup1: List[List[int]], test_tup2: List[List[int]]) -> List[List[int]]:
    """
	Write a function to maximize the given two lists.
	"""


Prompt:
from typing import List, Dict

def empty_list(length: int) -> List[Dict[None, None]]:
    """
	Write a function to create a list of N empty dictionaries.
	"""

def check(candidate):
    assert candidate(5) == [{  }, {  }, {  }, {  }, {  }]
    assert candidate(6) == [{  }, {  }, {  }, {  }, {  }, {  }]
    assert candidate(7) == [{  }, {  }, {  }, {  }, {  }, {  }, {  }]

def test_check():
    check(empty_list)

test_check()


Prompt:
def text_match_two_three(text: str) -> bool:
    """
	Write a function that checks whether a string contains the 'a' character followed by two or three 'b' characters.
	"""

def check(candidate):
    assert candidate('ac') == False
    assert candidate('dc') == False
    assert candidate('abbbba') == True

def test_check():
    check(text_match_two_three)

test_check()

assert text_match_two_three('ac') == False


Prompt:
from typing import List

def maxAverageOfPath(cost: List[List[int]]) -> float:
    """
	Given a square matrix of size N*N given as a list of lists, where each cell is associated with a specific cost. A path is defined as a specific sequence of cells that starts from the top-left cell move only right or down and ends on bottom right cell. We want to find a path with the maximum average over all existing paths. Average is computed as total cost divided by the number of cells visited in the path.
	"""


Prompt:
def sum_in_range(l: int, r: int) -> int:
    """
	Write a python function to find the sum of all odd natural numbers within the range l and r.
	"""

def check(candidate):
    assert candidate(2, 5) == 8
    assert candidate(5, 7) == 12
    assert candidate(7, 13) == 40

def test_check():
    check(sum_in_range)

test_check()


Prompt:
from typing import List

def heap_queue_largest(nums: List[int], n: int) -> List[int]:
    """
	Write a function to find the n largest integers from a given list of numbers, returned in descending order.
	"""


Prompt:
from typing import List, Tuple

def max_product_tuple(list1: List[Tuple[int, int]]) -> int:
    """
	Write a function to find the maximum absolute product between numbers in pairs of tuples within a given list.
	"""


Prompt:
def replace_blank(str1: str, char: str) -> str:
    """
	Write a function that takes in a string and character, replaces blank spaces in the string with the character, and returns the string.
	"""

def check(candidate):
    assert candidate('hello people', '@') == 'hello@people'
    assert candidate('python program language', '$') == 'python$program$language'
    assert candidate('blank space', '-') == 'blank-space'

def test_check():
    check(replace_blank)

test_check()

assert replace_blank('hello people', '@') == 'hello@people'


Prompt:
def is_Even(n: int) -> bool:
    """
	Write a python function to check whether the given number is even or not.
	"""

def check(candidate):
    assert candidate(1) == False
    assert candidate(2) == True
    assert candidate(3) == False

def test_check():
    check(is_Even)

test_check()


Prompt:
from typing import Tuple

def find_adverb_position(text: str) -> Tuple[int, int, str]:
    """
	Write a function to find the first adverb and their positions in a given sentence.
	"""

def check(candidate):
    assert candidate('clearly!! we can see the sky') == (0, 7, 'clearly')
    assert candidate('seriously!! there are many roses') == (0, 9, 'seriously')
    assert candidate('unfortunately!! sita is going to home') == (0, 13, 'unfortunately')

def test_check():
    check(find_adverb_position)

test_check()

assert find_adverb_position('clearly!! we can see the sky') == (0, 7, 'clearly')


Prompt:
from typing import Optional, Tuple

def occurance_substring(text: str, pattern: str) -> Optional[Tuple[str, int, int]]:
    """
	Write a function to find the occurrence and position of the substrings within a string. Return None if there is no match.
	"""

def check(candidate):
    assert candidate('python programming, python language', 'python') == ('python', 0, 6)
    assert candidate('python programming,programming language', 'programming') == ('programming', 7, 18)
    assert candidate('python programming,programming language', 'language') == ('language', 31, 39)
    assert candidate('c++ programming, c++ language', 'python') == None

def test_check():
    check(occurance_substring)

test_check()

assert occurance_substring('python programming, python language', 'python') == ('python', 0, 6)


Prompt:
def get_total_number_of_sequences(m: int, n: int) -> int:
    """
	Write a function that takes in positive integers m and n and finds the number of possible sequences of length n, such that each element is a positive integer and is greater than or equal to twice the previous element but less than or equal to m.
	"""

def check(candidate):
    assert candidate(10, 4) == 4
    assert candidate(5, 2) == 6
    assert candidate(16, 3) == 84

def test_check():
    check(get_total_number_of_sequences)

test_check()

assert get_total_number_of_sequences(10, 4) == 4


Prompt:
from typing import List, Any

def list_split(S: List[Any], step: int) -> List[List[Any]]:
    """
	Write a function that takes in a list and an integer n and splits a list for every nth element, returning a list of the resulting lists.
	"""


Prompt:
from typing import List

def remove_odd(l: List[int]) -> List[int]:
    """
	Write a python function to remove odd numbers from a given list.
	"""

def check(candidate):
    assert candidate([1, 2, 3]) == [2]
    assert candidate([2, 4, 6]) == [2, 4, 6]
    assert candidate([10, 20, 3]) == [10, 20]

def test_check():
    check(remove_odd)

test_check()


Prompt:
from typing import List

def overlapping(list1: List[int], list2: List[int]) -> bool:
    """
	Write a python function to check whether any value in a sequence exists in a sequence or not.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5], [6, 7, 8, 9]) == False
    assert candidate([1, 2, 3], [4, 5, 6]) == False
    assert candidate([1, 4, 5], [1, 4, 5]) == True

def test_check():
    check(overlapping)

test_check()


Prompt:
from typing import Optional, Tuple

def find_solution(a: int, b: int, n: int) -> Optional[Tuple[int, int]]:
    """
	Write a function that returns integers x and y that satisfy ax + by = n as a tuple, or return None if no solution exists.
	"""

def check(candidate):
    assert candidate(2, 3, 7) == (2, 1)
    assert candidate(4, 2, 7) == None
    assert candidate(1, 13, 17) == (4, 1)

def test_check():
    check(find_solution)

test_check()


Prompt:
from typing import List

def max_sub_array_sum(a: List[int], size: int) -> int:
    """
	Write a function to find the sum of the largest contiguous sublist in the given list.
	"""


Prompt:
from typing import Tuple

def check_smaller(test_tup1: Tuple[int, int, int], test_tup2: Tuple[int, int, int]) -> bool:
    """
	Write a function to check if each element of second tuple is smaller than its corresponding element in the first tuple.
	"""

def check(candidate):
    assert candidate((1, 2, 3), (2, 3, 4)) == False
    assert candidate((4, 5, 6), (3, 4, 5)) == True
    assert candidate((11, 12, 13), (10, 11, 12)) == True

def test_check():
    check(check_smaller)

test_check()

assert check_smaller((1, 2, 3), (2, 3, 4)) == False


Prompt:
from typing import List

def Split(list: List[int]) -> List[int]:
    """
	Write a python function to find even numbers from a list of numbers.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5]) == [2, 4]
    assert candidate([4, 5, 6, 7, 8, 0, 1]) == [4, 6, 8, 0]
    assert candidate([8, 12, 15, 19]) == [8, 12]

def test_check():
    check(Split)

test_check()


Prompt:
from typing import List

def count_same_pair(nums1: List[int], nums2: List[int]) -> int:
    """
	The input is defined as two lists of the same length. Write a function to count indices where the lists have the same values.
	"""


Prompt:
def count_charac(str1: str) -> int:
    """
	Write a function to count the total number of characters in a string.
	"""

def check(candidate):
    assert candidate('python programming') == 18
    assert candidate('language') == 8
    assert candidate('words') == 5

def test_check():
    check(count_charac)

test_check()

assert count_charac('python programming') == 18


Prompt:
from typing import Tuple

def tuple_modulo(test_tup1: Tuple[int, int, int, int], test_tup2: Tuple[int, int, int, int]) -> Tuple[int, int, int, int]:
    """
	Write a function which takes two tuples of the same length and performs the element wise modulo.
	"""


Prompt:
def catalan_number(num: int) -> int:
    """
	Write a function which returns nth catalan number.
	"""

def check(candidate):
    assert candidate(10) == 16796
    assert candidate(9) == 4862
    assert candidate(7) == 429

def test_check():
    check(catalan_number)

test_check()


Prompt:
from typing import List

def magic_square_test(my_matrix: List[List[int]]) -> bool:
    """
	Write a function to calculate whether the matrix is a magic square.
	"""


Prompt:
def count_Substrings(s: str) -> int:
    """
	Write a python function to count the number of substrings with the sum of digits equal to their length.
	"""

def check(candidate):
    assert candidate('112112') == 6
    assert candidate('111') == 6
    assert candidate('1101112') == 12

def test_check():
    check(count_Substrings)

test_check()


Prompt:
def square_Sum(n: int) -> int:
    """
	Write a python function takes in an integer n and returns the sum of squares of first n even natural numbers.
	"""

def check(candidate):
    assert candidate(2) == 20
    assert candidate(3) == 56
    assert candidate(4) == 120

def test_check():
    check(square_Sum)

test_check()


Prompt:
def power(a: int, b: int) -> int:
    """
	Write a function to calculate the value of 'a' to the power 'b'.
	"""

def check(candidate):
    assert candidate(3, 4) == 81
    assert candidate(2, 3) == 8
    assert candidate(5, 5) == 3125

def test_check():
    check(power)

test_check()


Prompt:
from typing import Tuple

def find_literals(text: str, pattern: str) -> Tuple[str, int, int]:
    """
	Write a function to search a string for a regex pattern. The function should return the matching subtring, a start index and an end index.
	"""

def check(candidate):
    assert candidate('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)
    assert candidate('Its been a very crazy procedure right', 'crazy') == ('crazy', 16, 21)
    assert candidate('Hardest choices required strongest will', 'will') == ('will', 35, 39)

def test_check():
    check(find_literals)

test_check()

assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)


Prompt:
from typing import List, Tuple

def index_minimum(test_list: List[Tuple[str, int]]) -> str:
    """
	Given a list of tuples, write a function that returns the first value of the tuple with the smallest second value.
	"""

def check(candidate):
    assert candidate([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'
    assert candidate([('Yash', 185), ('Dawood', 125), ('Sanya', 175)]) == 'Dawood'
    assert candidate([('Sai', 345), ('Salman', 145), ('Ayesha', 96)]) == 'Ayesha'

def test_check():
    check(index_minimum)

test_check()

assert index_minimum([('Rash', 143), ('Manjeet', 200), ('Varsha', 100)]) == 'Varsha'


Prompt:
def is_Sum_Of_Powers_Of_Two(n: int) -> bool:
    """
	Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.
	"""

def check(candidate):
    assert candidate(10) == True
    assert candidate(7) == False
    assert candidate(14) == True

def test_check():
    check(is_Sum_Of_Powers_Of_Two)

test_check()

assert is_Sum_Of_Powers_Of_Two(10) == True


Prompt:
from typing import List

def diff_even_odd(list1: List[int]) -> int:
    """
	Write a function to find the difference of the first even and first odd number of a given list.
	"""

def check(candidate):
    assert candidate([1, 3, 5, 7, 4, 1, 6, 8]) == 3
    assert candidate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 1
    assert candidate([1, 5, 7, 9, 10]) == 9

def test_check():
    check(diff_even_odd)

test_check()


Prompt:
def even_binomial_Coeff_Sum(n: int) -> int:
    """
	Write a python function that takes in a positive integer n and finds the sum of even index binomial coefficients.
	"""

def check(candidate):
    assert candidate(4) == 8
    assert candidate(6) == 32
    assert candidate(2) == 2

def test_check():
    check(even_binomial_Coeff_Sum)

test_check()


Prompt:
def sum(a: int, b: int) -> int:
    """
	Write a python function to find the sum of common divisors of two given numbers.
	"""

def check(candidate):
    assert candidate(10, 15) == 6
    assert candidate(100, 150) == 93
    assert candidate(4, 6) == 3

def test_check():
    check(sum)

test_check()


Prompt:
from typing import List

def Diff(li1: List[int], li2: List[int]) -> List[int]:
    """
	Write a python function to get the difference between two lists.
	"""


Prompt:
from typing import Dict

def return_sum(dict: Dict[str, int]) -> int:
    """
	Write function to find the sum of all items in the given dictionary.
	"""

def check(candidate):
    assert candidate({ 'a': 100, 'b': 200, 'c': 300 }) == 600
    assert candidate({ 'a': 25, 'b': 18, 'c': 45 }) == 88
    assert candidate({ 'a': 36, 'b': 39, 'c': 49 }) == 124

def test_check():
    check(return_sum)

test_check()


Prompt:
def surfacearea_cylinder(r: int, h: int) -> float:
    """
	Write a function to find the surface area of a cylinder.
	"""

def check(candidate):
    assert candidate(10, 5) == 942.45
    assert candidate(4, 5) == 226.18800000000002
    assert candidate(4, 10) == 351.848

def test_check():
    check(surfacearea_cylinder)

test_check()

assert surfacearea_cylinder(10, 5) == 942.45


Prompt:
from typing import List

def rgb_to_hsv(r: int, g: int, b: int) -> List[float]:
    """
	Write a function to convert rgb color to hsv color. https://www.geeksforgeeks.org/program-change-rgb-color-model-hsv-color-model/
	"""


Prompt:
from typing import List

def get_equal(Input: List[List[int]]) -> bool:
    """
	Write a function to find whether all the given lists have equal length or not.
	"""

def check(candidate):
    assert candidate([[11, 22, 33], [44, 55, 66]]) == True
    assert candidate([[1, 2, 3], [4, 5, 6, 7]]) == False
    assert candidate([[1, 2], [3, 4]]) == True

def test_check():
    check(get_equal)

test_check()


Prompt:
def square_Sum(n: int) -> int:
    """
	Write a python function that takes in an integer n and returns the sum of the squares of the first n odd natural numbers.
	"""

def check(candidate):
    assert candidate(2) == 10
    assert candidate(3) == 35
    assert candidate(4) == 84

def test_check():
    check(square_Sum)

test_check()


Prompt:
def perimeter_pentagon(a: int) -> int:
    """
	Write a function to find the perimeter of a regular pentagon from the length of its sides.
	"""

def check(candidate):
    assert candidate(5) == 25
    assert candidate(10) == 50
    assert candidate(15) == 75

def test_check():
    check(perimeter_pentagon)

test_check()


Prompt:
from typing import Any

def check_type(test_tuple: Any) -> bool:
    """
	Write a function to check if all the elements in tuple have same data type or not.
	"""

def check(candidate):
    assert candidate((5, 6, 7, 3, 5, 6)) == True
    assert candidate((1, 2, '4')) == False
    assert candidate((3, 2, 1, 4, 5)) == True

def test_check():
    check(check_type)

test_check()

assert check_type((5, 6, 7, 3, 5, 6)) == True


Prompt:
def are_equivalent(num1: int, num2: int) -> bool:
    """
	Write a function to determine if the sum of the divisors of two integers are the same.
	"""

def check(candidate):
    assert candidate(36, 57) == False
    assert candidate(2, 4) == False
    assert candidate(23, 47) == True

def test_check():
    check(are_equivalent)

test_check()


Prompt:
def is_perfect_square(n: int) -> bool:
    """
	Write a function to check whether the given number is a perfect square or not. https://www.geeksforgeeks.org/check-if-given-number-is-perfect-square-in-cpp/
	"""

def check(candidate):
    assert candidate(10) == False
    assert candidate(36) == True
    assert candidate(14) == False
    assert candidate(196) == True
    assert candidate(125) == False
    assert candidate(15625) == True

def test_check():
    check(is_perfect_square)

test_check()


Prompt:
from typing import List, Tuple

def start_withp(words: List[str]) -> Tuple[str, str]:
    """
	Write a function to return two words from a list of words starting with letter 'p'.
	"""

def check(candidate):
    assert candidate(['Python PHP', 'Java JavaScript', 'c c++']) == ('Python', 'PHP')
    assert candidate(['Python Programming', 'Java Programming']) == ('Python', 'Programming')
    assert candidate(['Pqrst Pqr', 'qrstuv']) == ('Pqrst', 'Pqr')

def test_check():
    check(start_withp)

test_check()

assert start_withp(['Python PHP', 'Java JavaScript', 'c c++']) == ('Python', 'PHP')


Prompt:
from typing import Tuple

def min_Jumps(steps: Tuple[int, int], d: int) -> float:
    """
	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.
	"""

def check(candidate):
    assert candidate((3, 4), 11) == 3.5
    assert candidate((3, 4), 0) == 0
    assert candidate((11, 14), 11) == 1

def test_check():
    check(min_Jumps)

test_check()


Prompt:
from typing import List, Tuple

def list_to_float(test_list: List[Tuple[str, str]]) -> List[Tuple[float, float]]:
    """
	Write a function to convert all possible convertible elements in a list of lists to floats.
	"""


Prompt:
from typing import List, Any

def count_element_in_list(list1: List[List[Any]], x: Any) -> int:
    """
	Write a function to count the number of sublists containing a particular element.
	"""


Prompt:
def bell_number(n: int) -> int:
    """
	Write a function to find the number of ways to partition a set of Bell numbers.
	"""

def check(candidate):
    assert candidate(2) == 2
    assert candidate(10) == 115975
    assert candidate(56) == 6775685320645824322581483068371419745979053216268760300

def test_check():
    check(bell_number)

test_check()


Prompt:
def minimum(a: int, b: int) -> int:
    """
	Write a python function to find the minimum of two numbers.
	"""

def check(candidate):
    assert candidate(1, 2) == 1
    assert candidate(-5, -4) == -5
    assert candidate(0, 0) == 0

def test_check():
    check(minimum)

test_check()


Prompt:
def find_Volume(l: int, b: int, h: int) -> int:
    """
	Write a python function to find the volume of a triangular prism.
	"""

def check(candidate):
    assert candidate(10, 8, 6) == 240
    assert candidate(3, 2, 2) == 6
    assert candidate(1, 2, 1) == 1

def test_check():
    check(find_Volume)

test_check()


Prompt:
from typing import List

def square_nums(nums: List[int]) -> List[int]:
    """
	Write a function to find squares of individual elements in a list.
	"""


Prompt:
from typing import Dict, Tuple

def filter_data(students: Dict[str, Tuple[float, int]], h: float, w: int) -> Dict[str, Tuple[float, int]]:
    """
	The input is given as - a dictionary with a student name as a key and a tuple of float (student_height, student_weight) as a value, - minimal height, - minimal weight. Write a function to filter students that have height and weight above the minimum.
	"""

def check(candidate):
    assert candidate({ '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) }
    assert candidate({ 'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66) }, 5.9, 67) == { 'Cierra Vega': (6.2, 70), 'Kierra Gentry': (6.0, 68) }
    assert candidate({ 'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66) }, 5.7, 64) == { 'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66) }

def test_check():
    check(filter_data)

test_check()


Prompt:
def next_Perfect_Square(N: int) -> int:
    """
	Write a python function to find the next perfect square greater than a given number.
	"""

def check(candidate):
    assert candidate(35) == 36
    assert candidate(6) == 9
    assert candidate(9) == 16

def test_check():
    check(next_Perfect_Square)

test_check()


Prompt:
from typing import List, Union, Optional

def second_smallest(numbers: List[Union[int, float]]) -> Optional[float]:
    """
	Write a function to find the second smallest number in a list.
	"""

def check(candidate):
    assert candidate([1, 2, -8, -2, 0, -2]) == -2
    assert candidate([1, 1, -0.5, 0, 2, -2, -2]) == -0.5
    assert candidate([2, 2]) == None
    assert candidate([2, 2, 2]) == None

def test_check():
    check(second_smallest)

test_check()


Prompt:
from typing import List, Union, Any

def check_tuplex(tuplex: List[Union[str, int]], tuple1: Any) -> bool:
    """
	Write a function to check whether an element exists within a tuple.
	"""

def check(candidate):
    assert candidate(['w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'], 'r') == True
    assert candidate(['w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'], '5') == False
    assert candidate(['w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e'], 3) == True

def test_check():
    check(check_tuplex)

test_check()


Prompt:
def find(n: int, m: int) -> int:
    """
	Write a python function to find quotient of two numbers (rounded down to the nearest integer).
	"""

def check(candidate):
    assert candidate(10, 3) == 3
    assert candidate(4, 2) == 2
    assert candidate(20, 5) == 4

def test_check():
    check(find)

test_check()


Prompt:
from typing import List

def get_ludic(n: int) -> List[int]:
    """
	Write a function to get all lucid numbers smaller than or equal to a given integer.
	"""


Prompt:
from typing import List

def sum_Of_Subarray_Prod(arr: List[int]) -> int:
    """
	Write a python function to find sum of products of all possible sublists of a given list. https://www.geeksforgeeks.org/sum-of-products-of-all-possible-subarrays/
	"""

def check(candidate):
    assert candidate([1, 2, 3]) == 20
    assert candidate([1, 2]) == 5
    assert candidate([1, 2, 3, 4]) == 84

def test_check():
    check(sum_Of_Subarray_Prod)

test_check()

assert sum_Of_Subarray_Prod([1, 2, 3]) == 20


Prompt:
from typing import List

def extract_values(text: str) -> List[str]:
    """
	Write a function to extract values between quotation marks from a string.
	"""

def check(candidate):
    assert candidate('"Python", "PHP", "Java"') == ['Python', 'PHP', 'Java']
    assert candidate('"python","program","language"') == ['python', 'program', 'language']
    assert candidate('"red","blue","green","yellow"') == ['red', 'blue', 'green', 'yellow']

def test_check():
    check(extract_values)

test_check()

assert extract_values('"Python", "PHP", "Java"') == ['Python', 'PHP', 'Java']


Prompt:
from typing import List

def issort_list(list1: List[int]) -> bool:
    """
	Write a function to check whether a specified list is sorted or not.
	"""

def check(candidate):
    assert candidate([1, 2, 4, 6, 8, 10, 12, 14, 16, 17]) == True
    assert candidate([1, 2, 4, 6, 8, 10, 12, 14, 20, 17]) == False
    assert candidate([1, 2, 4, 6, 8, 10, 15, 14, 20]) == False

def test_check():
    check(issort_list)

test_check()


Prompt:
from typing import Dict, List, Tuple

def sort_counter(dict1: Dict[str, int]) -> List[Tuple[str, int]]:
    """
	Write a function to sort a dictionary by value.
	"""

def check(candidate):
    assert candidate({ 'Math': 81, 'Physics': 83, 'Chemistry': 87 }) == [('Chemistry', 87), ('Physics', 83), ('Math', 81)]
    assert candidate({ 'Math': 400, 'Physics': 300, 'Chemistry': 250 }) == [('Math', 400), ('Physics', 300), ('Chemistry', 250)]
    assert candidate({ 'Math': 900, 'Physics': 1000, 'Chemistry': 1250 }) == [('Chemistry', 1250), ('Physics', 1000), ('Math', 900)]

def test_check():
    check(sort_counter)

test_check()

assert sort_counter({ 'Math': 81, 'Physics': 83, 'Chemistry': 87 }) == [('Chemistry', 87), ('Physics', 83), ('Math', 81)]


Prompt:
from typing import List, Union

def recursive_list_sum(data_list: List[Union[int, List[int]]]) -> int:
    """
	Write a function to flatten a list and sum all of its elements.
	"""

def check(candidate):
    assert candidate([1, 2, [3, 4], [5, 6]]) == 21
    assert candidate([7, 10, [15, 14], [19, 41]]) == 106
    assert candidate([10, 20, [30, 40], [50, 60]]) == 210

def test_check():
    check(recursive_list_sum)

test_check()


Prompt:
from typing import List

def union_elements(test_tup1: List[int], test_tup2: List[int]) -> List[int]:
    """
	Write a function to find the union of the elements of two given lists and output them in sorted order.
	"""


Prompt:
def check_str(string: str) -> bool:
    """
	Write a function to check whether the given string is starting with a vowel or not using regex.
	"""

def check(candidate):
    assert candidate('annie') == True
    assert candidate('dawood') == False
    assert candidate('Else') == True

def test_check():
    check(check_str)

test_check()


Prompt:
from typing import Optional

def triangle_area(r: int) -> Optional[int]:
    """
	Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius.
	"""

def check(candidate):
    assert candidate(-1) == None
    assert candidate(0) == 0
    assert candidate(2) == 4

def test_check():
    check(triangle_area)

test_check()


Prompt:
from typing import List, Union

def count_integer(list1: List[Union[int, str, float]]) -> int:
    """
	Write a python function that returns the number of integer elements in a given list.
	"""

def check(candidate):
    assert candidate([1, 2, 'abc', 1.2]) == 2
    assert candidate([1, 2, 3]) == 3
    assert candidate([1, 1.2, 4, 5.1]) == 2

def test_check():
    check(count_integer)

test_check()

assert count_integer([1, 2, 'abc', 1.2]) == 2


Prompt:
from typing import List

def max_subarray_product(arr: List[int]) -> int:
    """
	Write a function to find the maximum product subarray of the given array.
	"""

def check(candidate):
    assert candidate([1, -2, -3, 0, 7, -8, -2]) == 112
    assert candidate([6, -3, -10, 0, 2]) == 180
    assert candidate([-2, -40, 0, -2, -3]) == 80

def test_check():
    check(max_subarray_product)

test_check()


Prompt:
from typing import List

def is_majority(arr: List[int], n: int, x: int) -> bool:
    """
	Write a function that takes in a sorted array, its length (n), and an element and returns whether the element is the majority element in the given sorted array. (The majority element is the element that occurs more than n/2 times.)
	"""

def check(candidate):
    assert candidate([1, 2, 3, 3, 3, 3, 10], 7, 3) == True
    assert candidate([1, 1, 2, 4, 4, 4, 6, 6], 8, 4) == False
    assert candidate([1, 1, 1, 2, 2], 5, 1) == True
    assert candidate([1, 1, 2, 2], 5, 1) == False

def test_check():
    check(is_majority)

test_check()


Prompt:
def text_starta_endb(text: str) -> bool:
    """
	Write a function that matches a string that has an 'a' followed by anything, ending in 'b'.
	"""

def check(candidate):
    assert candidate('aabbbb') == True
    assert candidate('aabAbbbc') == False
    assert candidate('accddbbjjj') == False

def test_check():
    check(text_starta_endb)

test_check()

assert text_starta_endb('aabbbb') == True


Prompt:
def word_len(s: str) -> bool:
    """
	Write a python function to check whether the length of the word is odd or not.
	"""

def check(candidate):
    assert candidate('Hadoop') == False
    assert candidate('great') == True
    assert candidate('structure') == True

def test_check():
    check(word_len)

test_check()


Prompt:
from typing import List, Any

def add_string(list_: List[Any], string: str) -> List[str]:
    """
	Write a function to apply a given format string to all of the elements in a list.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4], 'temp{0}') == ['temp1', 'temp2', 'temp3', 'temp4']
    assert candidate(['a', 'b', 'c', 'd'], 'python{0}') == ['pythona', 'pythonb', 'pythonc', 'pythond']
    assert candidate([5, 6, 7, 8], 'string{0}') == ['string5', 'string6', 'string7', 'string8']

def test_check():
    check(add_string)

test_check()


Prompt:
def all_Characters_Same(s: str) -> bool:
    """
	Write a python function to check whether all the characters are same or not.
	"""

def check(candidate):
    assert candidate('python') == False
    assert candidate('aaa') == True
    assert candidate('data') == False

def test_check():
    check(all_Characters_Same)

test_check()

assert all_Characters_Same('python') == False


Prompt:
from typing import List

def odd_position(nums: List[int]) -> bool:
    """
	Write a python function to check whether every odd index contains odd numbers of a given list.
	"""

def check(candidate):
    assert candidate([2, 1, 4, 3, 6, 7, 6, 3]) == True
    assert candidate([4, 1, 2]) == True
    assert candidate([1, 2, 3]) == False

def test_check():
    check(odd_position)

test_check()


Prompt:
from typing import List

def reverse_Array_Upto_K(input: List[int], k: int) -> List[int]:
    """
	Write a python function to reverse an array upto a given position.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5, 6], 4) == [4, 3, 2, 1, 5, 6]
    assert candidate([4, 5, 6, 7], 2) == [5, 4, 6, 7]
    assert candidate([9, 8, 7, 6, 5], 3) == [7, 8, 9, 6, 5]

def test_check():
    check(reverse_Array_Upto_K)

test_check()


Prompt:
from typing import List

def big_diff(nums: List[int]) -> int:
    """
	Write a python function to find the difference between largest and smallest value in a given list.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4]) == 3
    assert candidate([4, 5, 12]) == 8
    assert candidate([9, 2, 3]) == 7

def test_check():
    check(big_diff)

test_check()


Prompt:
from typing import List, Union

def flatten_list(list1: List[Union[int, List[int]]]) -> List[int]:
    """
	Write a function to flatten a given nested list structure.
	"""


Prompt:
from typing import List

def index_multiplication(test_tup1: List[List[int]], test_tup2: List[List[int]]) -> List[List[int]]:
    """
	Write a function to perform index wise multiplication of list elements in the given two lists.
	"""


Prompt:
def count_Primes_nums(n: int) -> int:
    """
	Write a python function that takes in a non-negative number and returns the number of prime numbers less than the given non-negative number.
	"""

def check(candidate):
    assert candidate(5) == 2
    assert candidate(10) == 4
    assert candidate(100) == 25

def test_check():
    check(count_Primes_nums)

test_check()


Prompt:
from typing import List

def sum_range_list(list1: List[int], m: int, n: int) -> int:
    """
	Write a function to find the sum of numbers in a list within a range specified by two indices.
	"""


Prompt:
from typing import List

def comb_sort(nums: List[int]) -> List[int]:
    """
	Write a function to sort a list of elements.
	"""


Prompt:
def remove_whitespaces(text1: str) -> str:
    """
	Write a function to remove all whitespaces from the given string.
	"""

def check(candidate):
    assert candidate(' Google    Flutter ') == 'GoogleFlutter'
    assert candidate(' Google    Dart ') == 'GoogleDart'
    assert candidate(' iOS    Swift ') == 'iOSSwift'

def test_check():
    check(remove_whitespaces)

test_check()

assert remove_whitespaces(' Google    Flutter ') == 'GoogleFlutter'


Prompt:
def lcs_of_three(X: str, Y: str, Z: str) -> int:
    """
	Write a function to find the longest common subsequence for the given three string sequence. https://www.geeksforgeeks.org/lcs-longest-common-subsequence-three-strings/
	"""

def check(candidate):
    assert candidate('AGGT12', '12TXAYB', '12XBA') == 2
    assert candidate('Reels', 'Reelsfor', 'ReelsforReels') == 5
    assert candidate('abcd1e2', 'bc12ea', 'bd1ea') == 3

def test_check():
    check(lcs_of_three)

test_check()

assert lcs_of_three('AGGT12', '12TXAYB', '12XBA') == 2


Prompt:
from typing import List

def swap_numbers(a: int, b: int) -> List[int]:
    """
	Write a function that takes in two numbers and returns a list with the second number and then the first number.
	"""

def check(candidate):
    assert candidate(10, 20) == [20, 10]
    assert candidate(15, 17) == [17, 15]
    assert candidate(100, 200) == [200, 100]

def test_check():
    check(swap_numbers)

test_check()


Prompt:
from typing import List, Tuple

def subject_marks(subjectmarks: List[Tuple[str, int]]) -> List[Tuple[str, int]]:
    """
	Write a function to sort a list of tuples using the second value of each tuple.
	"""

def check(candidate):
    assert candidate([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)]) == [('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]
    assert candidate([('Telugu', 49), ('Hindhi', 54), ('Social', 33)]) == [('Social', 33), ('Telugu', 49), ('Hindhi', 54)]
    assert candidate([('Physics', 96), ('Chemistry', 97), ('Biology', 45)]) == [('Biology', 45), ('Physics', 96), ('Chemistry', 97)]

def test_check():
    check(subject_marks)

test_check()

assert subject_marks([('English', 88), ('Science', 90), ('Maths', 97), ('Social sciences', 82)]) == [('Social sciences', 82), ('English', 88), ('Science', 90), ('Maths', 97)]


Prompt:
from typing import Tuple

def tuple_to_int(nums: Tuple[int, int, int]) -> int:
    """
	Write a function to convert a given tuple of positive integers into a single integer.
	"""

def check(candidate):
    assert candidate((1, 2, 3)) == 123
    assert candidate((4, 5, 6)) == 456
    assert candidate((5, 6, 7)) == 567

def test_check():
    check(tuple_to_int)

test_check()


Prompt:
def first_Digit(n: int) -> int:
    """
	Write a python function to find the first digit of a given number.
	"""

def check(candidate):
    assert candidate(123) == 1
    assert candidate(456) == 4
    assert candidate(12) == 1

def test_check():
    check(first_Digit)

test_check()


Prompt:
from typing import List

def string_to_list(string: str) -> List[str]:
    """
	Write a function to convert a string to a list of strings split on the space character.
	"""

def check(candidate):
    assert candidate('python programming') == ['python', 'programming']
    assert candidate('lists tuples strings') == ['lists', 'tuples', 'strings']
    assert candidate('write a program') == ['write', 'a', 'program']

def test_check():
    check(string_to_list)

test_check()

assert string_to_list('python programming') == ['python', 'programming']


Prompt:
from typing import List

def find_min_diff(arr: List[int], n: int) -> int:
    """
	Write a python function to find the minimum difference between any two elements in a given array. https://www.geeksforgeeks.org/find-minimum-difference-pair/
	"""

def check(candidate):
    assert candidate([1, 5, 3, 19, 18, 25], 6) == 1
    assert candidate([4, 3, 2, 6], 4) == 1
    assert candidate([30, 5, 20, 9], 4) == 4

def test_check():
    check(find_min_diff)

test_check()


Prompt:
from typing import List

def k_smallest_pairs(nums1: List[int], nums2: List[int], k: int) -> List[List[int]]:
    """
	Write a function to find k number of smallest pairs which consist of one element from the first array and one element from the second array.
	"""


Prompt:
def capital_words_spaces(str1: str) -> str:
    """
	Write a function to put spaces between words starting with capital letters in a given string.
	"""

def check(candidate):
    assert candidate('Python') == 'Python'
    assert candidate('PythonProgrammingExamples') == 'Python Programming Examples'
    assert candidate('GetReadyToBeCodingFreak') == 'Get Ready To Be Coding Freak'

def test_check():
    check(capital_words_spaces)

test_check()

assert capital_words_spaces('Python') == 'Python'


Prompt:
from typing import Tuple

def convert(numbers: int) -> Tuple[float, float]:
    """
	Write a python function to convert complex numbers to polar coordinates.
	"""

def check(candidate):
    assert candidate(1) == (1.0, 0.0)
    assert candidate(4) == (4.0, 0.0)
    assert candidate(5) == (5.0, 0.0)

def test_check():
    check(convert)

test_check()


Prompt:
from typing import List

def neg_nos(list1: List[int]) -> List[int]:
    """
	Write a python function to return the negative numbers in a list.
	"""

def check(candidate):
    assert candidate([-1, 4, 5, -6]) == [-1, -6]
    assert candidate([-1, -2, 3, 4]) == [-1, -2]
    assert candidate([-7, -6, 8, 9]) == [-7, -6]

def test_check():
    check(neg_nos)

test_check()


Prompt:
def median_numbers(a: int, b: int, c: int) -> float:
    """
	Write a function to find the median of three numbers.
	"""

def check(candidate):
    assert candidate(25, 55, 65) == 55.0
    assert candidate(20, 10, 30) == 20.0
    assert candidate(15, 45, 75) == 45.0

def test_check():
    check(median_numbers)

test_check()

assert median_numbers(25, 55, 65) == 55.0


Prompt:
from typing import List, Union

def combinations_list(list1: List[str]) -> List[Union[List[None], List[str]]]:
    """
	Write a function to find all possible combinations of the elements of a given list.
	"""

def check(candidate):
    assert candidate(['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']]
    assert candidate(['red', 'green', 'blue', 'white', 'black', 'orange']) == [[], ['red'], ['green'], ['green', 'red'], ['blue'], ['blue', 'red'], ['blue', 'green'], ['blue', 'green', 'red'], ['white'], ['white', 'red'], ['white', 'green'], ['white', 'green', 'red'], ['white', 'blue'], ['white', 'blue', 'red'], ['white', 'blue', 'green'], ['white', 'blue', 'green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['black', 'blue'], ['black', 'blue', 'red'], ['black', 'blue', 'green'], ['black', 'blue', 'green', 'red'], ['black', 'white'], ['black', 'white', 'red'], ['black', 'white', 'green'], ['black', 'white', 'green', 'red'], ['black', 'white', 'blue'], ['black', 'white', 'blue', 'red'], ['black', 'white', 'blue', 'green'], ['black', 'white', 'blue', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'blue'], ['orange', 'blue', 'red'], ['orange', 'blue', 'green'], ['orange', 'blue', 'green', 'red'], ['orange', 'white'], ['orange', 'white', 'red'], ['orange', 'white', 'green'], ['orange', 'white', 'green', 'red'], ['orange', 'white', 'blue'], ['orange', 'white', 'blue', 'red'], ['orange', 'white', 'blue', 'green'], ['orange', 'white', 'blue', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red'], ['orange', 'black', 'blue'], ['orange', 'black', 'blue', 'red'], ['orange', 'black', 'blue', 'green'], ['orange', 'black', 'blue', 'green', 'red'], ['orange', 'black', 'white'], ['orange', 'black', 'white', 'red'], ['orange', 'black', 'white', 'green'], ['orange', 'black', 'white', 'green', 'red'], ['orange', 'black', 'white', 'blue'], ['orange', 'black', 'white', 'blue', 'red'], ['orange', 'black', 'white', 'blue', 'green'], ['orange', 'black', 'white', 'blue', 'green', 'red']]
    assert candidate(['red', 'green', 'black', 'orange']) == [[], ['red'], ['green'], ['green', 'red'], ['black'], ['black', 'red'], ['black', 'green'], ['black', 'green', 'red'], ['orange'], ['orange', 'red'], ['orange', 'green'], ['orange', 'green', 'red'], ['orange', 'black'], ['orange', 'black', 'red'], ['orange', 'black', 'green'], ['orange', 'black', 'green', 'red']]

def test_check():
    check(combinations_list)

test_check()

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']]


Prompt:
from typing import List

def divisible_by_digits(startnum: int, endnum: int) -> List[int]:
    """
	Write a function to find numbers within a given range from startnum ti endnum where every number is divisible by every digit it contains. https://www.w3resource.com/python-exercises/lambda/python-lambda-exercise-24.php
	"""

def check(candidate):
    assert candidate(1, 22) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22]
    assert candidate(1, 15) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15]
    assert candidate(20, 25) == [22, 24]

def test_check():
    check(divisible_by_digits)

test_check()


Prompt:
from typing import List

def Split(list: List[int]) -> List[int]:
    """
	Write a python function which takes a list of integers and only returns the odd ones.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5, 6]) == [1, 3, 5]
    assert candidate([10, 11, 12, 13]) == [11, 13]
    assert candidate([7, 8, 9, 1]) == [7, 9, 1]

def test_check():
    check(Split)

test_check()


Prompt:
from typing import List

def long_words(n: int, str: str) -> List[str]:
    """
	Write a function to find words that are longer than n characters from a given list of words.
	"""

def check(candidate):
    assert candidate(3, 'python is a programming language') == ['python', 'programming', 'language']
    assert candidate(2, 'writing a program') == ['writing', 'program']
    assert candidate(5, 'sorting list') == ['sorting']

def test_check():
    check(long_words)

test_check()

assert long_words(3, 'python is a programming language') == ['python', 'programming', 'language']


Prompt:
from typing import List

def is_sublist(l: List[int], s: List[int]) -> bool:
    """
	Write a function to check whether a list contains the given sublist or not.
	"""

def check(candidate):
    assert candidate([2, 4, 3, 5, 7], [3, 7]) == False
    assert candidate([2, 4, 3, 5, 7], [4, 3]) == True
    assert candidate([2, 4, 3, 5, 7], [1, 6]) == False

def test_check():
    check(is_sublist)

test_check()


Prompt:
from typing import List, Any, Optional

def common_element(list1: List[Any], list2: List[Any]) -> Optional[bool]:
    """
	Write a function that takes two lists and returns true if they have at least one common element.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5], [5, 6, 7, 8, 9]) == True
    assert candidate([1, 2, 3, 4, 5], [6, 7, 8, 9]) == None
    assert candidate(['a', 'b', 'c'], ['d', 'b', 'e']) == True

def test_check():
    check(common_element)

test_check()


Prompt:
def replace_specialchar(text: str) -> str:
    """
	Write a function to replace all occurrences of spaces, commas, or dots with a colon.
	"""

def check(candidate):
    assert candidate('Python language, Programming language.') == 'Python:language::Programming:language:'
    assert candidate('a b c,d e f') == 'a:b:c:d:e:f'
    assert candidate('ram reshma,ram rahim') == 'ram:reshma:ram:rahim'

def test_check():
    check(replace_specialchar)

test_check()

assert replace_specialchar('Python language, Programming language.') == 'Python:language::Programming:language:'


Prompt:
from typing import List

def pancake_sort(nums: List[int]) -> List[int]:
    """
	Write a function to sort a list of elements.
	"""


Prompt:
from typing import List

def large_product(nums1: List[int], nums2: List[int], N: int) -> List[int]:
    """
	Write a function to find the specified number of largest products from two given lists, selecting one factor from each list.
	"""


Prompt:
def otherside_rightangle(w: int, h: int) -> float:
    """
	Write a function to find the third side of a right angled triangle.
	"""

def check(candidate):
    assert candidate(7, 8) == 10.63014581273465
    assert candidate(3, 4) == 5
    assert candidate(7, 15) == 16.55294535724685

def test_check():
    check(otherside_rightangle)

test_check()

assert otherside_rightangle(7, 8) == 10.63014581273465


Prompt:
from typing import List, Tuple

def add_lists(test_list: List[int], test_tup: Tuple[int, int]) -> Tuple[int, int, int, int, int]:
    """
	Write a function to append the given list to the given tuples.
	"""


Prompt:
from typing import Tuple, Dict

def add_dict_to_tuple(test_tup: Tuple[int, int, int], test_dict: Dict[str, int]) -> Tuple[int, int, int, Dict[str, int]]:
    """
	Write a function to add a dictionary to the tuple. The output should be a tuple.
	"""


Prompt:
from typing import Optional

def first_non_repeating_character(str1: str) -> Optional[str]:
    """
	Write a python function to find the first non-repeated character in a given string.
	"""

def check(candidate):
    assert candidate('abcabc') == None
    assert candidate('abc') == 'a'
    assert candidate('ababc') == 'c'

def test_check():
    check(first_non_repeating_character)

test_check()

assert first_non_repeating_character('abcabc') == None


Prompt:
from typing import List, Any

def Find_Min(lst: List[List[Any]]) -> List[Any]:
    """
	Write a python function to find the sublist having minimum length.
	"""


Prompt:
from typing import List, Any

def extract_quotation(text1: str) -> List[Any]:
    """
	Write a function to extract values between quotation marks " " of the given string.
	"""

def check(candidate):
    assert candidate('Cortex "A53" Based "multi" tasking "Processor"') == ['A53', 'multi', 'Processor']
    assert candidate('Cast your "favorite" entertainment "apps"') == ['favorite', 'apps']
    assert candidate('Watch content "4k Ultra HD" resolution with "HDR 10" Support') == ['4k Ultra HD', 'HDR 10']
    assert candidate("Watch content '4k Ultra HD' resolution with 'HDR 10' Support") == []

def test_check():
    check(extract_quotation)

test_check()

assert extract_quotation('Cortex "A53" Based "multi" tasking "Processor"') == ['A53', 'multi', 'Processor']


Prompt:
def find_Rotations(str: str) -> int:
    """
	Write a python function to find the minimum number of rotations (greater than 0) required to get the same string.
	"""

def check(candidate):
    assert candidate('aaaa') == 1
    assert candidate('ab') == 2
    assert candidate('abc') == 3

def test_check():
    check(find_Rotations)

test_check()


Prompt:
from typing import List

def count_list(input_list: List[List[int]]) -> int:
    """
	Write a python function to count the number of lists in a given number of lists.
	"""

def check(candidate):
    assert candidate([[1, 3], [5, 7], [9, 11], [13, 15, 17]]) == 4
    assert candidate([[1, 2], [2, 3], [4, 5]]) == 3
    assert candidate([[1, 0], [2, 0]]) == 2

def test_check():
    check(count_list)

test_check()


Prompt:
def is_lower(string: str) -> str:
    """
	Write a python function to convert the given string to lower case.
	"""

def check(candidate):
    assert candidate('InValid') == 'invalid'
    assert candidate('TruE') == 'true'
    assert candidate('SenTenCE') == 'sentence'

def test_check():
    check(is_lower)

test_check()


Prompt:
def find_Average_Of_Cube(n: int) -> float:
    """
	Write a python function to find the average of cubes of first n natural numbers.
	"""

def check(candidate):
    assert candidate(2) == 4.5
    assert candidate(3) == 12
    assert candidate(1) == 1

def test_check():
    check(find_Average_Of_Cube)

test_check()


Prompt:
def noprofit_noloss(actual_cost: int, sale_amount: int) -> bool:
    """
	Write a function to check whether the given amount has no profit and no loss
	"""

def check(candidate):
    assert candidate(1500, 1200) == False
    assert candidate(100, 100) == True
    assert candidate(2000, 5000) == False

def test_check():
    check(noprofit_noloss)

test_check()

assert noprofit_noloss(1500, 1200) == False


Prompt:
def toggle_string(string: str) -> str:
    """
	Write a function to toggle the case of all characters in a string.
	"""

def check(candidate):
    assert candidate('Python') == 'pYTHON'
    assert candidate('Pangram') == 'pANGRAM'
    assert candidate('LIttLE') == 'liTTle'

def test_check():
    check(toggle_string)

test_check()

assert toggle_string('Python') == 'pYTHON'


Prompt:
from typing import List

def right_insertion(a: List[int], x: int) -> int:
    """
	Write a function to locate the right insertion point for a specified value in sorted order.
	"""

def check(candidate):
    assert candidate([1, 2, 4, 5], 6) == 4
    assert candidate([1, 2, 4, 5], 3) == 2
    assert candidate([1, 2, 4, 5], 7) == 4

def test_check():
    check(right_insertion)

test_check()

assert right_insertion([1, 2, 4, 5], 6) == 4


Prompt:
from typing import List

def first_odd(nums: List[int]) -> int:
    """
	Write a python function to find the first odd number in a given list of numbers.
	"""

def check(candidate):
    assert candidate([1, 3, 5]) == 1
    assert candidate([2, 4, 1, 3]) == 1
    assert candidate([8, 9, 1]) == 9

def test_check():
    check(first_odd)

test_check()


Prompt:
def replace_spaces(text: str) -> str:
    """
	Write a function to replace whitespaces with an underscore and vice versa in a given string.
	"""

def check(candidate):
    assert candidate('Jumanji The Jungle') == 'Jumanji_The_Jungle'
    assert candidate('The_Avengers') == 'The Avengers'
    assert candidate('Fast and Furious') == 'Fast_and_Furious'

def test_check():
    check(replace_spaces)

test_check()

assert replace_spaces('Jumanji The Jungle') == 'Jumanji_The_Jungle'


Prompt:
from typing import List

def unique_product(list_data: List[int]) -> int:
    """
	Write a python function to calculate the product of the unique numbers in a given list.
	"""

def check(candidate):
    assert candidate([10, 20, 30, 40, 20, 50, 60, 40]) == 720000000
    assert candidate([1, 2, 3, 1]) == 6
    assert candidate([7, 8, 9, 0, 1, 1]) == 0

def test_check():
    check(unique_product)

test_check()


Prompt:
def text_match_wordz_middle(text: str) -> bool:
    """
	Write a function that checks if a strings contains 'z', except at the start and end of the word.
	"""

def check(candidate):
    assert candidate('pythonzabc.') == True
    assert candidate('zxyabc.') == False
    assert candidate('  lang  .') == False

def test_check():
    check(text_match_wordz_middle)

test_check()

assert text_match_wordz_middle('pythonzabc.') == True


Prompt:
from typing import List, Tuple

def max_aggregate(stdata: List[Tuple[str, int]]) -> Tuple[str, int]:
    """
	Write a function to calculate the maximum aggregate from the list of tuples.
	"""

def check(candidate):
    assert candidate([('Juan Whelan', 90), ('Sabah Colley', 88), ('Peter Nichols', 7), ('Juan Whelan', 122), ('Sabah Colley', 84)]) == ('Juan Whelan', 212)
    assert candidate([('Juan Whelan', 50), ('Sabah Colley', 48), ('Peter Nichols', 37), ('Juan Whelan', 22), ('Sabah Colley', 14)]) == ('Juan Whelan', 72)
    assert candidate([('Juan Whelan', 10), ('Sabah Colley', 20), ('Peter Nichols', 30), ('Juan Whelan', 40), ('Sabah Colley', 50)]) == ('Sabah Colley', 70)

def test_check():
    check(max_aggregate)

test_check()

assert max_aggregate([('Juan Whelan', 90), ('Sabah Colley', 88), ('Peter Nichols', 7), ('Juan Whelan', 122), ('Sabah Colley', 84)]) == ('Juan Whelan', 212)


Prompt:
def replace_char(str1: str, ch: str, newch: str) -> str:
    """
	Write a function to replace characters in a string.
	"""

def check(candidate):
    assert candidate('polygon', 'y', 'l') == 'pollgon'
    assert candidate('character', 'c', 'a') == 'aharaater'
    assert candidate('python', 'l', 'a') == 'python'

def test_check():
    check(replace_char)

test_check()

assert replace_char('polygon', 'y', 'l') == 'pollgon'


Prompt:
from typing import List

def check_greater(arr: List[int], number: int) -> bool:
    """
	Write a function to check whether the entered number is greater than the elements of the given array.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5], 4) == False
    assert candidate([2, 3, 4, 5, 6], 8) == True
    assert candidate([9, 7, 4, 8, 6, 1], 11) == True

def test_check():
    check(check_greater)

test_check()

assert check_greater([1, 2, 3, 4, 5], 4) == False


Prompt:
def change_date_format(dt: str) -> str:
    """
	Write a function to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.
	"""

def check(candidate):
    assert candidate('2026-01-02') == '02-01-2026'
    assert candidate('2020-11-13') == '13-11-2020'
    assert candidate('2021-04-26') == '26-04-2021'

def test_check():
    check(change_date_format)

test_check()


Prompt:
from typing import List

def positive_count(nums: List[int]) -> float:
    """
	Write a function to find the ration of positive numbers in an array of integers.
	"""


Prompt:
def sumofFactors(n: int) -> int:
    """
	Write a python function to find the sum of even factors of a number.
	"""

def check(candidate):
    assert candidate(18) == 26
    assert candidate(30) == 48
    assert candidate(6) == 8

def test_check():
    check(sumofFactors)

test_check()


Prompt:
def remove_lowercase(str1: str) -> str:
    """
	Write a function to remove lowercase substrings from a given string.
	"""

def check(candidate):
    assert candidate('PYTHon') == 'PYTH'
    assert candidate('FInD') == 'FID'
    assert candidate('STRinG') == 'STRG'

def test_check():
    check(remove_lowercase)

test_check()

assert remove_lowercase('PYTHon') == 'PYTH'


Prompt:
def remove_dirty_chars(string: str, second_string: str) -> str:
    """
	Write a function to remove characters from the first string which are present in the second string.
	"""

def check(candidate):
    assert candidate('probasscurve', 'pros') == 'bacuve'
    assert candidate('digitalindia', 'talent') == 'digiidi'
    assert candidate('exoticmiles', 'toxic') == 'emles'

def test_check():
    check(remove_dirty_chars)

test_check()

assert remove_dirty_chars('probasscurve', 'pros') == 'bacuve'


Prompt:
from typing import List, Any

def consecutive_duplicates(nums: List[Any]) -> List[Any]:
    """
	Write a function to remove consecutive duplicates of a given list.
	"""


Prompt:
from typing import Any, List

def count_Occurrence(tup: Any, lst: List[Any]) -> int:
    """
	Write a python function to count the occurence of all elements of list in a tuple.
	"""

def check(candidate):
    assert candidate(('a', 'a', 'c', 'b', 'd'), ['a', 'b']) == 3
    assert candidate((1, 2, 3, 1, 4, 6, 7, 1, 4), [1, 4, 7]) == 6
    assert candidate((1, 2, 3, 4, 5, 6), [1, 2]) == 2

def test_check():
    check(count_Occurrence)

test_check()


Prompt:
def remove_length(test_str: str, K: int) -> str:
    """
	Write a function to remove all the words with k length in the given string.
	"""

def check(candidate):
    assert candidate('The person is most value tet', 3) == 'person is most value'
    assert candidate('If you told me about this ok', 4) == 'If you me about ok'
    assert candidate('Forces of darkeness is come into the play', 4) == 'Forces of darkeness is the'

def test_check():
    check(remove_length)

test_check()

assert remove_length('The person is most value tet', 3) == 'person is most value'


Prompt:
def jacobsthal_num(n: int) -> int:
    """
	Write a function to find the nth jacobsthal number. https://www.geeksforgeeks.org/jacobsthal-and-jacobsthal-lucas-numbers/ 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, ...
	"""

def check(candidate):
    assert candidate(5) == 11
    assert candidate(2) == 1
    assert candidate(4) == 5
    assert candidate(13) == 2731

def test_check():
    check(jacobsthal_num)

test_check()


Prompt:
from typing import List

def max_Abs_Diff(arr: List[int]) -> int:
    """
	Write a python function to find the maximum difference between any two elements in a given array.
	"""

def check(candidate):
    assert candidate([2, 1, 5, 3]) == 4
    assert candidate([9, 3, 2, 5, 1]) == 8
    assert candidate([3, 2, 1]) == 2

def test_check():
    check(max_Abs_Diff)

test_check()


Prompt:
from typing import List

def two_unique_nums(nums: List[int]) -> List[int]:
    """
	Write a python function to remove duplicate numbers from a given number of lists.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 2, 3, 4, 5]) == [1, 4, 5]
    assert candidate([1, 2, 3, 2, 4, 5]) == [1, 3, 4, 5]
    assert candidate([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]

def test_check():
    check(two_unique_nums)

test_check()


Prompt:
from typing import List

def find_Odd_Pair(A: List[int], N: int) -> int:
    """
	Write a python function to count the number of pairs whose xor value is odd.
	"""

def check(candidate):
    assert candidate([5, 4, 7, 2, 1], 5) == 6
    assert candidate([7, 2, 8, 1, 0, 5, 11], 7) == 12
    assert candidate([1, 2, 3], 3) == 2

def test_check():
    check(find_Odd_Pair)

test_check()


Prompt:
from typing import List

def max_sum_increasing_subseq(a: List[int], n: int, index: int, k: int) -> int:
    """
	Write a function to find the maximum sum of increasing subsequence from prefix until ith index and also including a given kth element which is after i, i.e., k > i .
	"""

def check(candidate):
    assert candidate([1, 101, 2, 3, 100, 4, 5], 7, 4, 6) == 11
    assert candidate([1, 101, 2, 3, 100, 4, 5], 7, 2, 5) == 7
    assert candidate([11, 15, 19, 21, 26, 28, 31], 7, 2, 4) == 71

def test_check():
    check(max_sum_increasing_subseq)

test_check()


Prompt:
def highest_Power_of_2(n: int) -> int:
    """
	Write a python function to find the highest power of 2 that is less than or equal to n.
	"""

def check(candidate):
    assert candidate(10) == 8
    assert candidate(19) == 16
    assert candidate(32) == 32

def test_check():
    check(highest_Power_of_2)

test_check()


Prompt:
from typing import List

def add_nested_tuples(test_tup1: List[List[int]], test_tup2: List[List[int]]) -> List[List[int]]:
    """
	Write a function to perform index wise addition of list elements in the given two nested lists.
	"""


Prompt:
def last_Digit(n: int) -> int:
    """
	Write a python function to find the last digit of a given number.
	"""

def check(candidate):
    assert candidate(123) == 3
    assert candidate(25) == 5
    assert candidate(30) == 0

def test_check():
    check(last_Digit)

test_check()


Prompt:
from typing import List

def max_of_nth(test_list: List[List[int]], N: int) -> int:
    """
	Write a function which given a matrix represented as a list of lists returns the max of the n'th column.
	"""


Prompt:
from typing import List, Tuple

def sequential_search(dlist: List[int], item: int) -> Tuple[bool, int]:
    """
	Write a function that takes in an array and element and returns a tuple containing a boolean that indicates if the element is in the array and the index position of the element (or -1 if the element is not found).
	"""


Prompt:
from typing import List

def is_Sub_Array(A: List[int], B: List[int]) -> bool:
    """
	Write a python function to check whether a list is sublist of another or not.
	"""

def check(candidate):
    assert candidate([1, 4, 3, 5], [1, 2]) == False
    assert candidate([1, 2, 1], [1, 2, 1]) == True
    assert candidate([1, 0, 2, 2], [2, 2, 0]) == False

def test_check():
    check(is_Sub_Array)

test_check()

assert is_Sub_Array([1, 4, 3, 5], [1, 2]) == False


Prompt:
def reverse_vowels(str1: str) -> str:
    """
	Write a python function to reverse only the vowels of a given string (where y is not a vowel).
	"""

def check(candidate):
    assert candidate('Python') == 'Python'
    assert candidate('USA') == 'ASU'
    assert candidate('ab') == 'ab'

def test_check():
    check(reverse_vowels)

test_check()

assert reverse_vowels('Python') == 'Python'


Prompt:
def median_trapezium(base1: int, base2: int, height: int) -> float:
    """
	Write a function to find the median length of a trapezium.
	"""

def check(candidate):
    assert candidate(15, 25, 35) == 20
    assert candidate(10, 20, 30) == 15
    assert candidate(6, 9, 4) == 7.5

def test_check():
    check(median_trapezium)

test_check()

assert median_trapezium(15, 25, 35) == 20


Prompt:
from typing import List

def remove_elements(list1: List[int], list2: List[int]) -> List[int]:
    """
	Write a function to remove all elements from a given list present in another list.
	"""


Prompt:
from typing import List

def find_kth(arr1: List[int], arr2: List[int], k: int) -> int:
    """
	Write a function to find kth element from the given two sorted arrays.
	"""


Prompt:
def odd_values_string(str: str) -> str:
    """
	Write a python function to remove the characters which have odd index values of a given string.
	"""

def check(candidate):
    assert candidate('abcdef') == 'ace'
    assert candidate('python') == 'pto'
    assert candidate('data') == 'dt'
    assert candidate('lambs') == 'lms'

def test_check():
    check(odd_values_string)

test_check()

assert odd_values_string('abcdef') == 'ace'


Prompt:
from typing import List, Union, Tuple

def count_first_elements(test_tup: List[Union[int, Tuple[int, int]]]) -> int:
    """
	Write a function to find the number of elements that occurs before the list element in the given tuple.
	"""

def check(candidate):
    assert candidate([1, 5, 7, (4, 6), 10]) == 3
    assert candidate([2, 9, (5, 7), 11]) == 2
    assert candidate([11, 15, 5, 8, (2, 3), 8]) == 4

def test_check():
    check(count_first_elements)

test_check()

assert count_first_elements([1, 5, 7, (4, 6), 10]) == 3


Prompt:
def ascii_value(k: str) -> int:
    """
	Write a function to find the ascii value of a character.
	"""

def check(candidate):
    assert candidate('A') == 65
    assert candidate('R') == 82
    assert candidate('S') == 83

def test_check():
    check(ascii_value)

test_check()


Prompt:
def find_Index(n: int) -> int:
    """
	Write a python function to find the index of smallest triangular number with n digits. https://www.geeksforgeeks.org/index-of-smallest-triangular-number-with-n-digits/
	"""

def check(candidate):
    assert candidate(2) == 4
    assert candidate(3) == 14
    assert candidate(4) == 45

def test_check():
    check(find_Index)

test_check()


Prompt:
from typing import List

def test_duplicate(arraynums: List[int]) -> bool:
    """
	Write a function to find whether a given array of integers contains any duplicate element.
	"""

def check(candidate):
    assert candidate([1, 2, 3, 4, 5]) == False
    assert candidate([1, 2, 3, 4, 4]) == True
    assert candidate([1, 1, 2, 2, 3, 3, 4, 4, 5]) == True

def test_check():
    check(test_duplicate)

test_check()

assert test_duplicate([1, 2, 3, 4, 5]) == False


Prompt:
from typing import List

def smallest_num(xs: List[int]) -> int:
    """
	Write a python function to find smallest number in a list.
	"""

def check(candidate):
    assert candidate([10, 20, 1, 45, 99]) == 1
    assert candidate([1, 2, 3]) == 1
    assert candidate([45, 46, 50, 60]) == 45

def test_check():
    check(smallest_num)

test_check()


Prompt:
from typing import Optional

def sector_area(r: int, a: int) -> Optional[float]:
    """
	Write a function to find area of a sector. The function takes the radius and angle as inputs. Function should return None if the angle is larger than 360 degrees.
	"""

def check(candidate):
    assert candidate(4, 45) == 6.283185307179586
    assert candidate(9, 45) == 31.808625617596654
    assert candidate(9, 361) == None

def test_check():
    check(sector_area)

test_check()


Prompt:
from typing import List

def count_samepair(list1: List[int], list2: List[int], list3: List[int]) -> int:
    """
	Write a function to count number items that are identical in the same position of three given lists.
	"""


Prompt:
from typing import List, Tuple

def extract_freq(test_list: List[Tuple[int, int]]) -> int:
    """
	Write a function to extract the number of unique tuples in the given list.
	"""