qid,title,language,text,signature_with_docstring,signature,arguments,solution,question_info 511,MBPP/511,C++,Write a c++ function to find minimum sum of factors of a given number.,"/** * Write a c++ function to find minimum sum of factors of a given number. */ int findMinSum(int num) {",int findMinSum(int num) {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findMinSum', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(12, 7); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(105, 15); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, 2); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 514,MBPP/514,C++,Write a function to find the summation of tuple elements in the given tuple vector.,"/** * Write a function to find the summation of tuple elements in the given tuple vector. */ int sumElements(vector test_tup) {",int sumElements(vector test_tup) {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'sumElements', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector test_tup, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({7, 8, 9, 1, 10, 7}, 42); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5, 6}, 21); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({11, 12, 13, 45, 14}, 95); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 515,MBPP/515,C++,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ bool modularSum(vector arr, int n, int m) {","bool modularSum(vector arr, int n, int m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'modularSum', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int m, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({3, 1, 7, 5}, 4, 6, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 7}, 2, 5, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 6}, 2, 5, false); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 516,MBPP/516,C++,Write a function to sort vector of elements using radix sort.,"/** * Write a function to sort vector of elements using radix sort. */ vector radixSort(vector nums) {",vector radixSort(vector nums) {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'radixSort', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector nums, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({15, 79, 25, 68, 37}, {15, 25, 37, 68, 79}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({9, 11, 8, 7, 3, 2}, {2, 3, 7, 8, 9, 11}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({36, 12, 24, 26, 29}, {12, 24, 26, 29, 36}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 517,MBPP/517,C++,Write a c++ function to find the largest postive number from the given vector.,"/** * Write a c++ function to find the largest postive number from the given vector. */ int largestPos(vector list1) {",int largestPos(vector list1) {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'largestPos', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector list1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 4, -1}, 4); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({0, 1, 2, -5, -1, 6}, 6); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({0, 0, 1, 0}, 1); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 518,MBPP/518,C++,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ int sqrtRoot(int num) {",int sqrtRoot(int num) {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'sqrtRoot', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(4, 2); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(16, 4); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(400, 20); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 519,MBPP/519,C++,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ float volumeTetrahedron(int num) {",float volumeTetrahedron(int num) {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'volumeTetrahedron', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(float actual, float expected){\n return abs(actual - expected) < 1e-06;\n}\n\nstring driver(int num, float expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(10, 117.85); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(15, 397.75); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(20, 942.81); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 520,MBPP/520,C++,Write a function to find the lcm of the given vector elements.,"/** * Write a function to find the lcm of the given vector elements. */ int getLcm(vector l) {",int getLcm(vector l) {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'getLcm', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector l, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(l), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({2, 7, 3, 9, 4}, 252); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 8, 3}, 24); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 8, 4, 10, 5}, 120); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 521,MBPP/521,C++,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ bool checkIsosceles(int x, int y, int z) {","bool checkIsosceles(int x, int y, int z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'checkIsosceles', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int x, int y, int z, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(6, 8, 12, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(6, 6, 12, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(6, 15, 20, true); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 522,MBPP/522,C++,Write a function to find the longest bitonic subsequence for the given vector.,"/** * Write a function to find the longest bitonic subsequence for the given vector. */ int lbs(vector arr) {",int lbs(vector arr) {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'lbs', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}, 7); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 11, 2, 10, 4, 5, 2, 1}, 6); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({80, 60, 30, 40, 20, 10}, 5); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 523,MBPP/523,C++,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ vector checkString(string str1) {",vector checkString(string str1) {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'checkString', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(string str1, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""python"", {""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""123python"", {""String must have 1 upper case character.""}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""123Python"", {""Valid string.""}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 524,MBPP/524,C++,Write a function to find the sum of maximum increasing subsequence of the given vector.,"/** * Write a function to find the sum of maximum increasing subsequence of the given vector. */ int maxSumIncreasingSubsequence(vector arr, int n) {","int maxSumIncreasingSubsequence(vector arr, int n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 101, 2, 3, 100, 4, 5}, 7, 106); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 4, 5, 10}, 4, 22); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({10, 5, 4, 3}, 4, 10); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 525,MBPP/525,C++,Write a c++ function to check whether two given lines are parallel or not.,"/** * Write a c++ function to check whether two given lines are parallel or not. */ bool parallelLines(vector line1, vector line2) {","bool parallelLines(vector line1, vector line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'parallelLines', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector line1, vector line2, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({2, 3, 4}, {2, 3, 8}, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({2, 3, 4}, {4, -3, 8}, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 3}, {5, 5}, true); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 526,MBPP/526,C++,Write a c++ function to capitalize first and last letters of each word of a given string.,"/** * Write a c++ function to capitalize first and last letters of each word of a given string. */ string capitalizeFirstLastLetters(string str1) {",string capitalizeFirstLastLetters(string str1) {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string str1, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""python"", ""PythoN""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""bigdata"", ""BigdatA""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Hadoop"", ""HadooP""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 527,MBPP/527,C++,Write a function to find all pairs in an integer vector whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer vector whose sum is equal to a given number. */ int getPairsCount(vector arr, int n, int sum) {","int getPairsCount(vector arr, int n, int sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'getPairsCount', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int sum, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 5, 7, -1, 5}, 5, 6, 3); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 5, 7, -1}, 4, 6, 2); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 1, 1, 1}, 4, 2, 6); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 529,MBPP/529,C++,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ int jacobsthalLucas(int n) {",int jacobsthalLucas(int n) {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'jacobsthalLucas', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(5, 31); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, 5); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 17); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 530,MBPP/530,C++,Write a function to find the ration of negative numbers in vector of integers.,"/** * Write a function to find the ration of negative numbers in vector of integers. */ float negativeCount(vector nums) {",float negativeCount(vector nums) {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'negativeCount', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(float actual, float expected){\n return abs(actual - expected) < 1e-06;\n}\n\nstring driver(vector nums, float expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8}, 0.31); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8}, 0.31); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({2, 4, -6, -9, 11, -12, 14, -5, 17}, 0.44); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 531,MBPP/531,C++,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ int minCoins(vector coins, int m, int v) {","int minCoins(vector coins, int m, int v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'minCoins', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector coins, int m, int v, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({9, 6, 5, 1}, 4, 11, 2); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({4, 5, 6, 7, 8, 9}, 6, 9, 1); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3}, 3, 4, 2); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 532,MBPP/532,C++,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ bool checkPermutation(string str1, string str2) {","bool checkPermutation(string str1, string str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'checkPermutation', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string str1, string str2, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""abc"", ""cba"", true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""test"", ""ttew"", false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""xxyz"", ""yxzx"", true); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 534,MBPP/534,C++,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ vector searchLiteral(string pattern, string text) {","vector searchLiteral(string pattern, string text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'searchLiteral', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(string pattern, string text, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""python"", ""python programming language"", {0, 6}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""programming"", ""python programming language"", {7, 18}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""language"", ""python programming language"", {19, 27}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 535,MBPP/535,C++,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ double topbottomSurfacearea(int r) {",double topbottomSurfacearea(int r) {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return abs(actual - expected) < 1e-09;\n}\n\nstring driver(int r, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(r), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(10, 314.15000000000003); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(5, 78.53750000000001); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 50.264); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 536,MBPP/536,C++,Write a function to select the nth items of vector.,"/** * Write a function to select the nth items of vector. */ vector nthItems(vector list, int n) {","vector nthItems(vector list, int n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'nthItems', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector list, int n, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, {1, 3, 5, 7, 9}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({10, 15, 19, 17, 16, 18}, 3, {10, 17}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({14, 16, 19, 15, 17}, 4, {14, 17}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 537,MBPP/537,C++,Write a c++ function to find the first repeated word in a given string.,"/** * Write a c++ function to find the first repeated word in a given string. */ string firstRepeatedWord(string str1) {",string firstRepeatedWord(string str1) {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'firstRepeatedWord', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string str1, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""ab ca bc ab"", ""ab""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""ab ca bc"", ""None""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""ab ca bc ca ab bc"", ""ca""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 538,MBPP/538,C++,Write a c++ function to convert a given string vector to a tuple.,"/** * Write a c++ function to convert a given string vector to a tuple. */ vector stringListToTuple(string str1) {",vector stringListToTuple(string str1) {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'stringListToTuple', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(string str1, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""python 3.0"", {\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""bigdata"", {\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""language"", {\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 539,MBPP/539,C++,Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function.,"/** * Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function. */ vector basesnumCoresspondingnum(vector bases_num, vector index) {","vector basesnumCoresspondingnum(vector bases_num, vector index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector bases_num, vector index, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5, 6, 7}, {10, 20, 30, 40, 50, 60, 70}, {1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({4, 8, 12, 16, 20, 24, 28}, {3, 6, 9, 12, 15, 18, 21}, {64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 540,MBPP/540,C++,Write a c++ function to find the difference between highest and least frequencies in a given vector.,"/** * Write a c++ function to find the difference between highest and least frequencies in a given vector. */ int findDiff(vector arr, int n) {","int findDiff(vector arr, int n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findDiff', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 1, 2, 2, 7, 8, 4, 5, 1, 4}, 10, 2); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 7, 9, 2, 3, 3, 1, 3, 3}, 9, 3); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 1, 2}, 4, 0); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 541,MBPP/541,C++,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ bool checkAbundant(int n) {",bool checkAbundant(int n) {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'checkAbundant', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(12, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(15, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(18, true); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 542,MBPP/542,C++,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ string fillSpaces(string text) {",string fillSpaces(string text) {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'fillSpaces', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string text, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 543,MBPP/543,C++,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ int countDigits(long long num1, int num2) {","int countDigits(long long num1, int num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'countDigits', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(long long num1, int num2, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(9875, 10, 4); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(98759853034, 100, 11); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(1234567, 500, 7); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 545,MBPP/545,C++,Write a c++ function to toggle only first and last bits of a given number.,"/** * Write a c++ function to toggle only first and last bits of a given number. */ int toggleFAndLBits(int n) {",int toggleFAndLBits(int n) {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'toggleFAndLBits', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(10, 3); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(15, 6); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(20, 5); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 546,MBPP/546,C++,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ int lastOccurenceChar(string string_arg0, char char_arg1) {","int lastOccurenceChar(string string_arg0, char char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'lastOccurenceChar', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(string string_arg0, char char_arg1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""hello world"", \'l\', 10); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""language"", \'g\', 7); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""little"", \'y\', None); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 547,MBPP/547,C++,Write a c++ function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a c++ function to find the sum of hamming distances of all consecutive numbers from o to n. */ int totalHammingDistance(int n) {",int totalHammingDistance(int n) {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'totalHammingDistance', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(4, 7); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, 3); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(5, 8); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 548,MBPP/548,C++,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ int longestIncreasingSubsequence(vector arr) {",int longestIncreasingSubsequence(vector arr) {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({10, 22, 9, 33, 21, 50, 41, 60}, 5); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 10, 2, 1, 20}, 3); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({50, 3, 10, 7, 40, 80}, 4); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 549,MBPP/549,C++,Write a c++ function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a c++ function to find the sum of fifth power of first n odd natural numbers. */ int oddNumSum(int n) {",int oddNumSum(int n) {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'oddNumSum', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(1, 1); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, 244); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(3, 3369); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 550,MBPP/550,C++,Write a c++ function to find the maximum element in a sorted and rotated vector.,"/** * Write a c++ function to find the maximum element in a sorted and rotated vector. */ int findMax(vector arr, int low, int high) {","int findMax(vector arr, int low, int high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findMax', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int low, int high, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({2, 3, 5, 6, 9}, 0, 4, 9); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 4, 5, 2, 1}, 0, 4, 5); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3}, 0, 2, 3); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 551,MBPP/551,C++,Write a function to extract a specified column from a given nested vector.,"/** * Write a function to extract a specified column from a given nested vector. */ vector extractColumn(vector> list1, int n) {","vector extractColumn(vector> list1, int n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'extractColumn', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector> list1, int n, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({{1, 2, 3}, {2, 4, 5}, {1, 1, 1}}, 0, {1, 2, 1}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{1, 2, 3}, {-2, 4, -5}, {1, -1, 1}}, 2, {3, -5, 1}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{1, 3}, {5, 7}, {1, 3}, {13, 15, 17}, {5, 7}, {9, 11}}, 0, {1, 5, 1, 13, 5, 9}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 552,MBPP/552,C++,Write a c++ function to check whether a given sequence is linear or not.,"/** * Write a c++ function to check whether a given sequence is linear or not. */ string seqLinear(vector seq_nums) {",string seqLinear(vector seq_nums) {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'seqLinear', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(vector seq_nums, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({0, 2, 4, 6, 8, 10}, ""Linear Sequence""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3}, ""Linear Sequence""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 5, 2}, ""Non Linear Sequence""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 553,MBPP/553,C++,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ float tupleToFloat(vector test_tup) {",float tupleToFloat(vector test_tup) {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'tupleToFloat', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(float actual, float expected){\n return abs(actual - expected) < 1e-06;\n}\n\nstring driver(vector test_tup, float expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({4, 56}, 4.56); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({7, 256}, 7.256); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({8, 123}, 8.123); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 554,MBPP/554,C++,Write a c++ function to find odd numbers from a mixed vector.,"/** * Write a c++ function to find odd numbers from a mixed vector. */ vector split(vector list) {",vector split(vector list) {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'split', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector list, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 4, 5, 6}, {1, 3, 5}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({10, 11, 12, 13}, {11, 13}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({7, 8, 9, 1}, {7, 9, 1}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 555,MBPP/555,C++,Write a c++ function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a c++ function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ int difference(int n) {",int difference(int n) {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'difference', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(3, 30); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(5, 210); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, 6); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 556,MBPP/556,C++,Write a c++ function to count the pairs with xor as an odd number.,"/** * Write a c++ function to count the pairs with xor as an odd number. */ int findOddPair(vector a, int n) {","int findOddPair(vector a, int n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findOddPair', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector a, int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({5, 4, 7, 2, 1}, 5, 6); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({7, 2, 8, 1, 0, 5, 11}, 7, 12); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3}, 3, 2); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 557,MBPP/557,C++,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ string toggleString(string string_arg0) {",string toggleString(string string_arg0) {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'toggleString', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string string_arg0, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""Python"", ""pYTHON""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Pangram"", ""pANGRAM""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""LIttLE"", ""liTTle""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 558,MBPP/558,C++,Write a c++ function to find the digit distance between two integers.,"/** * Write a c++ function to find the digit distance between two integers. */ int digitDistanceNums(int n1, int n2) {","int digitDistanceNums(int n1, int n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'digitDistanceNums', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n1, int n2, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(1, 2, 1); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(23, 56, 6); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(123, 256, 7); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 559,MBPP/559,C++,Write a function to find the largest sum of contiguous subarray in the given vector.,"/** * Write a function to find the largest sum of contiguous subarray in the given vector. */ int maxSubArraySum(vector a, int size) {","int maxSubArraySum(vector a, int size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'maxSubArraySum', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector a, int size, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({-2, -3, 4, -1, -2, 1, 5, -3}, 8, 7); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({-3, -4, 5, -2, -3, 2, 6, -4}, 8, 8); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({-4, -5, 6, -3, -4, 3, 7, -5}, 8, 10); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 560,MBPP/560,C++,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ vector unionElements(vector test_tup1, vector test_tup2) {","vector unionElements(vector test_tup1, vector test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'unionElements', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector test_tup1, vector test_tup2, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({3, 4, 5, 6}, {5, 7, 4, 10}, {3, 4, 5, 6, 7, 10}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4}, {3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({11, 12, 13, 14}, {13, 15, 16, 17}, {11, 12, 13, 14, 15, 16, 17}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 562,MBPP/562,C++,Write a c++ function to find the maximum length of sublist.,"/** * Write a c++ function to find the maximum length of sublist. */ int findMaxLength(vector> lst) {",int findMaxLength(vector> lst) {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findMaxLength', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector> lst, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(lst), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({{1}, {1, 4}, {5, 6, 7, 8}}, 4); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{0, 1}, {2, 2}, {3, 2, 1}}, 3); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{7}, {22, 23}, {13, 14, 15}, {10, 20, 30, 40, 50}}, 5); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 563,MBPP/563,C++,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ vector extractValues(string text) {",vector extractValues(string text) {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'extractValues', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(string text, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", {""Python"", ""PHP"", ""Java""}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", {""python"", ""program"", ""language""}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", {""red"", ""blue"", ""green"", ""yellow""}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 564,MBPP/564,C++,Write a c++ function to count unequal element pairs from the given vector.,"/** * Write a c++ function to count unequal element pairs from the given vector. */ int countPairs(vector arr, int n) {","int countPairs(vector arr, int n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'countPairs', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 1}, 3, 2); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 1, 1, 1}, 4, 0); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5}, 5, 10); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 565,MBPP/565,C++,Write a c++ function to split a string into characters.,"/** * Write a c++ function to split a string into characters. */ vector split(string word) {",vector split(string word) {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'split', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(string word, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(word), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""python"", {\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Name"", {\'N\', \'a\', \'m\', \'e\'}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""program"", {\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 566,MBPP/566,C++,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ int sumDigits(int n) {",int sumDigits(int n) {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'sumDigits', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(345, 12); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(12, 3); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(97, 16); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 567,MBPP/567,C++,Write a function to check whether a specified vector is sorted or not.,"/** * Write a function to check whether a specified vector is sorted or not. */ bool issortList(vector list1) {",bool issortList(vector list1) {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'issortList', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector list1, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 4, 6, 8, 10, 12, 14, 16, 17}, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 4, 6, 8, 10, 12, 14, 20, 17}, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 4, 6, 8, 10, 15, 14, 20}, false); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 569,MBPP/569,C++,Write a function to sort each sublist of strings in a given vector of vectors.,"/** * Write a function to sort each sublist of strings in a given vector of vectors. */ vector> sortSublists(vector> list1) {",vector> sortSublists(vector> list1) {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'sortSublists', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector> actual, vector> expected){\n return actual == expected;\n}\n\nstring driver(vector> list1, vector> expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({{""green"", ""orange""}, {""black"", ""white""}, {""white"", ""black"", ""orange""}}, {{""green"", ""orange""}, {""black"", ""white""}, {""black"", ""orange"", ""white""}}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}}, {{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({{""a"", ""b""}, {""d"", ""c""}, {""g"", ""h""}, {""f"", ""e""}}, {{""a"", ""b""}, {""c"", ""d""}, {""g"", ""h""}, {""e"", ""f""}}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 570,MBPP/570,C++,Write a function to remove words from a given vector of strings containing a character or string.,"/** * Write a function to remove words from a given vector of strings containing a character or string. */ vector removeWords(vector list1, vector charlist) {","vector removeWords(vector list1, vector charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'removeWords', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector list1, vector charlist, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""}, {""#"", ""color"", ""@""}, {""Red"", """", ""Green"", ""Orange"", ""White""}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, {""&"", ""+"", ""@""}, {""Red"", """", ""Green"", ""Orange"", ""White""}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, {""@""}, {""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 571,MBPP/571,C++,Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k. */ int maxSumPairDiffLessthanK(vector arr, int n, int k) {","int maxSumPairDiffLessthanK(vector arr, int n, int k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr, int n, int k, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({3, 5, 10, 15, 17, 12, 9}, 7, 4, 62); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({5, 15, 10, 300}, 4, 12, 25); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5, 6}, 6, 6, 21); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 572,MBPP/572,C++,Write a c++ function to remove two duplicate numbers from a given number of vectors.,"/** * Write a c++ function to remove two duplicate numbers from a given number of vectors. */ vector twoUniqueNums(vector nums) {",vector twoUniqueNums(vector nums) {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'twoUniqueNums', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector nums, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 2, 3, 4, 5}, {1, 4, 5}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 2, 4, 5}, {1, 3, 4, 5}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 573,MBPP/573,C++,Write a c++ function to calculate the product of the unique numbers of a given vector.,"/** * Write a c++ function to calculate the product of the unique numbers of a given vector. */ int uniqueProduct(vector list_data) {",int uniqueProduct(vector list_data) {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'uniqueProduct', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector list_data, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({10, 20, 30, 40, 20, 50, 60, 40}, 720000000); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 1}, 6); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({7, 8, 9, 0, 1, 1}, 0); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 574,MBPP/574,C++,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ double surfaceareaCylinder(int r, int h) {","double surfaceareaCylinder(int r, int h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return abs(actual - expected) < 1e-09;\n}\n\nstring driver(int r, int h, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(10, 5, 942.45); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 5, 226.18800000000002); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 10, 351.848); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 575,MBPP/575,C++,Write a c++ function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a c++ function to find nth number in a sequence which is not a multiple of a given number. */ int countNo(int a, int n, int l, int r) {","int countNo(int a, int n, int l, int r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'countNo', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int a, int n, int l, int r, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(2, 3, 1, 10, 5); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(3, 6, 4, 20, 11); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(5, 10, 4, 20, 16); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 576,MBPP/576,C++,Write a c++ function to check whether vector is subarray of another or not.,"/** * Write a c++ function to check whether vector is subarray of another or not. */ bool isSubArray(vector a, vector b, int n, int m) {","bool isSubArray(vector a, vector b, int n, int m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'isSubArray', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector a, vector b, int n, int m, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 4, 3, 5}, {1, 2}, 4, 2, false); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 1}, {1, 2, 1}, 3, 3, true); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 0, 2, 2}, {2, 2, 0}, 4, 3, false); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 577,MBPP/577,C++,Write a c++ function to find the last digit in factorial of a given number.,"/** * Write a c++ function to find the last digit in factorial of a given number. */ int lastDigitFactorial(int n) {",int lastDigitFactorial(int n) {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'lastDigitFactorial', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(4, 4); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(21, 0); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(30, 0); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 578,MBPP/578,C++,Write a function to interleave vectors of the same length.,"/** * Write a function to interleave vectors of the same length. */ vector interleaveLists(vector list1, vector list2, vector list3) {","vector interleaveLists(vector list1, vector list2, vector list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'interleaveLists', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector list1, vector list2, vector list3, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 4, 5, 6, 7}, {10, 20, 30, 40, 50, 60, 70}, {100, 200, 300, 400, 500, 600, 700}, {1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({10, 20}, {15, 2}, {5, 10}, {10, 15, 5, 20, 2, 10}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({11, 44}, {10, 15}, {20, 5}, {11, 10, 20, 44, 15, 5}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 579,MBPP/579,C++,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ vector findDissimilar(vector test_tup1, vector test_tup2) {","vector findDissimilar(vector test_tup1, vector test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findDissimilar', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector test_tup1, vector test_tup2, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({3, 4, 5, 6}, {5, 7, 4, 10}, {3, 6, 7, 10}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4}, {7, 2, 3, 9}, {1, 4, 7, 9}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({21, 11, 25, 26}, {26, 34, 21, 36}, {34, 36, 11, 25}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 581,MBPP/581,C++,Write a c++ function to find the surface area of the square pyramid.,"/** * Write a c++ function to find the surface area of the square pyramid. */ int surfaceArea(int b, int s) {","int surfaceArea(int b, int s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'surfaceArea', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int b, int s, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(3, 4, 33); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 5, 56); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(1, 2, 5); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 583,MBPP/583,C++,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ int catalanNumber(int num) {",int catalanNumber(int num) {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'catalanNumber', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(10, 16796); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(9, 4862); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(7, 429); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 584,MBPP/584,C++,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ string findAdverbs(string text) {",string findAdverbs(string text) {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findAdverbs', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string text, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""Complete the task quickly"", ""18-25: quickly""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 586,MBPP/586,C++,Write a c++ function to split the vector and add the first part to the end.,"/** * Write a c++ function to split the vector and add the first part to the end. */ vector splitArr(vector a, int n, int k) {","vector splitArr(vector a, int n, int k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'splitArr', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector a, int n, int k, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({12, 10, 5, 6, 52, 36}, 6, 2, {5, 6, 52, 36, 12, 10}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4}, 4, 1, {2, 3, 4, 1}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7}, 8, 3, {3, 4, 5, 6, 7, 0, 1, 2}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 587,MBPP/587,C++,Write a function to convert vector to a tuple.,"/** * Write a function to convert vector to a tuple. */ vector listTuple(vector listx) {",vector listTuple(vector listx) {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'listTuple', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector listx, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(listx), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({5, 10, 7, 4, 15, 3}, {5, 10, 7, 4, 15, 3}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({2, 4, 5, 6, 2, 3, 4, 4, 7}, {2, 4, 5, 6, 2, 3, 4, 4, 7}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({58, 44, 56}, {58, 44, 56}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 588,MBPP/588,C++,Write a c++ function to find the difference between largest and smallest value in a given vector.,"/** * Write a c++ function to find the difference between largest and smallest value in a given vector. */ int bigDiff(vector nums) {",int bigDiff(vector nums) {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'bigDiff', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector nums, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 2, 3, 4}, 3); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({4, 5, 12}, 8); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({9, 2, 3}, 7); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 589,MBPP/589,C++,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ vector perfectSquares(int a, int b) {","vector perfectSquares(int a, int b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'perfectSquares', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(int a, int b, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(1, 30, {1, 4, 9, 16, 25}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(50, 100, {64, 81, 100}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(100, 200, {100, 121, 144, 169, 196}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 591,MBPP/591,C++,Write a c++ function to interchange the first and last elements in vector.,"/** * Write a c++ function to interchange the first and last elements in vector. */ vector swapList(vector newlist) {",vector swapList(vector newlist) {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'swapList', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(vector actual, vector expected){\n return actual == expected;\n}\n\nstring driver(vector newlist, vector expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({12, 35, 9, 56, 24}, {24, 35, 9, 56, 12}); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3}, {3, 2, 1}); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({4, 5, 6}, {6, 5, 4}); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 592,MBPP/592,C++,Write a c++ function to find sum of product of binomial co-efficients.,"/** * Write a c++ function to find sum of product of binomial co-efficients. */ int sumOfProduct(int n) {",int sumOfProduct(int n) {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'sumOfProduct', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(int n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(3, 15); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4, 56); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(1, 1); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 593,MBPP/593,C++,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ string removezeroIp(string ip) {",string removezeroIp(string ip) {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'removezeroIp', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(string actual, string expected){\n return actual == expected;\n}\n\nstring driver(string ip, string expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ip), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(""216.08.094.196"", ""216.8.94.196""); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""12.01.024"", ""12.1.24""); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(""216.08.094.0196"", ""216.8.94.196""); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 594,MBPP/594,C++,Write a function to find the difference of first even and odd number of a given vector.,"/** * Write a function to find the difference of first even and odd number of a given vector. */ int diffEvenOdd(vector list1) {",int diffEvenOdd(vector list1) {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'diffEvenOdd', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector list1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({1, 3, 5, 7, 4, 1, 6, 8}, 3); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 1); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({1, 5, 7, 9, 10}, 9); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 597,MBPP/597,C++,Write a function to find kth element from the given two sorted vectors.,"/** * Write a function to find kth element from the given two sorted vectors. */ int findKth(vector arr1, vector arr2, int m, int n, int k) {","int findKth(vector arr1, vector arr2, int m, int n, int k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'findKth', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual == expected;\n}\n\nstring driver(vector arr1, vector arr2, int m, int n, int k, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver({2, 3, 6, 7, 9}, {1, 4, 8, 10}, 5, 4, 5, 6); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver({100, 112, 256, 349, 770}, {72, 86, 113, 119, 265, 445, 892}, 5, 7, 7, 256); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver({3, 4, 7, 8, 10}, {2, 5, 9, 11}, 5, 4, 6, 8); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 598,MBPP/598,C++,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ bool armstrongNumber(int number) {",bool armstrongNumber(int number) {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'armstrongNumber', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int number, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(number), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(153, true); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(259, false); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(4458, false); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 600,MBPP/600,C++,Write a c++ function to check whether the given number is even or not using bitwise operator.,"/** * Write a c++ function to check whether the given number is even or not using bitwise operator. */ bool isEven(int n) {",bool isEven(int n) {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'cpp', 'entry_fn_name': 'isEven', 'test_code': '#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return ""UNK_ERROR"";\n }\n}\n\nint main() {\n string result = """";\n\n result = driver(1, false); \n cout << ""TEST-"" << 0 << ""...""\n << result\n << ""\\n"";\n\n result = driver(2, true); \n cout << ""TEST-"" << 1 << ""...""\n << result\n << ""\\n"";\n\n result = driver(3, false); \n cout << ""TEST-"" << 2 << ""...""\n << result\n << ""\\n"";\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['g++', '__FILENAME__', '-o', 'main.exe'], ['./main.exe']], 'timeouts': [10, 10]}" 511,MBPP/511,CSharp,Write a c# function to find minimum sum of factors of a given number.,"class Solution { /** * Write a c# function to find minimum sum of factors of a given number. */ public int FindMinSum(int num) {","class Solution { public int FindMinSum(int num) {",['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindMinSum', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int num, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(num); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 12, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 105, \n 15\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 2, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 514,MBPP/514,CSharp,Write a function to find the summation of tuple elements in the given tuple list.,"class Solution { /** * Write a function to find the summation of tuple elements in the given tuple list. */ public int SumElements(List test_tup) {","class Solution { public int SumElements(List test_tup) {",['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SumElements', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List test_tup, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(test_tup); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{7, 8, 9, 1, 10, 7}, \n 42\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5, 6}, \n 21\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{11, 12, 13, 45, 14}, \n 95\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 515,MBPP/515,CSharp,Write a function to check if there is a subset with sum divisible by m.,"class Solution { /** * Write a function to check if there is a subset with sum divisible by m. */ public bool ModularSum(List arr, int n, int m) {","class Solution { public bool ModularSum(List arr, int n, int m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ModularSum', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int m, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n, m); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{3, 1, 7, 5}, 4, 6, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 7}, 2, 5, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 6}, 2, 5, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 516,MBPP/516,CSharp,Write a function to sort a list of elements using radix sort.,"class Solution { /** * Write a function to sort a list of elements using radix sort. */ public List RadixSort(List nums) {","class Solution { public List RadixSort(List nums) {",['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'RadixSort', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List nums, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(nums); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{15, 79, 25, 68, 37}, \n new List{15, 25, 37, 68, 79}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{9, 11, 8, 7, 3, 2}, \n new List{2, 3, 7, 8, 9, 11}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{36, 12, 24, 26, 29}, \n new List{12, 24, 26, 29, 36}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 517,MBPP/517,CSharp,Write a c# function to find the largest postive number from the given list.,"class Solution { /** * Write a c# function to find the largest postive number from the given list. */ public int LargestPos(List list1) {","class Solution { public int LargestPos(List list1) {",['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'LargestPos', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list1, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 4, -1}, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{0, 1, 2, -5, -1, 6}, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{0, 0, 1, 0}, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 518,MBPP/518,CSharp,Write a function to find the square root of a perfect number.,"class Solution { /** * Write a function to find the square root of a perfect number. */ public int SqrtRoot(int num) {","class Solution { public int SqrtRoot(int num) {",['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SqrtRoot', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int num, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(num); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 4, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 16, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 400, \n 20\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 519,MBPP/519,CSharp,Write a function to calculate volume of a tetrahedron.,"class Solution { /** * Write a function to calculate volume of a tetrahedron. */ public float VolumeTetrahedron(int num) {","class Solution { public float VolumeTetrahedron(int num) {",['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'VolumeTetrahedron', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(float actual, float expected){\n return Math.Abs(actual - expected) < 1e-06f;\n }\n\n public string driver(int num, float expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n float pred_result = solution_cls.PLACEHOLDER_FN_NAME(num); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 10, \n 117.85f\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 15, \n 397.75f\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 20, \n 942.81f\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 520,MBPP/520,CSharp,Write a function to find the lcm of the given list elements.,"class Solution { /** * Write a function to find the lcm of the given list elements. */ public int GetLcm(List l) {","class Solution { public int GetLcm(List l) {",['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'GetLcm', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List l, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(l); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{2, 7, 3, 9, 4}, \n 252\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 8, 3}, \n 24\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{3, 8, 4, 10, 5}, \n 120\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 521,MBPP/521,CSharp,Write a function to print check if the triangle is scalene or not.,"class Solution { /** * Write a function to print check if the triangle is scalene or not. */ public bool CheckIsosceles(int x, int y, int z) {","class Solution { public bool CheckIsosceles(int x, int y, int z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CheckIsosceles', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int x, int y, int z, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(x, y, z); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 6, 8, 12, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 6, 6, 12, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 6, 15, 20, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 522,MBPP/522,CSharp,Write a function to find the longest bitonic subsequence for the given list.,"class Solution { /** * Write a function to find the longest bitonic subsequence for the given list. */ public int Lbs(List arr) {","class Solution { public int Lbs(List arr) {",['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'Lbs', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 11, 2, 10, 4, 5, 2, 1}, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{80, 60, 30, 40, 20, 10}, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 523,MBPP/523,CSharp,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","class Solution { /** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ public List CheckString(string str1) {","class Solution { public List CheckString(string str1) {",['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CheckString', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string str1, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(str1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""python"", \n new List{""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""123python"", \n new List{""String must have 1 upper case character.""}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""123Python"", \n new List{""Valid string.""}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 524,MBPP/524,CSharp,Write a function to find the sum of maximum increasing subsequence of the given list.,"class Solution { /** * Write a function to find the sum of maximum increasing subsequence of the given list. */ public int MaxSumIncreasingSubsequence(List arr, int n) {","class Solution { public int MaxSumIncreasingSubsequence(List arr, int n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'MaxSumIncreasingSubsequence', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 101, 2, 3, 100, 4, 5}, 7, \n 106\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{3, 4, 5, 10}, 4, \n 22\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{10, 5, 4, 3}, 4, \n 10\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 525,MBPP/525,CSharp,Write a c# function to check whether two given lines are parallel or not.,"class Solution { /** * Write a c# function to check whether two given lines are parallel or not. */ public bool ParallelLines(List line1, List line2) {","class Solution { public bool ParallelLines(List line1, List line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ParallelLines', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List line1, List line2, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(line1, line2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{2, 3, 4}, new List{2, 3, 8}, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{2, 3, 4}, new List{4, -3, 8}, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{3, 3}, new List{5, 5}, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 526,MBPP/526,CSharp,Write a c# function to capitalize first and last letters of each word of a given string.,"class Solution { /** * Write a c# function to capitalize first and last letters of each word of a given string. */ public string CapitalizeFirstLastLetters(string str1) {","class Solution { public string CapitalizeFirstLastLetters(string str1) {",['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CapitalizeFirstLastLetters', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string str1, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(str1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""python"", \n ""PythoN""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""bigdata"", \n ""BigdatA""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""Hadoop"", \n ""HadooP""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 527,MBPP/527,CSharp,Write a function to find all pairs in an integer list whose sum is equal to a given number.,"class Solution { /** * Write a function to find all pairs in an integer list whose sum is equal to a given number. */ public int GetPairsCount(List arr, int n, int sum) {","class Solution { public int GetPairsCount(List arr, int n, int sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'GetPairsCount', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int sum, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n, sum); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 5, 7, -1, 5}, 5, 6, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 5, 7, -1}, 4, 6, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 1, 1, 1}, 4, 2, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 529,MBPP/529,CSharp,Write a function to find the nth jacobsthal-lucas number.,"class Solution { /** * Write a function to find the nth jacobsthal-lucas number. */ public int JacobsthalLucas(int n) {","class Solution { public int JacobsthalLucas(int n) {",['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'JacobsthalLucas', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 5, \n 31\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 2, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 4, \n 17\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 530,MBPP/530,CSharp,Write a function to find the ration of negative numbers in list of integers.,"class Solution { /** * Write a function to find the ration of negative numbers in list of integers. */ public float NegativeCount(List nums) {","class Solution { public float NegativeCount(List nums) {",['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'NegativeCount', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(float actual, float expected){\n return Math.Abs(actual - expected) < 1e-06f;\n }\n\n public string driver(List nums, float expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n float pred_result = solution_cls.PLACEHOLDER_FN_NAME(nums); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8}, \n 0.31f\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8}, \n 0.31f\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{2, 4, -6, -9, 11, -12, 14, -5, 17}, \n 0.44f\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 531,MBPP/531,CSharp,Write a function to find minimum number of coins that make a given value.,"class Solution { /** * Write a function to find minimum number of coins that make a given value. */ public int MinCoins(List coins, int m, int v) {","class Solution { public int MinCoins(List coins, int m, int v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'MinCoins', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List coins, int m, int v, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(coins, m, v); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{9, 6, 5, 1}, 4, 11, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{4, 5, 6, 7, 8, 9}, 6, 9, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3}, 3, 4, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 532,MBPP/532,CSharp,Write a function to check if the two given strings are permutations of each other.,"class Solution { /** * Write a function to check if the two given strings are permutations of each other. */ public bool CheckPermutation(string str1, string str2) {","class Solution { public bool CheckPermutation(string str1, string str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CheckPermutation', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string str1, string str2, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(str1, str2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""abc"", ""cba"", \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""test"", ""ttew"", \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""xxyz"", ""yxzx"", \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 534,MBPP/534,CSharp,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"class Solution { /** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ public List SearchLiteral(string pattern, string text) {","class Solution { public List SearchLiteral(string pattern, string text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SearchLiteral', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string pattern, string text, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(pattern, text); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""python"", ""python programming language"", \n new List{0, 6}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""programming"", ""python programming language"", \n new List{7, 18}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""language"", ""python programming language"", \n new List{19, 27}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 535,MBPP/535,CSharp,Write a function to find the top or bottom surface area of a cylinder.,"class Solution { /** * Write a function to find the top or bottom surface area of a cylinder. */ public decimal TopbottomSurfacearea(int r) {","class Solution { public decimal TopbottomSurfacearea(int r) {",['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'TopbottomSurfacearea', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(decimal actual, decimal expected){\n return Math.Abs(actual - expected) < 1e-09m;\n }\n\n public string driver(int r, decimal expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n decimal pred_result = solution_cls.PLACEHOLDER_FN_NAME(r); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 10, \n 314.15000000000003m\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 5, \n 78.53750000000001m\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 4, \n 50.264m\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 536,MBPP/536,CSharp,Write a function to select the nth items of a list.,"class Solution { /** * Write a function to select the nth items of a list. */ public List NthItems(List list, int n) {","class Solution { public List NthItems(List list, int n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'NthItems', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list, int n, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(list, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, \n new List{1, 3, 5, 7, 9}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{10, 15, 19, 17, 16, 18}, 3, \n new List{10, 17}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{14, 16, 19, 15, 17}, 4, \n new List{14, 17}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 537,MBPP/537,CSharp,Write a c# function to find the first repeated word in a given string.,"class Solution { /** * Write a c# function to find the first repeated word in a given string. */ public string FirstRepeatedWord(string str1) {","class Solution { public string FirstRepeatedWord(string str1) {",['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FirstRepeatedWord', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string str1, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(str1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""ab ca bc ab"", \n ""ab""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""ab ca bc"", \n ""None""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""ab ca bc ca ab bc"", \n ""ca""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 538,MBPP/538,CSharp,Write a c# function to convert a given string list to a tuple.,"class Solution { /** * Write a c# function to convert a given string list to a tuple. */ public List StringListToTuple(string str1) {","class Solution { public List StringListToTuple(string str1) {",['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'StringListToTuple', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string str1, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(str1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""python 3.0"", \n new List{\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""bigdata"", \n new List{\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""language"", \n new List{\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 539,MBPP/539,CSharp,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using dictionary function.,"class Solution { /** * Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using dictionary function. */ public List BasesnumCoresspondingnum(List bases_num, List index) {","class Solution { public List BasesnumCoresspondingnum(List bases_num, List index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'BasesnumCoresspondingnum', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List bases_num, List index, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(bases_num, index); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, new List{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, \n new List{10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5, 6, 7}, new List{10, 20, 30, 40, 50, 60, 70}, \n new List{1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{4, 8, 12, 16, 20, 24, 28}, new List{3, 6, 9, 12, 15, 18, 21}, \n new List{64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 540,MBPP/540,CSharp,Write a c# function to find the difference between highest and least frequencies in a given list.,"class Solution { /** * Write a c# function to find the difference between highest and least frequencies in a given list. */ public int FindDiff(List arr, int n) {","class Solution { public int FindDiff(List arr, int n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindDiff', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 1, 2, 2, 7, 8, 4, 5, 1, 4}, 10, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 7, 9, 2, 3, 3, 1, 3, 3}, 9, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 1, 2}, 4, \n 0\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 541,MBPP/541,CSharp,Write a function to find if the given number is abundant or not.,"class Solution { /** * Write a function to find if the given number is abundant or not. */ public bool CheckAbundant(int n) {","class Solution { public bool CheckAbundant(int n) {",['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CheckAbundant', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 12, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 15, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 18, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 542,MBPP/542,CSharp,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","class Solution { /** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ public string FillSpaces(string text) {","class Solution { public string FillSpaces(string text) {",['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FillSpaces', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string text, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(text); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""Boult Curve Wireless Neckband"", \n ""Boult:Curve:Wireless:Neckband""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""Stereo Sound Sweatproof"", \n ""Stereo:Sound:Sweatproof""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""Probass Curve Audio"", \n ""Probass:Curve:Audio""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 543,MBPP/543,CSharp,Write a function to add two numbers and print number of digits of sum.,"class Solution { /** * Write a function to add two numbers and print number of digits of sum. */ public int CountDigits(long num1, int num2) {","class Solution { public int CountDigits(long num1, int num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CountDigits', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(long num1, int num2, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(num1, num2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 9875, 10, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 98759853034, 100, \n 11\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 1234567, 500, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 545,MBPP/545,CSharp,Write a c# function to toggle only first and last bits of a given number.,"class Solution { /** * Write a c# function to toggle only first and last bits of a given number. */ public int ToggleFAndLBits(int n) {","class Solution { public int ToggleFAndLBits(int n) {",['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ToggleFAndLBits', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 10, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 15, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 20, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 546,MBPP/546,CSharp,Write a function to find the last occurrence of a character in a string.,"class Solution { /** * Write a function to find the last occurrence of a character in a string. */ public int LastOccurenceChar(string string_arg0, char char_arg1) {","class Solution { public int LastOccurenceChar(string string_arg0, char char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'LastOccurenceChar', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string string_arg0, char char_arg1, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(string_arg0, char_arg1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""hello world"", \'l\', \n 10\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""language"", \'g\', \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""little"", \'y\', \n None\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 547,MBPP/547,CSharp,Write a c# function to find the sum of hamming distances of all consecutive numbers from o to n.,"class Solution { /** * Write a c# function to find the sum of hamming distances of all consecutive numbers from o to n. */ public int TotalHammingDistance(int n) {","class Solution { public int TotalHammingDistance(int n) {",['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'TotalHammingDistance', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 4, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 2, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 5, \n 8\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 548,MBPP/548,CSharp,Write a function to find the length of the longest increasing subsequence of the given sequence.,"class Solution { /** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ public int LongestIncreasingSubsequence(List arr) {","class Solution { public int LongestIncreasingSubsequence(List arr) {",['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'LongestIncreasingSubsequence', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{10, 22, 9, 33, 21, 50, 41, 60}, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{3, 10, 2, 1, 20}, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{50, 3, 10, 7, 40, 80}, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 549,MBPP/549,CSharp,Write a c# function to find the sum of fifth power of first n odd natural numbers.,"class Solution { /** * Write a c# function to find the sum of fifth power of first n odd natural numbers. */ public int OddNumSum(int n) {","class Solution { public int OddNumSum(int n) {",['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'OddNumSum', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 1, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 2, \n 244\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 3, \n 3369\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 550,MBPP/550,CSharp,Write a c# function to find the maximum element in a sorted and rotated list.,"class Solution { /** * Write a c# function to find the maximum element in a sorted and rotated list. */ public int FindMax(List arr, int low, int high) {","class Solution { public int FindMax(List arr, int low, int high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindMax', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int low, int high, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, low, high); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{2, 3, 5, 6, 9}, 0, 4, \n 9\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{3, 4, 5, 2, 1}, 0, 4, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3}, 0, 2, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 551,MBPP/551,CSharp,Write a function to extract a specified column from a given nested list.,"class Solution { /** * Write a function to extract a specified column from a given nested list. */ public List ExtractColumn(List> list1, int n) {","class Solution { public List ExtractColumn(List> list1, int n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ExtractColumn', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List> list1, int n, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List>{new List{1, 2, 3}, new List{2, 4, 5}, new List{1, 1, 1}}, 0, \n new List{1, 2, 1}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{1, 2, 3}, new List{-2, 4, -5}, new List{1, -1, 1}}, 2, \n new List{3, -5, 1}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{1, 3}, new List{5, 7}, new List{1, 3}, new List{13, 15, 17}, new List{5, 7}, new List{9, 11}}, 0, \n new List{1, 5, 1, 13, 5, 9}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 552,MBPP/552,CSharp,Write a c# function to check whether a given sequence is linear or not.,"class Solution { /** * Write a c# function to check whether a given sequence is linear or not. */ public string SeqLinear(List seq_nums) {","class Solution { public string SeqLinear(List seq_nums) {",['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SeqLinear', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List seq_nums, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(seq_nums); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{0, 2, 4, 6, 8, 10}, \n ""Linear Sequence""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3}, \n ""Linear Sequence""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 5, 2}, \n ""Non Linear Sequence""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 553,MBPP/553,CSharp,Write a function to convert the given tuple to a floating-point number.,"class Solution { /** * Write a function to convert the given tuple to a floating-point number. */ public float TupleToFloat(List test_tup) {","class Solution { public float TupleToFloat(List test_tup) {",['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'TupleToFloat', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(float actual, float expected){\n return Math.Abs(actual - expected) < 1e-06f;\n }\n\n public string driver(List test_tup, float expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n float pred_result = solution_cls.PLACEHOLDER_FN_NAME(test_tup); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{4, 56}, \n 4.56f\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{7, 256}, \n 7.256f\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{8, 123}, \n 8.123f\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 554,MBPP/554,CSharp,Write a c# function to find odd numbers from a mixed list.,"class Solution { /** * Write a c# function to find odd numbers from a mixed list. */ public List Split(List list) {","class Solution { public List Split(List list) {",['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'Split', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(list); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 4, 5, 6}, \n new List{1, 3, 5}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{10, 11, 12, 13}, \n new List{11, 13}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{7, 8, 9, 1}, \n new List{7, 9, 1}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 555,MBPP/555,CSharp,Write a c# function to find the Difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"class Solution { /** * Write a c# function to find the Difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ public int Difference(int n) {","class Solution { public int Difference(int n) {",['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'Difference', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 3, \n 30\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 5, \n 210\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 2, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 556,MBPP/556,CSharp,Write a c# function to count the pairs with xor as an odd number.,"class Solution { /** * Write a c# function to count the pairs with xor as an odd number. */ public int FindOddPair(List a, int n) {","class Solution { public int FindOddPair(List a, int n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindOddPair', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List a, int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{5, 4, 7, 2, 1}, 5, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{7, 2, 8, 1, 0, 5, 11}, 7, \n 12\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3}, 3, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 557,MBPP/557,CSharp,Write a function to toggle characters case in a string.,"class Solution { /** * Write a function to toggle characters case in a string. */ public string ToggleString(string string_arg0) {","class Solution { public string ToggleString(string string_arg0) {",['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ToggleString', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string string_arg0, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(string_arg0); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""Python"", \n ""pYTHON""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""Pangram"", \n ""pANGRAM""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""LIttLE"", \n ""liTTle""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 558,MBPP/558,CSharp,Write a c# function to find the digit distance between two integers.,"class Solution { /** * Write a c# function to find the digit distance between two integers. */ public int DigitDistanceNums(int n1, int n2) {","class Solution { public int DigitDistanceNums(int n1, int n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'DigitDistanceNums', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n1, int n2, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n1, n2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 1, 2, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 23, 56, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 123, 256, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 559,MBPP/559,CSharp,Write a function to find the largest sum of contiguous subarray in the given list.,"class Solution { /** * Write a function to find the largest sum of contiguous subarray in the given list. */ public int MaxSubArraySum(List a, int size) {","class Solution { public int MaxSubArraySum(List a, int size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'MaxSubArraySum', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List a, int size, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, size); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{-2, -3, 4, -1, -2, 1, 5, -3}, 8, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{-3, -4, 5, -2, -3, 2, 6, -4}, 8, \n 8\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{-4, -5, 6, -3, -4, 3, 7, -5}, 8, \n 10\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 560,MBPP/560,CSharp,Write a function to find the union of elements of the given tuples.,"class Solution { /** * Write a function to find the union of elements of the given tuples. */ public List UnionElements(List test_tup1, List test_tup2) {","class Solution { public List UnionElements(List test_tup1, List test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'UnionElements', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List test_tup1, List test_tup2, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(test_tup1, test_tup2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{3, 4, 5, 6}, new List{5, 7, 4, 10}, \n new List{3, 4, 5, 6, 7, 10}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4}, new List{3, 4, 5, 6}, \n new List{1, 2, 3, 4, 5, 6}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{11, 12, 13, 14}, new List{13, 15, 16, 17}, \n new List{11, 12, 13, 14, 15, 16, 17}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 562,MBPP/562,CSharp,Write a c# function to find the maximum length of sublist.,"class Solution { /** * Write a c# function to find the maximum length of sublist. */ public int FindMaxLength(List> lst) {","class Solution { public int FindMaxLength(List> lst) {",['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindMaxLength', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List> lst, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(lst); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List>{new List{1}, new List{1, 4}, new List{5, 6, 7, 8}}, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{0, 1}, new List{2, 2}, new List{3, 2, 1}}, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{7}, new List{22, 23}, new List{13, 14, 15}, new List{10, 20, 30, 40, 50}}, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 563,MBPP/563,CSharp,Write a function to extract values between quotation marks of a string.,"class Solution { /** * Write a function to extract values between quotation marks of a string. */ public List ExtractValues(string text) {","class Solution { public List ExtractValues(string text) {",['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ExtractValues', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string text, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(text); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", \n new List{""Python"", ""PHP"", ""Java""}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""\\""python\\"",\\""program\\"",\\""language\\"""", \n new List{""python"", ""program"", ""language""}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", \n new List{""red"", ""blue"", ""green"", ""yellow""}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 564,MBPP/564,CSharp,Write a c# function to count unequal element pairs from the given list.,"class Solution { /** * Write a c# function to count unequal element pairs from the given list. */ public int CountPairs(List arr, int n) {","class Solution { public int CountPairs(List arr, int n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CountPairs', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 1}, 3, \n 2\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 1, 1, 1}, 4, \n 0\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5}, 5, \n 10\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 565,MBPP/565,CSharp,Write a c# function to Split a string into characters.,"class Solution { /** * Write a c# function to Split a string into characters. */ public List Split(string word) {","class Solution { public List Split(string word) {",['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'Split', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string word, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(word); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""python"", \n new List{\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""Name"", \n new List{\'N\', \'a\', \'m\', \'e\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""program"", \n new List{\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 566,MBPP/566,CSharp,Write a function to get the sum of a non-negative integer.,"class Solution { /** * Write a function to get the sum of a non-negative integer. */ public int SumDigits(int n) {","class Solution { public int SumDigits(int n) {",['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SumDigits', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 345, \n 12\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 12, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 97, \n 16\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 567,MBPP/567,CSharp,Write a function to check whether a specified list is sorted or not.,"class Solution { /** * Write a function to check whether a specified list is sorted or not. */ public bool IssortList(List list1) {","class Solution { public bool IssortList(List list1) {",['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'IssortList', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list1, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 4, 6, 8, 10, 12, 14, 16, 17}, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 4, 6, 8, 10, 12, 14, 20, 17}, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 4, 6, 8, 10, 15, 14, 20}, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 569,MBPP/569,CSharp,Write a function to sort each sublist of strings in a given list of lists.,"class Solution { /** * Write a function to sort each sublist of strings in a given list of lists. */ public List> SortSublists(List> list1) {","class Solution { public List> SortSublists(List> list1) {",['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SortSublists', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List> actual, List> expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List> list1, List> expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List> pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List>{new List{""green"", ""orange""}, new List{""black"", ""white""}, new List{""white"", ""black"", ""orange""}}, \n new List>{new List{""green"", ""orange""}, new List{""black"", ""white""}, new List{""black"", ""orange"", ""white""}}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{""green"", ""orange""}, new List{""black""}, new List{""green"", ""orange""}, new List{""white""}}, \n new List>{new List{""green"", ""orange""}, new List{""black""}, new List{""green"", ""orange""}, new List{""white""}}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List>{new List{""a"", ""b""}, new List{""d"", ""c""}, new List{""g"", ""h""}, new List{""f"", ""e""}}, \n new List>{new List{""a"", ""b""}, new List{""c"", ""d""}, new List{""g"", ""h""}, new List{""e"", ""f""}}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 570,MBPP/570,CSharp,Write a function to remove words from a given list of strings containing a character or string.,"class Solution { /** * Write a function to remove words from a given list of strings containing a character or string. */ public List RemoveWords(List list1, List charlist) {","class Solution { public List RemoveWords(List list1, List charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'RemoveWords', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list1, List charlist, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1, charlist); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""}, new List{""#"", ""color"", ""@""}, \n new List{""Red"", """", ""Green"", ""Orange"", ""White""}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, new List{""&"", ""+"", ""@""}, \n new List{""Red"", """", ""Green"", ""Orange"", ""White""}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, new List{""@""}, \n new List{""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 571,MBPP/571,CSharp,Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k.,"class Solution { /** * Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k. */ public int MaxSumPairDiffLessthanK(List arr, int n, int k) {","class Solution { public int MaxSumPairDiffLessthanK(List arr, int n, int k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'MaxSumPairDiffLessthanK', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr, int n, int k, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr, n, k); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{3, 5, 10, 15, 17, 12, 9}, 7, 4, \n 62\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{5, 15, 10, 300}, 4, 12, \n 25\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5, 6}, 6, 6, \n 21\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 572,MBPP/572,CSharp,Write a c# function to remove two duplicate numbers from a given number of lists.,"class Solution { /** * Write a c# function to remove two duplicate numbers from a given number of lists. */ public List TwoUniqueNums(List nums) {","class Solution { public List TwoUniqueNums(List nums) {",['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'TwoUniqueNums', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List nums, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(nums); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 2, 3, 4, 5}, \n new List{1, 4, 5}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 2, 4, 5}, \n new List{1, 3, 4, 5}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5}, \n new List{1, 2, 3, 4, 5}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 573,MBPP/573,CSharp,Write a c# function to calculate the product of the unique numbers of a given list.,"class Solution { /** * Write a c# function to calculate the product of the unique numbers of a given list. */ public int UniqueProduct(List list_data) {","class Solution { public int UniqueProduct(List list_data) {",['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'UniqueProduct', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list_data, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(list_data); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{10, 20, 30, 40, 20, 50, 60, 40}, \n 720000000\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 1}, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{7, 8, 9, 0, 1, 1}, \n 0\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 574,MBPP/574,CSharp,Write a function to find the surface area of a cylinder.,"class Solution { /** * Write a function to find the surface area of a cylinder. */ public decimal SurfaceareaCylinder(int r, int h) {","class Solution { public decimal SurfaceareaCylinder(int r, int h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SurfaceareaCylinder', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(decimal actual, decimal expected){\n return Math.Abs(actual - expected) < 1e-09m;\n }\n\n public string driver(int r, int h, decimal expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n decimal pred_result = solution_cls.PLACEHOLDER_FN_NAME(r, h); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 10, 5, \n 942.45m\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 4, 5, \n 226.18800000000002m\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 4, 10, \n 351.848m\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 575,MBPP/575,CSharp,Write a c# function to find nth number in a sequence which is not a multiple of a given number.,"class Solution { /** * Write a c# function to find nth number in a sequence which is not a multiple of a given number. */ public int CountNo(int a, int n, int l, int r) {","class Solution { public int CountNo(int a, int n, int l, int r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CountNo', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int a, int n, int l, int r, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, n, l, r); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 2, 3, 1, 10, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 3, 6, 4, 20, \n 11\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 5, 10, 4, 20, \n 16\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 576,MBPP/576,CSharp,Write a c# function to check whether list is subarray of another or not.,"class Solution { /** * Write a c# function to check whether list is subarray of another or not. */ public bool IsSubArray(List a, List b, int n, int m) {","class Solution { public bool IsSubArray(List a, List b, int n, int m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'IsSubArray', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List a, List b, int n, int m, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, b, n, m); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 4, 3, 5}, new List{1, 2}, 4, 2, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 1}, new List{1, 2, 1}, 3, 3, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 0, 2, 2}, new List{2, 2, 0}, 4, 3, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 577,MBPP/577,CSharp,Write a c# function to find the last digit in factorial of a given number.,"class Solution { /** * Write a c# function to find the last digit in factorial of a given number. */ public int LastDigitFactorial(int n) {","class Solution { public int LastDigitFactorial(int n) {",['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'LastDigitFactorial', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 4, \n 4\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 21, \n 0\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 30, \n 0\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 578,MBPP/578,CSharp,Write a function to interleave lists of the same length.,"class Solution { /** * Write a function to interleave lists of the same length. */ public List InterleaveLists(List list1, List list2, List list3) {","class Solution { public List InterleaveLists(List list1, List list2, List list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'InterleaveLists', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list1, List list2, List list3, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1, list2, list3); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 4, 5, 6, 7}, new List{10, 20, 30, 40, 50, 60, 70}, new List{100, 200, 300, 400, 500, 600, 700}, \n new List{1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{10, 20}, new List{15, 2}, new List{5, 10}, \n new List{10, 15, 5, 20, 2, 10}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{11, 44}, new List{10, 15}, new List{20, 5}, \n new List{11, 10, 20, 44, 15, 5}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 579,MBPP/579,CSharp,Write a function to find the dissimilar elements in the given two tuples.,"class Solution { /** * Write a function to find the dissimilar elements in the given two tuples. */ public List FindDissimilar(List test_tup1, List test_tup2) {","class Solution { public List FindDissimilar(List test_tup1, List test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindDissimilar', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List test_tup1, List test_tup2, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(test_tup1, test_tup2); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{3, 4, 5, 6}, new List{5, 7, 4, 10}, \n new List{3, 6, 7, 10}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4}, new List{7, 2, 3, 9}, \n new List{1, 4, 7, 9}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{21, 11, 25, 26}, new List{26, 34, 21, 36}, \n new List{34, 36, 11, 25}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 581,MBPP/581,CSharp,Write a c# function to find the surface area of the square pyramid.,"class Solution { /** * Write a c# function to find the surface area of the square pyramid. */ public int SurfaceArea(int b, int s) {","class Solution { public int SurfaceArea(int b, int s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SurfaceArea', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int b, int s, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(b, s); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 3, 4, \n 33\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 4, 5, \n 56\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 1, 2, \n 5\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 583,MBPP/583,CSharp,Write a function for nth catalan number.,"class Solution { /** * Write a function for nth catalan number. */ public int CatalanNumber(int num) {","class Solution { public int CatalanNumber(int num) {",['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'CatalanNumber', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int num, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(num); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 10, \n 16796\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 9, \n 4862\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 7, \n 429\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 584,MBPP/584,CSharp,Write a function to find all adverbs and their positions in a given sentence by using regex.,"class Solution { /** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ public string FindAdverbs(string text) {","class Solution { public string FindAdverbs(string text) {",['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindAdverbs', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string text, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(text); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""Clearly, he has no excuse for such behavior."", \n ""0-7: Clearly""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""Please handle the situation carefuly"", \n ""28-36: carefuly""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""Complete the task quickly"", \n ""18-25: quickly""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 586,MBPP/586,CSharp,Write a c# function to split the list and add the first part to the end.,"class Solution { /** * Write a c# function to split the list and add the first part to the end. */ public List SplitArr(List a, int n, int k) {","class Solution { public List SplitArr(List a, int n, int k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SplitArr', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List a, int n, int k, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, n, k); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{12, 10, 5, 6, 52, 36}, 6, 2, \n new List{5, 6, 52, 36, 12, 10}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4}, 4, 1, \n new List{2, 3, 4, 1}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{0, 1, 2, 3, 4, 5, 6, 7}, 8, 3, \n new List{3, 4, 5, 6, 7, 0, 1, 2}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 587,MBPP/587,CSharp,Write a function to convert a list to a tuple.,"class Solution { /** * Write a function to convert a list to a tuple. */ public List ListTuple(List listx) {","class Solution { public List ListTuple(List listx) {",['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ListTuple', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List listx, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(listx); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{5, 10, 7, 4, 15, 3}, \n new List{5, 10, 7, 4, 15, 3}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{2, 4, 5, 6, 2, 3, 4, 4, 7}, \n new List{2, 4, 5, 6, 2, 3, 4, 4, 7}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{58, 44, 56}, \n new List{58, 44, 56}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 588,MBPP/588,CSharp,Write a c# function to find the difference between largest and smallest value in a given list.,"class Solution { /** * Write a c# function to find the difference between largest and smallest value in a given list. */ public int BigDiff(List nums) {","class Solution { public int BigDiff(List nums) {",['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'BigDiff', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List nums, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(nums); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 2, 3, 4}, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{4, 5, 12}, \n 8\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{9, 2, 3}, \n 7\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 589,MBPP/589,CSharp,Write a function to find perfect squares between two given numbers.,"class Solution { /** * Write a function to find perfect squares between two given numbers. */ public List PerfectSquares(int a, int b) {","class Solution { public List PerfectSquares(int a, int b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'PerfectSquares', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int a, int b, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(a, b); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 1, 30, \n new List{1, 4, 9, 16, 25}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 50, 100, \n new List{64, 81, 100}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 100, 200, \n new List{100, 121, 144, 169, 196}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 591,MBPP/591,CSharp,Write a c# function to interchange the first and last elements in a list.,"class Solution { /** * Write a c# function to interchange the first and last elements in a list. */ public List SwapList(List newlist) {","class Solution { public List SwapList(List newlist) {",['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SwapList', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(List actual, List expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List newlist, List expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n List pred_result = solution_cls.PLACEHOLDER_FN_NAME(newlist); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{12, 35, 9, 56, 24}, \n new List{24, 35, 9, 56, 12}\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3}, \n new List{3, 2, 1}\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{4, 5, 6}, \n new List{6, 5, 4}\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 592,MBPP/592,CSharp,Write a c# function to find sum of product of binomial co-efficients.,"class Solution { /** * Write a c# function to find sum of product of binomial co-efficients. */ public int SumOfProduct(int n) {","class Solution { public int SumOfProduct(int n) {",['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'SumOfProduct', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 3, \n 15\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 4, \n 56\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 1, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 593,MBPP/593,CSharp,Write a function to remove leading zeroes from an ip address.,"class Solution { /** * Write a function to remove leading zeroes from an ip address. */ public string RemovezeroIp(string ip) {","class Solution { public string RemovezeroIp(string ip) {",['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'RemovezeroIp', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(string actual, string expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(string ip, string expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n string pred_result = solution_cls.PLACEHOLDER_FN_NAME(ip); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n ""216.08.094.196"", \n ""216.8.94.196""\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n ""12.01.024"", \n ""12.1.24""\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n ""216.08.094.0196"", \n ""216.8.94.196""\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 594,MBPP/594,CSharp,Write a function to find the difference of first even and odd number of a given list.,"class Solution { /** * Write a function to find the difference of first even and odd number of a given list. */ public int DiffEvenOdd(List list1) {","class Solution { public int DiffEvenOdd(List list1) {",['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'DiffEvenOdd', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List list1, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(list1); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{1, 3, 5, 7, 4, 1, 6, 8}, \n 3\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, \n 1\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{1, 5, 7, 9, 10}, \n 9\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 597,MBPP/597,CSharp,Write a function to find kth element from the given two sorted lists.,"class Solution { /** * Write a function to find kth element from the given two sorted lists. */ public int FindKth(List arr1, List arr2, int m, int n, int k) {","class Solution { public int FindKth(List arr1, List arr2, int m, int n, int k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'FindKth', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(int actual, int expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(List arr1, List arr2, int m, int n, int k, int expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n int pred_result = solution_cls.PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n new List{2, 3, 6, 7, 9}, new List{1, 4, 8, 10}, 5, 4, 5, \n 6\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n new List{100, 112, 256, 349, 770}, new List{72, 86, 113, 119, 265, 445, 892}, 5, 7, 7, \n 256\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n new List{3, 4, 7, 8, 10}, new List{2, 5, 9, 11}, 5, 4, 6, \n 8\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 598,MBPP/598,CSharp,Write a function to check whether the given number is armstrong or not.,"class Solution { /** * Write a function to check whether the given number is armstrong or not. */ public bool ArmstrongNumber(int number) {","class Solution { public bool ArmstrongNumber(int number) {",['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'ArmstrongNumber', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int number, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(number); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 153, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 259, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 4458, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 600,MBPP/600,CSharp,Write a c# function to check whether the given number is even or not using bitwise operator.,"class Solution { /** * Write a c# function to check whether the given number is even or not using bitwise operator. */ public bool IsEven(int n) {","class Solution { public bool IsEven(int n) {",['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'cs', 'entry_fn_name': 'IsEven', 'test_code': 'using System;\nusing System.Numerics;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Security.Cryptography;\nusing System.Web.UI;\nusing System.Web.Script.Serialization;\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nnamespace EvaluatePrediction {\n class TestRunner {\n public bool ValidateSolution(bool actual, bool expected){\n return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);\n }\n\n public string driver(int n, bool expected){\n try{\n PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();\n bool pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); \n if (ValidateSolution(\n pred_result,\n expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } \n catch (Exception exception_obj)\n {\n return exception_obj.GetType().FullName;\n }\n }\n static void Main(string[] args) {\n TestRunner runner = new TestRunner();\n String result;\n result = runner.driver(\n 1, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-0...{0}"",\n result)\n );result = runner.driver(\n 2, \n true\n );\n Console.WriteLine(string.Format(\n ""TEST-1...{0}"",\n result)\n );result = runner.driver(\n 3, \n false\n );\n Console.WriteLine(string.Format(\n ""TEST-2...{0}"",\n result)\n );\n }\n }\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['mono-csc', '-r:System.Web.dll', '-r:System.Web.Extensions.dll', '__FILENAME__', '-o', 'main.exe'], ['mono', 'main.exe']], 'timeouts': [10, 10]}" 511,MBPP/511,Dart,Write a dart function to find minimum sum of factors of a given number.,"/// Write a dart function to find minimum sum of factors of a given number. findMinSum(num) {",findMinSum(num) {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findMinSum', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 12, \n 7)\n }"");\n\n print(""TEST-1...${driver(\n 105, \n 15)\n }"");\n\n print(""TEST-2...${driver(\n 2, \n 2)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,Dart,Write a function to find the summation of tuple elements in the given tuple vector.,"/// Write a function to find the summation of tuple elements in the given tuple vector. sumElements(test_tup) {",sumElements(test_tup) {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'sumElements', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(test_tup, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [7, 8, 9, 1, 10, 7], \n 42)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4, 5, 6], \n 21)\n }"");\n\n print(""TEST-2...${driver(\n [11, 12, 13, 45, 14], \n 95)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,Dart,Write a function to check if there is a subset with sum divisible by m.,"/// Write a function to check if there is a subset with sum divisible by m. modularSum(arr, n, m) {","modularSum(arr, n, m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'modularSum', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, m, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [3, 1, 7, 5], 4, 6, \n true)\n }"");\n\n print(""TEST-1...${driver(\n [1, 7], 2, 5, \n false)\n }"");\n\n print(""TEST-2...${driver(\n [1, 6], 2, 5, \n false)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,Dart,Write a function to sort vector of elements using radix sort.,"/// Write a function to sort vector of elements using radix sort. radixSort(nums) {",radixSort(nums) {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'radixSort', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(nums, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [15, 79, 25, 68, 37], \n [15, 25, 37, 68, 79])\n }"");\n\n print(""TEST-1...${driver(\n [9, 11, 8, 7, 3, 2], \n [2, 3, 7, 8, 9, 11])\n }"");\n\n print(""TEST-2...${driver(\n [36, 12, 24, 26, 29], \n [12, 24, 26, 29, 36])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,Dart,Write a dart function to find the largest postive number from the given vector.,"/// Write a dart function to find the largest postive number from the given vector. largestPos(list1) {",largestPos(list1) {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'largestPos', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 4, -1], \n 4)\n }"");\n\n print(""TEST-1...${driver(\n [0, 1, 2, -5, -1, 6], \n 6)\n }"");\n\n print(""TEST-2...${driver(\n [0, 0, 1, 0], \n 1)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,Dart,Write a function to find the square root of a perfect number.,"/// Write a function to find the square root of a perfect number. sqrtRoot(num) {",sqrtRoot(num) {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'sqrtRoot', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 4, \n 2)\n }"");\n\n print(""TEST-1...${driver(\n 16, \n 4)\n }"");\n\n print(""TEST-2...${driver(\n 400, \n 20)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,Dart,Write a function to calculate volume of a tetrahedron.,"/// Write a function to calculate volume of a tetrahedron. volumeTetrahedron(num) {",volumeTetrahedron(num) {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return (actual - expected).abs() < 1e-06;\n}\n\nString driver(num, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 10, \n 117.85)\n }"");\n\n print(""TEST-1...${driver(\n 15, \n 397.75)\n }"");\n\n print(""TEST-2...${driver(\n 20, \n 942.81)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,Dart,Write a function to find the lcm of the given vector elements.,"/// Write a function to find the lcm of the given vector elements. getLcm(l) {",getLcm(l) {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'getLcm', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(l, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(l), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [2, 7, 3, 9, 4], \n 252)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 8, 3], \n 24)\n }"");\n\n print(""TEST-2...${driver(\n [3, 8, 4, 10, 5], \n 120)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,Dart,Write a function to print check if the triangle is scalene or not.,"/// Write a function to print check if the triangle is scalene or not. checkIsosceles(x, y, z) {","checkIsosceles(x, y, z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'checkIsosceles', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(x, y, z, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 6, 8, 12, \n true)\n }"");\n\n print(""TEST-1...${driver(\n 6, 6, 12, \n false)\n }"");\n\n print(""TEST-2...${driver(\n 6, 15, 20, \n true)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,Dart,Write a function to find the longest bitonic subsequence for the given vector.,"/// Write a function to find the longest bitonic subsequence for the given vector. lbs(arr) {",lbs(arr) {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'lbs', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], \n 7)\n }"");\n\n print(""TEST-1...${driver(\n [1, 11, 2, 10, 4, 5, 2, 1], \n 6)\n }"");\n\n print(""TEST-2...${driver(\n [80, 60, 30, 40, 20, 10], \n 5)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,Dart,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. checkString(str1) {",checkString(str1) {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'checkString', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(str1, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""python"", \n [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""])\n }"");\n\n print(""TEST-1...${driver(\n ""123python"", \n [""String must have 1 upper case character.""])\n }"");\n\n print(""TEST-2...${driver(\n ""123Python"", \n [""Valid string.""])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,Dart,Write a function to find the sum of maximum increasing subsequence of the given vector.,"/// Write a function to find the sum of maximum increasing subsequence of the given vector. maxSumIncreasingSubsequence(arr, n) {","maxSumIncreasingSubsequence(arr, n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 101, 2, 3, 100, 4, 5], 7, \n 106)\n }"");\n\n print(""TEST-1...${driver(\n [3, 4, 5, 10], 4, \n 22)\n }"");\n\n print(""TEST-2...${driver(\n [10, 5, 4, 3], 4, \n 10)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,Dart,Write a dart function to check whether two given lines are parallel or not.,"/// Write a dart function to check whether two given lines are parallel or not. parallelLines(line1, line2) {","parallelLines(line1, line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'parallelLines', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(line1, line2, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [2, 3, 4], [2, 3, 8], \n true)\n }"");\n\n print(""TEST-1...${driver(\n [2, 3, 4], [4, -3, 8], \n false)\n }"");\n\n print(""TEST-2...${driver(\n [3, 3], [5, 5], \n true)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,Dart,Write a dart function to capitalize first and last letters of each word of a given string.,"/// Write a dart function to capitalize first and last letters of each word of a given string. capitalizeFirstLastLetters(str1) {",capitalizeFirstLastLetters(str1) {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(str1, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""python"", \n ""PythoN"")\n }"");\n\n print(""TEST-1...${driver(\n ""bigdata"", \n ""BigdatA"")\n }"");\n\n print(""TEST-2...${driver(\n ""Hadoop"", \n ""HadooP"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,Dart,Write a function to find all pairs in an integer vector whose sum is equal to a given number.,"/// Write a function to find all pairs in an integer vector whose sum is equal to a given number. getPairsCount(arr, n, sum) {","getPairsCount(arr, n, sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'getPairsCount', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, sum, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 5, 7, -1, 5], 5, 6, \n 3)\n }"");\n\n print(""TEST-1...${driver(\n [1, 5, 7, -1], 4, 6, \n 2)\n }"");\n\n print(""TEST-2...${driver(\n [1, 1, 1, 1], 4, 2, \n 6)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,Dart,Write a function to find the nth jacobsthal-lucas number.,"/// Write a function to find the nth jacobsthal-lucas number. jacobsthalLucas(n) {",jacobsthalLucas(n) {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 5, \n 31)\n }"");\n\n print(""TEST-1...${driver(\n 2, \n 5)\n }"");\n\n print(""TEST-2...${driver(\n 4, \n 17)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,Dart,Write a function to find the ration of negative numbers in vector of integers.,"/// Write a function to find the ration of negative numbers in vector of integers. negativeCount(nums) {",negativeCount(nums) {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'negativeCount', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return (actual - expected).abs() < 1e-06;\n}\n\nString driver(nums, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], \n 0.31)\n }"");\n\n print(""TEST-1...${driver(\n [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8], \n 0.31)\n }"");\n\n print(""TEST-2...${driver(\n [2, 4, -6, -9, 11, -12, 14, -5, 17], \n 0.44)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,Dart,Write a function to find minimum number of coins that make a given value.,"/// Write a function to find minimum number of coins that make a given value. minCoins(coins, m, v) {","minCoins(coins, m, v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'minCoins', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(coins, m, v, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [9, 6, 5, 1], 4, 11, \n 2)\n }"");\n\n print(""TEST-1...${driver(\n [4, 5, 6, 7, 8, 9], 6, 9, \n 1)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3], 3, 4, \n 2)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,Dart,Write a function to check if the two given strings are permutations of each other.,"/// Write a function to check if the two given strings are permutations of each other. checkPermutation(str1, str2) {","checkPermutation(str1, str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'checkPermutation', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(str1, str2, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""abc"", ""cba"", \n true)\n }"");\n\n print(""TEST-1...${driver(\n ""test"", ""ttew"", \n false)\n }"");\n\n print(""TEST-2...${driver(\n ""xxyz"", ""yxzx"", \n true)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,Dart,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. searchLiteral(pattern, text) {","searchLiteral(pattern, text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'searchLiteral', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(pattern, text, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""python"", ""python programming language"", \n [0, 6])\n }"");\n\n print(""TEST-1...${driver(\n ""programming"", ""python programming language"", \n [7, 18])\n }"");\n\n print(""TEST-2...${driver(\n ""language"", ""python programming language"", \n [19, 27])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,Dart,Write a function to find the top or bottom surface area of a cylinder.,"/// Write a function to find the top or bottom surface area of a cylinder. topbottomSurfacearea(r) {",topbottomSurfacearea(r) {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return (actual - expected).abs() < 1e-09;\n}\n\nString driver(r, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(r), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 10, \n 314.15000000000003)\n }"");\n\n print(""TEST-1...${driver(\n 5, \n 78.53750000000001)\n }"");\n\n print(""TEST-2...${driver(\n 4, \n 50.264)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,Dart,Write a function to select the nth items of vector.,"/// Write a function to select the nth items of vector. nthItems(list, n) {","nthItems(list, n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'nthItems', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list, n, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 4, 5, 6, 7, 8, 9], 2, \n [1, 3, 5, 7, 9])\n }"");\n\n print(""TEST-1...${driver(\n [10, 15, 19, 17, 16, 18], 3, \n [10, 17])\n }"");\n\n print(""TEST-2...${driver(\n [14, 16, 19, 15, 17], 4, \n [14, 17])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,Dart,Write a dart function to find the first repeated word in a given string.,"/// Write a dart function to find the first repeated word in a given string. firstRepeatedWord(str1) {",firstRepeatedWord(str1) {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(str1, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""ab ca bc ab"", \n ""ab"")\n }"");\n\n print(""TEST-1...${driver(\n ""ab ca bc"", \n ""None"")\n }"");\n\n print(""TEST-2...${driver(\n ""ab ca bc ca ab bc"", \n ""ca"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,Dart,Write a dart function to convert a given string vector to a tuple.,"/// Write a dart function to convert a given string vector to a tuple. stringListToTuple(str1) {",stringListToTuple(str1) {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'stringListToTuple', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(str1, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""python 3.0"", \n [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'])\n }"");\n\n print(""TEST-1...${driver(\n ""bigdata"", \n [\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'])\n }"");\n\n print(""TEST-2...${driver(\n ""language"", \n [\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,Dart,Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function.,"/// Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function. basesnumCoresspondingnum(bases_num, index) {","basesnumCoresspondingnum(bases_num, index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(bases_num, index, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], \n [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], \n [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249])\n }"");\n\n print(""TEST-2...${driver(\n [4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21], \n [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,Dart,Write a dart function to find the difference between highest and least frequencies in a given vector.,"/// Write a dart function to find the difference between highest and least frequencies in a given vector. findDiff(arr, n) {","findDiff(arr, n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findDiff', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10, \n 2)\n }"");\n\n print(""TEST-1...${driver(\n [1, 7, 9, 2, 3, 3, 1, 3, 3], 9, \n 3)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 1, 2], 4, \n 0)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,Dart,Write a function to find if the given number is abundant or not.,"/// Write a function to find if the given number is abundant or not. checkAbundant(n) {",checkAbundant(n) {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'checkAbundant', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 12, \n true)\n }"");\n\n print(""TEST-1...${driver(\n 15, \n false)\n }"");\n\n print(""TEST-2...${driver(\n 18, \n true)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,Dart,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. fillSpaces(text) {",fillSpaces(text) {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'fillSpaces', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(text, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""Boult Curve Wireless Neckband"", \n ""Boult:Curve:Wireless:Neckband"")\n }"");\n\n print(""TEST-1...${driver(\n ""Stereo Sound Sweatproof"", \n ""Stereo:Sound:Sweatproof"")\n }"");\n\n print(""TEST-2...${driver(\n ""Probass Curve Audio"", \n ""Probass:Curve:Audio"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,Dart,Write a function to add two numbers and print number of digits of sum.,"/// Write a function to add two numbers and print number of digits of sum. countDigits(num1, num2) {","countDigits(num1, num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'countDigits', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(num1, num2, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 9875, 10, \n 4)\n }"");\n\n print(""TEST-1...${driver(\n 98759853034, 100, \n 11)\n }"");\n\n print(""TEST-2...${driver(\n 1234567, 500, \n 7)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,Dart,Write a dart function to toggle only first and last bits of a given number.,"/// Write a dart function to toggle only first and last bits of a given number. toggleFAndLBits(n) {",toggleFAndLBits(n) {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 10, \n 3)\n }"");\n\n print(""TEST-1...${driver(\n 15, \n 6)\n }"");\n\n print(""TEST-2...${driver(\n 20, \n 5)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,Dart,Write a function to find the last occurrence of a character in a string.,"/// Write a function to find the last occurrence of a character in a string. lastOccurenceChar(string_arg0, char_arg1) {","lastOccurenceChar(string_arg0, char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(string_arg0, char_arg1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""hello world"", \'l\', \n 10)\n }"");\n\n print(""TEST-1...${driver(\n ""language"", \'g\', \n 7)\n }"");\n\n print(""TEST-2...${driver(\n ""little"", \'y\', \n None)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,Dart,Write a dart function to find the sum of hamming distances of all consecutive numbers from o to n.,"/// Write a dart function to find the sum of hamming distances of all consecutive numbers from o to n. totalHammingDistance(n) {",totalHammingDistance(n) {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 4, \n 7)\n }"");\n\n print(""TEST-1...${driver(\n 2, \n 3)\n }"");\n\n print(""TEST-2...${driver(\n 5, \n 8)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,Dart,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/// Write a function to find the length of the longest increasing subsequence of the given sequence. longestIncreasingSubsequence(arr) {",longestIncreasingSubsequence(arr) {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [10, 22, 9, 33, 21, 50, 41, 60], \n 5)\n }"");\n\n print(""TEST-1...${driver(\n [3, 10, 2, 1, 20], \n 3)\n }"");\n\n print(""TEST-2...${driver(\n [50, 3, 10, 7, 40, 80], \n 4)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,Dart,Write a dart function to find the sum of fifth power of first n odd natural numbers.,"/// Write a dart function to find the sum of fifth power of first n odd natural numbers. oddNumSum(n) {",oddNumSum(n) {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'oddNumSum', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 1, \n 1)\n }"");\n\n print(""TEST-1...${driver(\n 2, \n 244)\n }"");\n\n print(""TEST-2...${driver(\n 3, \n 3369)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,Dart,Write a dart function to find the maximum element in a sorted and rotated vector.,"/// Write a dart function to find the maximum element in a sorted and rotated vector. findMax(arr, low, high) {","findMax(arr, low, high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findMax', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, low, high, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [2, 3, 5, 6, 9], 0, 4, \n 9)\n }"");\n\n print(""TEST-1...${driver(\n [3, 4, 5, 2, 1], 0, 4, \n 5)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3], 0, 2, \n 3)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,Dart,Write a function to extract a specified column from a given nested vector.,"/// Write a function to extract a specified column from a given nested vector. extractColumn(list1, n) {","extractColumn(list1, n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'extractColumn', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, n, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0, \n [1, 2, 1])\n }"");\n\n print(""TEST-1...${driver(\n [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2, \n [3, -5, 1])\n }"");\n\n print(""TEST-2...${driver(\n [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0, \n [1, 5, 1, 13, 5, 9])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,Dart,Write a dart function to check whether a given sequence is linear or not.,"/// Write a dart function to check whether a given sequence is linear or not. seqLinear(seq_nums) {",seqLinear(seq_nums) {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'seqLinear', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(seq_nums, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [0, 2, 4, 6, 8, 10], \n ""Linear Sequence"")\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3], \n ""Linear Sequence"")\n }"");\n\n print(""TEST-2...${driver(\n [1, 5, 2], \n ""Non Linear Sequence"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,Dart,Write a function to convert the given tuple to a floating-point number.,"/// Write a function to convert the given tuple to a floating-point number. tupleToFloat(test_tup) {",tupleToFloat(test_tup) {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'tupleToFloat', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return (actual - expected).abs() < 1e-06;\n}\n\nString driver(test_tup, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [4, 56], \n 4.56)\n }"");\n\n print(""TEST-1...${driver(\n [7, 256], \n 7.256)\n }"");\n\n print(""TEST-2...${driver(\n [8, 123], \n 8.123)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,Dart,Write a dart function to find odd numbers from a mixed vector.,"/// Write a dart function to find odd numbers from a mixed vector. split(list) {",split(list) {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'split', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 4, 5, 6], \n [1, 3, 5])\n }"");\n\n print(""TEST-1...${driver(\n [10, 11, 12, 13], \n [11, 13])\n }"");\n\n print(""TEST-2...${driver(\n [7, 8, 9, 1], \n [7, 9, 1])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,Dart,Write a dart function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/// Write a dart function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. difference(n) {",difference(n) {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'difference', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 3, \n 30)\n }"");\n\n print(""TEST-1...${driver(\n 5, \n 210)\n }"");\n\n print(""TEST-2...${driver(\n 2, \n 6)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,Dart,Write a dart function to count the pairs with xor as an odd number.,"/// Write a dart function to count the pairs with xor as an odd number. findOddPair(a, n) {","findOddPair(a, n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findOddPair', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [5, 4, 7, 2, 1], 5, \n 6)\n }"");\n\n print(""TEST-1...${driver(\n [7, 2, 8, 1, 0, 5, 11], 7, \n 12)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3], 3, \n 2)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,Dart,Write a function to toggle characters case in a string.,"/// Write a function to toggle characters case in a string. toggleString(string_arg0) {",toggleString(string_arg0) {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'toggleString', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(string_arg0, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""Python"", \n ""pYTHON"")\n }"");\n\n print(""TEST-1...${driver(\n ""Pangram"", \n ""pANGRAM"")\n }"");\n\n print(""TEST-2...${driver(\n ""LIttLE"", \n ""liTTle"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,Dart,Write a dart function to find the digit distance between two integers.,"/// Write a dart function to find the digit distance between two integers. digitDistanceNums(n1, n2) {","digitDistanceNums(n1, n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n1, n2, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 1, 2, \n 1)\n }"");\n\n print(""TEST-1...${driver(\n 23, 56, \n 6)\n }"");\n\n print(""TEST-2...${driver(\n 123, 256, \n 7)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,Dart,Write a function to find the largest sum of contiguous subarray in the given vector.,"/// Write a function to find the largest sum of contiguous subarray in the given vector. maxSubArraySum(a, size) {","maxSubArraySum(a, size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, size, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [-2, -3, 4, -1, -2, 1, 5, -3], 8, \n 7)\n }"");\n\n print(""TEST-1...${driver(\n [-3, -4, 5, -2, -3, 2, 6, -4], 8, \n 8)\n }"");\n\n print(""TEST-2...${driver(\n [-4, -5, 6, -3, -4, 3, 7, -5], 8, \n 10)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,Dart,Write a function to find the union of elements of the given tuples.,"/// Write a function to find the union of elements of the given tuples. unionElements(test_tup1, test_tup2) {","unionElements(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'unionElements', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(test_tup1, test_tup2, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [3, 4, 5, 6], [5, 7, 4, 10], \n [3, 4, 5, 6, 7, 10])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4], [3, 4, 5, 6], \n [1, 2, 3, 4, 5, 6])\n }"");\n\n print(""TEST-2...${driver(\n [11, 12, 13, 14], [13, 15, 16, 17], \n [11, 12, 13, 14, 15, 16, 17])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,Dart,Write a dart function to find the maximum length of sublist.,"/// Write a dart function to find the maximum length of sublist. findMaxLength(lst) {",findMaxLength(lst) {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findMaxLength', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(lst, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(lst), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [[1], [1, 4], [5, 6, 7, 8]], \n 4)\n }"");\n\n print(""TEST-1...${driver(\n [[0, 1], [2, 2], [3, 2, 1]], \n 3)\n }"");\n\n print(""TEST-2...${driver(\n [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]], \n 5)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,Dart,Write a function to extract values between quotation marks of a string.,"/// Write a function to extract values between quotation marks of a string. extractValues(text) {",extractValues(text) {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'extractValues', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(text, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", \n [""Python"", ""PHP"", ""Java""])\n }"");\n\n print(""TEST-1...${driver(\n ""\\""python\\"",\\""program\\"",\\""language\\"""", \n [""python"", ""program"", ""language""])\n }"");\n\n print(""TEST-2...${driver(\n ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", \n [""red"", ""blue"", ""green"", ""yellow""])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,Dart,Write a dart function to count unequal element pairs from the given vector.,"/// Write a dart function to count unequal element pairs from the given vector. countPairs(arr, n) {","countPairs(arr, n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'countPairs', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 1], 3, \n 2)\n }"");\n\n print(""TEST-1...${driver(\n [1, 1, 1, 1], 4, \n 0)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3, 4, 5], 5, \n 10)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,Dart,Write a dart function to split a string into characters.,"/// Write a dart function to split a string into characters. split(word) {",split(word) {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'split', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(word, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(word), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""python"", \n [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'])\n }"");\n\n print(""TEST-1...${driver(\n ""Name"", \n [\'N\', \'a\', \'m\', \'e\'])\n }"");\n\n print(""TEST-2...${driver(\n ""program"", \n [\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,Dart,Write a function to get the sum of a non-negative integer.,"/// Write a function to get the sum of a non-negative integer. sumDigits(n) {",sumDigits(n) {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'sumDigits', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 345, \n 12)\n }"");\n\n print(""TEST-1...${driver(\n 12, \n 3)\n }"");\n\n print(""TEST-2...${driver(\n 97, \n 16)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,Dart,Write a function to check whether a specified vector is sorted or not.,"/// Write a function to check whether a specified vector is sorted or not. issortList(list1) {",issortList(list1) {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'issortList', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 4, 6, 8, 10, 12, 14, 16, 17], \n true)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 4, 6, 8, 10, 12, 14, 20, 17], \n false)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 4, 6, 8, 10, 15, 14, 20], \n false)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,Dart,Write a function to sort each sublist of strings in a given vector of vectors.,"/// Write a function to sort each sublist of strings in a given vector of vectors. sortSublists(list1) {",sortSublists(list1) {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'sortSublists', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List> actual, List> expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, List> expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]], \n [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]])\n }"");\n\n print(""TEST-1...${driver(\n [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], \n [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]])\n }"");\n\n print(""TEST-2...${driver(\n [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]], \n [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,Dart,Write a function to remove words from a given vector of strings containing a character or string.,"/// Write a function to remove words from a given vector of strings containing a character or string. removeWords(list1, charlist) {","removeWords(list1, charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'removeWords', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, charlist, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], [""#"", ""color"", ""@""], \n [""Red"", """", ""Green"", ""Orange"", ""White""])\n }"");\n\n print(""TEST-1...${driver(\n [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""&"", ""+"", ""@""], \n [""Red"", """", ""Green"", ""Orange"", ""White""])\n }"");\n\n print(""TEST-2...${driver(\n [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""@""], \n [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,Dart,Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k.,"/// Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k. maxSumPairDiffLessthanK(arr, n, k) {","maxSumPairDiffLessthanK(arr, n, k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr, n, k, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [3, 5, 10, 15, 17, 12, 9], 7, 4, \n 62)\n }"");\n\n print(""TEST-1...${driver(\n [5, 15, 10, 300], 4, 12, \n 25)\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3, 4, 5, 6], 6, 6, \n 21)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,Dart,Write a dart function to remove two duplicate numbers from a given number of vectors.,"/// Write a dart function to remove two duplicate numbers from a given number of vectors. twoUniqueNums(nums) {",twoUniqueNums(nums) {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(nums, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 2, 3, 4, 5], \n [1, 4, 5])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 2, 4, 5], \n [1, 3, 4, 5])\n }"");\n\n print(""TEST-2...${driver(\n [1, 2, 3, 4, 5], \n [1, 2, 3, 4, 5])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,Dart,Write a dart function to calculate the product of the unique numbers of a given vector.,"/// Write a dart function to calculate the product of the unique numbers of a given vector. uniqueProduct(list_data) {",uniqueProduct(list_data) {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'uniqueProduct', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list_data, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [10, 20, 30, 40, 20, 50, 60, 40], \n 720000000)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 1], \n 6)\n }"");\n\n print(""TEST-2...${driver(\n [7, 8, 9, 0, 1, 1], \n 0)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,Dart,Write a function to find the surface area of a cylinder.,"/// Write a function to find the surface area of a cylinder. surfaceareaCylinder(r, h) {","surfaceareaCylinder(r, h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(double actual, double expected){\n return (actual - expected).abs() < 1e-09;\n}\n\nString driver(r, h, double expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 10, 5, \n 942.45)\n }"");\n\n print(""TEST-1...${driver(\n 4, 5, \n 226.18800000000002)\n }"");\n\n print(""TEST-2...${driver(\n 4, 10, \n 351.848)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,Dart,Write a dart function to find nth number in a sequence which is not a multiple of a given number.,"/// Write a dart function to find nth number in a sequence which is not a multiple of a given number. countNo(a, n, l, r) {","countNo(a, n, l, r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'countNo', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, n, l, r, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 2, 3, 1, 10, \n 5)\n }"");\n\n print(""TEST-1...${driver(\n 3, 6, 4, 20, \n 11)\n }"");\n\n print(""TEST-2...${driver(\n 5, 10, 4, 20, \n 16)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,Dart,Write a dart function to check whether vector is subarray of another or not.,"/// Write a dart function to check whether vector is subarray of another or not. isSubArray(a, b, n, m) {","isSubArray(a, b, n, m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'isSubArray', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, b, n, m, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 4, 3, 5], [1, 2], 4, 2, \n false)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 1], [1, 2, 1], 3, 3, \n true)\n }"");\n\n print(""TEST-2...${driver(\n [1, 0, 2, 2], [2, 2, 0], 4, 3, \n false)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,Dart,Write a dart function to find the last digit in factorial of a given number.,"/// Write a dart function to find the last digit in factorial of a given number. lastDigitFactorial(n) {",lastDigitFactorial(n) {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 4, \n 4)\n }"");\n\n print(""TEST-1...${driver(\n 21, \n 0)\n }"");\n\n print(""TEST-2...${driver(\n 30, \n 0)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,Dart,Write a function to interleave vectors of the same length.,"/// Write a function to interleave vectors of the same length. interleaveLists(list1, list2, list3) {","interleaveLists(list1, list2, list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'interleaveLists', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, list2, list3, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700], \n [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700])\n }"");\n\n print(""TEST-1...${driver(\n [10, 20], [15, 2], [5, 10], \n [10, 15, 5, 20, 2, 10])\n }"");\n\n print(""TEST-2...${driver(\n [11, 44], [10, 15], [20, 5], \n [11, 10, 20, 44, 15, 5])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,Dart,Write a function to find the dissimilar elements in the given two tuples.,"/// Write a function to find the dissimilar elements in the given two tuples. findDissimilar(test_tup1, test_tup2) {","findDissimilar(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findDissimilar', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(test_tup1, test_tup2, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [3, 4, 5, 6], [5, 7, 4, 10], \n [3, 6, 7, 10])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4], [7, 2, 3, 9], \n [1, 4, 7, 9])\n }"");\n\n print(""TEST-2...${driver(\n [21, 11, 25, 26], [26, 34, 21, 36], \n [34, 36, 11, 25])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,Dart,Write a dart function to find the surface area of the square pyramid.,"/// Write a dart function to find the surface area of the square pyramid. surfaceArea(b, s) {","surfaceArea(b, s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'surfaceArea', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(b, s, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 3, 4, \n 33)\n }"");\n\n print(""TEST-1...${driver(\n 4, 5, \n 56)\n }"");\n\n print(""TEST-2...${driver(\n 1, 2, \n 5)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,Dart,Write a function for nth catalan number.,"/// Write a function for nth catalan number. catalanNumber(num) {",catalanNumber(num) {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'catalanNumber', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(num, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 10, \n 16796)\n }"");\n\n print(""TEST-1...${driver(\n 9, \n 4862)\n }"");\n\n print(""TEST-2...${driver(\n 7, \n 429)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,Dart,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/// Write a function to find all adverbs and their positions in a given sentence by using regex. findAdverbs(text) {",findAdverbs(text) {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findAdverbs', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(text, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""Clearly, he has no excuse for such behavior."", \n ""0-7: Clearly"")\n }"");\n\n print(""TEST-1...${driver(\n ""Please handle the situation carefuly"", \n ""28-36: carefuly"")\n }"");\n\n print(""TEST-2...${driver(\n ""Complete the task quickly"", \n ""18-25: quickly"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,Dart,Write a dart function to split the vector and add the first part to the end.,"/// Write a dart function to split the vector and add the first part to the end. splitArr(a, n, k) {","splitArr(a, n, k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'splitArr', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, n, k, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [12, 10, 5, 6, 52, 36], 6, 2, \n [5, 6, 52, 36, 12, 10])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4], 4, 1, \n [2, 3, 4, 1])\n }"");\n\n print(""TEST-2...${driver(\n [0, 1, 2, 3, 4, 5, 6, 7], 8, 3, \n [3, 4, 5, 6, 7, 0, 1, 2])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,Dart,Write a function to convert vector to a tuple.,"/// Write a function to convert vector to a tuple. listTuple(listx) {",listTuple(listx) {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'listTuple', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(listx, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(listx), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [5, 10, 7, 4, 15, 3], \n [5, 10, 7, 4, 15, 3])\n }"");\n\n print(""TEST-1...${driver(\n [2, 4, 5, 6, 2, 3, 4, 4, 7], \n [2, 4, 5, 6, 2, 3, 4, 4, 7])\n }"");\n\n print(""TEST-2...${driver(\n [58, 44, 56], \n [58, 44, 56])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,Dart,Write a dart function to find the difference between largest and smallest value in a given vector.,"/// Write a dart function to find the difference between largest and smallest value in a given vector. bigDiff(nums) {",bigDiff(nums) {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'bigDiff', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(nums, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 2, 3, 4], \n 3)\n }"");\n\n print(""TEST-1...${driver(\n [4, 5, 12], \n 8)\n }"");\n\n print(""TEST-2...${driver(\n [9, 2, 3], \n 7)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,Dart,Write a function to find perfect squares between two given numbers.,"/// Write a function to find perfect squares between two given numbers. perfectSquares(a, b) {","perfectSquares(a, b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'perfectSquares', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(a, b, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 1, 30, \n [1, 4, 9, 16, 25])\n }"");\n\n print(""TEST-1...${driver(\n 50, 100, \n [64, 81, 100])\n }"");\n\n print(""TEST-2...${driver(\n 100, 200, \n [100, 121, 144, 169, 196])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,Dart,Write a dart function to interchange the first and last elements in vector.,"/// Write a dart function to interchange the first and last elements in vector. swapList(newlist) {",swapList(newlist) {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'swapList', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(List actual, List expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(newlist, List expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [12, 35, 9, 56, 24], \n [24, 35, 9, 56, 12])\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3], \n [3, 2, 1])\n }"");\n\n print(""TEST-2...${driver(\n [4, 5, 6], \n [6, 5, 4])\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,Dart,Write a dart function to find sum of product of binomial co-efficients.,"/// Write a dart function to find sum of product of binomial co-efficients. sumOfProduct(n) {",sumOfProduct(n) {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'sumOfProduct', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 3, \n 15)\n }"");\n\n print(""TEST-1...${driver(\n 4, \n 56)\n }"");\n\n print(""TEST-2...${driver(\n 1, \n 1)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,Dart,Write a function to remove leading zeroes from an ip address.,"/// Write a function to remove leading zeroes from an ip address. removezeroIp(ip) {",removezeroIp(ip) {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'removezeroIp', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(String actual, String expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(ip, String expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ip), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n ""216.08.094.196"", \n ""216.8.94.196"")\n }"");\n\n print(""TEST-1...${driver(\n ""12.01.024"", \n ""12.1.24"")\n }"");\n\n print(""TEST-2...${driver(\n ""216.08.094.0196"", \n ""216.8.94.196"")\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,Dart,Write a function to find the difference of first even and odd number of a given vector.,"/// Write a function to find the difference of first even and odd number of a given vector. diffEvenOdd(list1) {",diffEvenOdd(list1) {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(list1, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [1, 3, 5, 7, 4, 1, 6, 8], \n 3)\n }"");\n\n print(""TEST-1...${driver(\n [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], \n 1)\n }"");\n\n print(""TEST-2...${driver(\n [1, 5, 7, 9, 10], \n 9)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,Dart,Write a function to find kth element from the given two sorted vectors.,"/// Write a function to find kth element from the given two sorted vectors. findKth(arr1, arr2, m, n, k) {","findKth(arr1, arr2, m, n, k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'findKth', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(int actual, int expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(arr1, arr2, m, n, k, int expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n [2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5, \n 6)\n }"");\n\n print(""TEST-1...${driver(\n [100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7, \n 256)\n }"");\n\n print(""TEST-2...${driver(\n [3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6, \n 8)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,Dart,Write a function to check whether the given number is armstrong or not.,"/// Write a function to check whether the given number is armstrong or not. armstrongNumber(number) {",armstrongNumber(number) {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'armstrongNumber', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(number, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(number), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 153, \n true)\n }"");\n\n print(""TEST-1...${driver(\n 259, \n false)\n }"");\n\n print(""TEST-2...${driver(\n 4458, \n false)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,Dart,Write a dart function to check whether the given number is even or not using bitwise operator.,"/// Write a dart function to check whether the given number is even or not using bitwise operator. isEven(n) {",isEven(n) {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'dart', 'entry_fn_name': 'isEven', 'test_code': 'import \'dart:convert\';\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual.toString() == expected.toString();\n}\n\nString driver(n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n }catch(exception_object){\n return exception_object.runtimeType.toString();\n }\n}\n\nint main() {\n\n print(""TEST-0...${driver(\n 1, \n false)\n }"");\n\n print(""TEST-1...${driver(\n 2, \n true)\n }"");\n\n print(""TEST-2...${driver(\n 3, \n false)\n }"");\n\n return 0;\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['dart', 'run', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,Go,Write a go function to find minimum sum of factors of a given number.,"// Write a go function to find minimum sum of factors of a given number. func findMinSum(num int) int {",func findMinSum(num int) int {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findMinSum', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(num int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(num),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(12, 7)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(105, 15)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(2, 2)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 514,MBPP/514,Go,Write a function to find the summation of tuple elements in the given tuple array.,"// Write a function to find the summation of tuple elements in the given tuple array. func sumElements(test_tup []int) int {",func sumElements(test_tup []int) int {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'sumElements', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(test_tup []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{7, 8, 9, 1, 10, 7}, 42)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5, 6}, 21)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{11, 12, 13, 45, 14}, 95)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 515,MBPP/515,Go,Write a function to check if there is a subset with sum divisible by m.,"// Write a function to check if there is a subset with sum divisible by m. func modularSum(arr []int, n int, m int) bool {","func modularSum(arr []int, n int, m int) bool {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'modularSum', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, m int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n, m),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{3, 1, 7, 5}, \n\t4, \n\t6, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 7}, \n\t2, \n\t5, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 6}, \n\t2, \n\t5, false)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 516,MBPP/516,Go,Write a function to sort array of elements using radix sort.,"// Write a function to sort array of elements using radix sort. func radixSort(nums []int) []int {",func radixSort(nums []int) []int {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'radixSort', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(nums []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(nums),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{15, 79, 25, 68, 37}, []int{15, 25, 37, 68, 79})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{9, 11, 8, 7, 3, 2}, []int{2, 3, 7, 8, 9, 11})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{36, 12, 24, 26, 29}, []int{12, 24, 26, 29, 36})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 517,MBPP/517,Go,Write a go function to find the largest postive number from the given array.,"// Write a go function to find the largest postive number from the given array. func largestPos(list1 []int) int {",func largestPos(list1 []int) int {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'largestPos', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 4, -1}, 4)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{0, 1, 2, -5, -1, 6}, 6)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{0, 0, 1, 0}, 1)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 518,MBPP/518,Go,Write a function to find the square root of a perfect number.,"// Write a function to find the square root of a perfect number. func sqrtRoot(num int) int {",func sqrtRoot(num int) int {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'sqrtRoot', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(num int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(num),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(4, 2)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(16, 4)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(400, 20)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 519,MBPP/519,Go,Write a function to calculate volume of a tetrahedron.,"// Write a function to calculate volume of a tetrahedron. func volumeTetrahedron(num int) float64 {",func volumeTetrahedron(num int) float64 {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual float64, expected float64) bool {\n return math.Abs(actual - expected) < 1e-06\n}\n\nfunc driver(num int, expected float64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(num),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(10, 117.85)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(15, 397.75)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(20, 942.81)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 520,MBPP/520,Go,Write a function to find the lcm of the given array elements.,"// Write a function to find the lcm of the given array elements. func getLcm(l []int) int {",func getLcm(l []int) int {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'getLcm', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(l []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(l),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{2, 7, 3, 9, 4}, 252)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 8, 3}, 24)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{3, 8, 4, 10, 5}, 120)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 521,MBPP/521,Go,Write a function to print check if the triangle is scalene or not.,"// Write a function to print check if the triangle is scalene or not. func checkIsosceles(x int, y int, z int) bool {","func checkIsosceles(x int, y int, z int) bool {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'checkIsosceles', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(x int, y int, z int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(x, y, z),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(6, \n\t8, \n\t12, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(6, \n\t6, \n\t12, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(6, \n\t15, \n\t20, true)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 522,MBPP/522,Go,Write a function to find the longest bitonic subsequence for the given array.,"// Write a function to find the longest bitonic subsequence for the given array. func lbs(arr []int) int {",func lbs(arr []int) int {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'lbs', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}, 7)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 11, 2, 10, 4, 5, 2, 1}, 6)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{80, 60, 30, 40, 20, 10}, 5)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 523,MBPP/523,Go,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. func checkString(str1 string) []string {",func checkString(str1 string) []string {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'checkString', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []string, expected []string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(str1 string, expected []string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(str1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""python"", []string{""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""123python"", []string{""String must have 1 upper case character.""})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""123Python"", []string{""Valid string.""})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 524,MBPP/524,Go,Write a function to find the sum of maximum increasing subsequence of the given array.,"// Write a function to find the sum of maximum increasing subsequence of the given array. func maxSumIncreasingSubsequence(arr []int, n int) int {","func maxSumIncreasingSubsequence(arr []int, n int) int {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 101, 2, 3, 100, 4, 5}, \n\t7, 106)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{3, 4, 5, 10}, \n\t4, 22)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{10, 5, 4, 3}, \n\t4, 10)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 525,MBPP/525,Go,Write a go function to check whether two given lines are parallel or not.,"// Write a go function to check whether two given lines are parallel or not. func parallelLines(line1 []int, line2 []int) bool {","func parallelLines(line1 []int, line2 []int) bool {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'parallelLines', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(line1 []int, line2 []int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(line1, line2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{2, 3, 4}, \n\t[]int{2, 3, 8}, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{2, 3, 4}, \n\t[]int{4, -3, 8}, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{3, 3}, \n\t[]int{5, 5}, true)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 526,MBPP/526,Go,Write a go function to capitalize first and last letters of each word of a given string.,"// Write a go function to capitalize first and last letters of each word of a given string. func capitalizeFirstLastLetters(str1 string) string {",func capitalizeFirstLastLetters(str1 string) string {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(str1 string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(str1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""python"", ""PythoN"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""bigdata"", ""BigdatA"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""Hadoop"", ""HadooP"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 527,MBPP/527,Go,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"// Write a function to find all pairs in an integer array whose sum is equal to a given number. func getPairsCount(arr []int, n int, sum int) int {","func getPairsCount(arr []int, n int, sum int) int {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'getPairsCount', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, sum int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 5, 7, -1, 5}, \n\t5, \n\t6, 3)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 5, 7, -1}, \n\t4, \n\t6, 2)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 1, 1, 1}, \n\t4, \n\t2, 6)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 529,MBPP/529,Go,Write a function to find the nth jacobsthal-lucas number.,"// Write a function to find the nth jacobsthal-lucas number. func jacobsthalLucas(n int) int {",func jacobsthalLucas(n int) int {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(5, 31)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(2, 5)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(4, 17)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 530,MBPP/530,Go,Write a function to find the ration of negative numbers in an array of integers.,"// Write a function to find the ration of negative numbers in an array of integers. func negativeCount(nums []int) float64 {",func negativeCount(nums []int) float64 {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'negativeCount', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual float64, expected float64) bool {\n return math.Abs(actual - expected) < 1e-06\n}\n\nfunc driver(nums []int, expected float64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(nums),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8}, 0.31)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8}, 0.31)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{2, 4, -6, -9, 11, -12, 14, -5, 17}, 0.44)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 531,MBPP/531,Go,Write a function to find minimum number of coins that make a given value.,"// Write a function to find minimum number of coins that make a given value. func minCoins(coins []int, m int, v int) int {","func minCoins(coins []int, m int, v int) int {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'minCoins', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(coins []int, m int, v int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(coins, m, v),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{9, 6, 5, 1}, \n\t4, \n\t11, 2)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{4, 5, 6, 7, 8, 9}, \n\t6, \n\t9, 1)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3}, \n\t3, \n\t4, 2)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 532,MBPP/532,Go,Write a function to check if the two given strings are permutations of each other.,"// Write a function to check if the two given strings are permutations of each other. func checkPermutation(str1 string, str2 string) bool {","func checkPermutation(str1 string, str2 string) bool {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'checkPermutation', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(str1 string, str2 string, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(str1, str2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""abc"", \n\t""cba"", true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""test"", \n\t""ttew"", false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""xxyz"", \n\t""yxzx"", true)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 534,MBPP/534,Go,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. func searchLiteral(pattern string, text string) []int {","func searchLiteral(pattern string, text string) []int {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'searchLiteral', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(pattern string, text string, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(pattern, text),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""python"", \n\t""python programming language"", []int{0, 6})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""programming"", \n\t""python programming language"", []int{7, 18})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""language"", \n\t""python programming language"", []int{19, 27})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 535,MBPP/535,Go,Write a function to find the top or bottom surface area of a cylinder.,"// Write a function to find the top or bottom surface area of a cylinder. func topbottomSurfacearea(r int) float64 {",func topbottomSurfacearea(r int) float64 {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual float64, expected float64) bool {\n return math.Abs(actual - expected) < 1e-09\n}\n\nfunc driver(r int, expected float64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(r),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(10, 314.15000000000003)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(5, 78.53750000000001)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(4, 50.264)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 536,MBPP/536,Go,Write a function to select the nth items of array.,"// Write a function to select the nth items of array. func nthItems(list []int, n int) []int {","func nthItems(list []int, n int) []int {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'nthItems', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list []int, n int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}, \n\t2, []int{1, 3, 5, 7, 9})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{10, 15, 19, 17, 16, 18}, \n\t3, []int{10, 17})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{14, 16, 19, 15, 17}, \n\t4, []int{14, 17})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 537,MBPP/537,Go,Write a go function to find the first repeated word in a given string.,"// Write a go function to find the first repeated word in a given string. func firstRepeatedWord(str1 string) string {",func firstRepeatedWord(str1 string) string {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(str1 string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(str1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""ab ca bc ab"", ""ab"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""ab ca bc"", ""None"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""ab ca bc ca ab bc"", ""ca"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 538,MBPP/538,Go,Write a go function to convert a given string array to a tuple.,"// Write a go function to convert a given string array to a tuple. func stringListToTuple(str1 string) []rune {",func stringListToTuple(str1 string) []rune {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'stringListToTuple', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []rune, expected []rune) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(str1 string, expected []rune) string {\n if validateSolution(PLACEHOLDER_FN_NAME(str1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""python 3.0"", []rune{\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""bigdata"", []rune{\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""language"", []rune{\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 539,MBPP/539,Go,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function.,"// Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function. func basesnumCoresspondingnum(bases_num []int, index []int) []int64 {","func basesnumCoresspondingnum(bases_num []int, index []int) []int64 {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int64, expected []int64) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(bases_num []int, index []int, expected []int64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(bases_num, index),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, \n\t[]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, []int64{10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5, 6, 7}, \n\t[]int{10, 20, 30, 40, 50, 60, 70}, []int64{1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{4, 8, 12, 16, 20, 24, 28}, \n\t[]int{3, 6, 9, 12, 15, 18, 21}, []int64{64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 540,MBPP/540,Go,Write a go function to find the difference between highest and least frequencies in a given array.,"// Write a go function to find the difference between highest and least frequencies in a given array. func findDiff(arr []int, n int) int {","func findDiff(arr []int, n int) int {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findDiff', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 1, 2, 2, 7, 8, 4, 5, 1, 4}, \n\t10, 2)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 7, 9, 2, 3, 3, 1, 3, 3}, \n\t9, 3)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 1, 2}, \n\t4, 0)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 541,MBPP/541,Go,Write a function to find if the given number is abundant or not.,"// Write a function to find if the given number is abundant or not. func checkAbundant(n int) bool {",func checkAbundant(n int) bool {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'checkAbundant', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(12, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(15, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(18, true)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 542,MBPP/542,Go,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. func fillSpaces(text string) string {",func fillSpaces(text string) string {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'fillSpaces', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(text string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(text),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 543,MBPP/543,Go,Write a function to add two numbers and print number of digits of sum.,"// Write a function to add two numbers and print number of digits of sum. func countDigits(num1 int64, num2 int) int {","func countDigits(num1 int64, num2 int) int {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'countDigits', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(num1 int64, num2 int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(num1, num2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(9875, \n\t10, 4)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(98759853034, \n\t100, 11)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(1234567, \n\t500, 7)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 545,MBPP/545,Go,Write a go function to toggle only first and last bits of a given number.,"// Write a go function to toggle only first and last bits of a given number. func toggleFAndLBits(n int) int {",func toggleFAndLBits(n int) int {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(10, 3)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(15, 6)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(20, 5)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 546,MBPP/546,Go,Write a function to find the last occurrence of a character in a string.,"// Write a function to find the last occurrence of a character in a string. func lastOccurenceChar(string_arg0 string, char_arg1 rune) int {","func lastOccurenceChar(string_arg0 string, char_arg1 rune) int {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(string_arg0 string, char_arg1 rune, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""hello world"", \n\t\'l\', 10)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""language"", \n\t\'g\', 7)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""little"", \n\t\'y\', None)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 547,MBPP/547,Go,Write a go function to find the sum of hamming distances of all consecutive numbers from o to n.,"// Write a go function to find the sum of hamming distances of all consecutive numbers from o to n. func totalHammingDistance(n int) int {",func totalHammingDistance(n int) int {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(4, 7)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(2, 3)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(5, 8)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 548,MBPP/548,Go,Write a function to find the length of the longest increasing subsequence of the given sequence.,"// Write a function to find the length of the longest increasing subsequence of the given sequence. func longestIncreasingSubsequence(arr []int) int {",func longestIncreasingSubsequence(arr []int) int {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{10, 22, 9, 33, 21, 50, 41, 60}, 5)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{3, 10, 2, 1, 20}, 3)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{50, 3, 10, 7, 40, 80}, 4)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 549,MBPP/549,Go,Write a go function to find the sum of fifth power of first n odd natural numbers.,"// Write a go function to find the sum of fifth power of first n odd natural numbers. func oddNumSum(n int) int {",func oddNumSum(n int) int {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'oddNumSum', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(1, 1)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(2, 244)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(3, 3369)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 550,MBPP/550,Go,Write a go function to find the maximum element in a sorted and rotated array.,"// Write a go function to find the maximum element in a sorted and rotated array. func findMax(arr []int, low int, high int) int {","func findMax(arr []int, low int, high int) int {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findMax', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, low int, high int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, low, high),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{2, 3, 5, 6, 9}, \n\t0, \n\t4, 9)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{3, 4, 5, 2, 1}, \n\t0, \n\t4, 5)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3}, \n\t0, \n\t2, 3)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 551,MBPP/551,Go,Write a function to extract a specified column from a given nested array.,"// Write a function to extract a specified column from a given nested array. func extractColumn(list1 [][]int, n int) []int {","func extractColumn(list1 [][]int, n int) []int {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'extractColumn', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 [][]int, n int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([][]int{{1, 2, 3}, {2, 4, 5}, {1, 1, 1}}, \n\t0, []int{1, 2, 1})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([][]int{{1, 2, 3}, {-2, 4, -5}, {1, -1, 1}}, \n\t2, []int{3, -5, 1})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([][]int{{1, 3}, {5, 7}, {1, 3}, {13, 15, 17}, {5, 7}, {9, 11}}, \n\t0, []int{1, 5, 1, 13, 5, 9})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 552,MBPP/552,Go,Write a go function to check whether a given sequence is linear or not.,"// Write a go function to check whether a given sequence is linear or not. func seqLinear(seq_nums []int) string {",func seqLinear(seq_nums []int) string {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'seqLinear', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(seq_nums []int, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(seq_nums),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{0, 2, 4, 6, 8, 10}, ""Linear Sequence"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3}, ""Linear Sequence"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 5, 2}, ""Non Linear Sequence"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 553,MBPP/553,Go,Write a function to convert the given tuple to a floating-point number.,"// Write a function to convert the given tuple to a floating-point number. func tupleToFloat(test_tup []int) float64 {",func tupleToFloat(test_tup []int) float64 {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'tupleToFloat', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual float64, expected float64) bool {\n return math.Abs(actual - expected) < 1e-06\n}\n\nfunc driver(test_tup []int, expected float64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{4, 56}, 4.56)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{7, 256}, 7.256)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{8, 123}, 8.123)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 554,MBPP/554,Go,Write a go function to find odd numbers from a mixed array.,"// Write a go function to find odd numbers from a mixed array. func split(list []int) []int {",func split(list []int) []int {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'split', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 4, 5, 6}, []int{1, 3, 5})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{10, 11, 12, 13}, []int{11, 13})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{7, 8, 9, 1}, []int{7, 9, 1})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 555,MBPP/555,Go,Write a go function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"// Write a go function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. func difference(n int) int {",func difference(n int) int {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'difference', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(3, 30)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(5, 210)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(2, 6)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 556,MBPP/556,Go,Write a go function to count the pairs with xor as an odd number.,"// Write a go function to count the pairs with xor as an odd number. func findOddPair(a []int, n int) int {","func findOddPair(a []int, n int) int {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findOddPair', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a []int, n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{5, 4, 7, 2, 1}, \n\t5, 6)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{7, 2, 8, 1, 0, 5, 11}, \n\t7, 12)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3}, \n\t3, 2)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 557,MBPP/557,Go,Write a function to toggle characters case in a string.,"// Write a function to toggle characters case in a string. func toggleString(string_arg0 string) string {",func toggleString(string_arg0 string) string {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'toggleString', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(string_arg0 string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(string_arg0),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""Python"", ""pYTHON"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""Pangram"", ""pANGRAM"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""LIttLE"", ""liTTle"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 558,MBPP/558,Go,Write a go function to find the digit distance between two integers.,"// Write a go function to find the digit distance between two integers. func digitDistanceNums(n1 int, n2 int) int {","func digitDistanceNums(n1 int, n2 int) int {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n1 int, n2 int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n1, n2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(1, \n\t2, 1)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(23, \n\t56, 6)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(123, \n\t256, 7)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 559,MBPP/559,Go,Write a function to find the largest sum of contiguous subarray in the given array.,"// Write a function to find the largest sum of contiguous subarray in the given array. func maxSubArraySum(a []int, size int) int {","func maxSubArraySum(a []int, size int) int {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a []int, size int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, size),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{-2, -3, 4, -1, -2, 1, 5, -3}, \n\t8, 7)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{-3, -4, 5, -2, -3, 2, 6, -4}, \n\t8, 8)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{-4, -5, 6, -3, -4, 3, 7, -5}, \n\t8, 10)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 560,MBPP/560,Go,Write a function to find the union of elements of the given tuples.,"// Write a function to find the union of elements of the given tuples. func unionElements(test_tup1 []int, test_tup2 []int) []int {","func unionElements(test_tup1 []int, test_tup2 []int) []int {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'unionElements', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(test_tup1 []int, test_tup2 []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{3, 4, 5, 6}, \n\t[]int{5, 7, 4, 10}, []int{3, 4, 5, 6, 7, 10})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4}, \n\t[]int{3, 4, 5, 6}, []int{1, 2, 3, 4, 5, 6})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{11, 12, 13, 14}, \n\t[]int{13, 15, 16, 17}, []int{11, 12, 13, 14, 15, 16, 17})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 562,MBPP/562,Go,Write a go function to find the maximum length of sublist.,"// Write a go function to find the maximum length of sublist. func findMaxLength(lst [][]int) int {",func findMaxLength(lst [][]int) int {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findMaxLength', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(lst [][]int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(lst),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([][]int{{1}, {1, 4}, {5, 6, 7, 8}}, 4)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([][]int{{0, 1}, {2, 2}, {3, 2, 1}}, 3)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([][]int{{7}, {22, 23}, {13, 14, 15}, {10, 20, 30, 40, 50}}, 5)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 563,MBPP/563,Go,Write a function to extract values between quotation marks of a string.,"// Write a function to extract values between quotation marks of a string. func extractValues(text string) []string {",func extractValues(text string) []string {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'extractValues', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []string, expected []string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(text string, expected []string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(text),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", []string{""Python"", ""PHP"", ""Java""})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", []string{""python"", ""program"", ""language""})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", []string{""red"", ""blue"", ""green"", ""yellow""})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 564,MBPP/564,Go,Write a go function to count unequal element pairs from the given array.,"// Write a go function to count unequal element pairs from the given array. func countPairs(arr []int, n int) int {","func countPairs(arr []int, n int) int {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'countPairs', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 1}, \n\t3, 2)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 1, 1, 1}, \n\t4, 0)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5}, \n\t5, 10)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 565,MBPP/565,Go,Write a go function to split a string into characters.,"// Write a go function to split a string into characters. func split(word string) []rune {",func split(word string) []rune {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'split', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []rune, expected []rune) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(word string, expected []rune) string {\n if validateSolution(PLACEHOLDER_FN_NAME(word),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""python"", []rune{\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""Name"", []rune{\'N\', \'a\', \'m\', \'e\'})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""program"", []rune{\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 566,MBPP/566,Go,Write a function to get the sum of a non-negative integer.,"// Write a function to get the sum of a non-negative integer. func sumDigits(n int) int {",func sumDigits(n int) int {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'sumDigits', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(345, 12)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(12, 3)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(97, 16)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 567,MBPP/567,Go,Write a function to check whether a specified array is sorted or not.,"// Write a function to check whether a specified array is sorted or not. func issortList(list1 []int) bool {",func issortList(list1 []int) bool {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'issortList', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 []int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 4, 6, 8, 10, 12, 14, 16, 17}, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 4, 6, 8, 10, 12, 14, 20, 17}, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 4, 6, 8, 10, 15, 14, 20}, false)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 569,MBPP/569,Go,Write a function to sort each sublist of strings in a given array of arrays.,"// Write a function to sort each sublist of strings in a given array of arrays. func sortSublists(list1 [][]string) [][]string {",func sortSublists(list1 [][]string) [][]string {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'sortSublists', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual [][]string, expected [][]string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 [][]string, expected [][]string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([][]string{{""green"", ""orange""}, {""black"", ""white""}, {""white"", ""black"", ""orange""}}, [][]string{{""green"", ""orange""}, {""black"", ""white""}, {""black"", ""orange"", ""white""}})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([][]string{{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}}, [][]string{{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([][]string{{""a"", ""b""}, {""d"", ""c""}, {""g"", ""h""}, {""f"", ""e""}}, [][]string{{""a"", ""b""}, {""c"", ""d""}, {""g"", ""h""}, {""e"", ""f""}})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 570,MBPP/570,Go,Write a function to remove words from a given array of strings containing a character or string.,"// Write a function to remove words from a given array of strings containing a character or string. func removeWords(list1 []string, charlist []string) []string {","func removeWords(list1 []string, charlist []string) []string {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'removeWords', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []string, expected []string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 []string, charlist []string, expected []string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1, charlist),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]string{""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""}, \n\t[]string{""#"", ""color"", ""@""}, []string{""Red"", """", ""Green"", ""Orange"", ""White""})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]string{""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, \n\t[]string{""&"", ""+"", ""@""}, []string{""Red"", """", ""Green"", ""Orange"", ""White""})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]string{""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, \n\t[]string{""@""}, []string{""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 571,MBPP/571,Go,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. func maxSumPairDiffLessthanK(arr []int, n int, k int) int {","func maxSumPairDiffLessthanK(arr []int, n int, k int) int {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr []int, n int, k int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr, n, k),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{3, 5, 10, 15, 17, 12, 9}, \n\t7, \n\t4, 62)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{5, 15, 10, 300}, \n\t4, \n\t12, 25)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5, 6}, \n\t6, \n\t6, 21)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 572,MBPP/572,Go,Write a go function to remove two duplicate numbers from a given number of arrays.,"// Write a go function to remove two duplicate numbers from a given number of arrays. func twoUniqueNums(nums []int) []int {",func twoUniqueNums(nums []int) []int {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(nums []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(nums),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 2, 3, 4, 5}, []int{1, 4, 5})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 2, 4, 5}, []int{1, 3, 4, 5})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5}, []int{1, 2, 3, 4, 5})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 573,MBPP/573,Go,Write a go function to calculate the product of the unique numbers of a given array.,"// Write a go function to calculate the product of the unique numbers of a given array. func uniqueProduct(list_data []int) int {",func uniqueProduct(list_data []int) int {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'uniqueProduct', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list_data []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list_data),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{10, 20, 30, 40, 20, 50, 60, 40}, 720000000)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 1}, 6)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{7, 8, 9, 0, 1, 1}, 0)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 574,MBPP/574,Go,Write a function to find the surface area of a cylinder.,"// Write a function to find the surface area of a cylinder. func surfaceareaCylinder(r int, h int) float64 {","func surfaceareaCylinder(r int, h int) float64 {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual float64, expected float64) bool {\n return math.Abs(actual - expected) < 1e-09\n}\n\nfunc driver(r int, h int, expected float64) string {\n if validateSolution(PLACEHOLDER_FN_NAME(r, h),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(10, \n\t5, 942.45)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(4, \n\t5, 226.18800000000002)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(4, \n\t10, 351.848)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 575,MBPP/575,Go,Write a go function to find nth number in a sequence which is not a multiple of a given number.,"// Write a go function to find nth number in a sequence which is not a multiple of a given number. func countNo(a int, n int, l int, r int) int {","func countNo(a int, n int, l int, r int) int {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'countNo', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a int, n int, l int, r int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(2, \n\t3, \n\t1, \n\t10, 5)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(3, \n\t6, \n\t4, \n\t20, 11)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(5, \n\t10, \n\t4, \n\t20, 16)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 576,MBPP/576,Go,Write a go function to check whether an array is subarray of another or not.,"// Write a go function to check whether an array is subarray of another or not. func isSubArray(a []int, b []int, n int, m int) bool {","func isSubArray(a []int, b []int, n int, m int) bool {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'isSubArray', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a []int, b []int, n int, m int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 4, 3, 5}, \n\t[]int{1, 2}, \n\t4, \n\t2, false)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 1}, \n\t[]int{1, 2, 1}, \n\t3, \n\t3, true)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 0, 2, 2}, \n\t[]int{2, 2, 0}, \n\t4, \n\t3, false)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 577,MBPP/577,Go,Write a go function to find the last digit in factorial of a given number.,"// Write a go function to find the last digit in factorial of a given number. func lastDigitFactorial(n int) int {",func lastDigitFactorial(n int) int {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(4, 4)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(21, 0)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(30, 0)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 578,MBPP/578,Go,Write a function to interleave arrays of the same length.,"// Write a function to interleave arrays of the same length. func interleaveLists(list1 []int, list2 []int, list3 []int) []int {","func interleaveLists(list1 []int, list2 []int, list3 []int) []int {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'interleaveLists', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 []int, list2 []int, list3 []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 4, 5, 6, 7}, \n\t[]int{10, 20, 30, 40, 50, 60, 70}, \n\t[]int{100, 200, 300, 400, 500, 600, 700}, []int{1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{10, 20}, \n\t[]int{15, 2}, \n\t[]int{5, 10}, []int{10, 15, 5, 20, 2, 10})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{11, 44}, \n\t[]int{10, 15}, \n\t[]int{20, 5}, []int{11, 10, 20, 44, 15, 5})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 579,MBPP/579,Go,Write a function to find the dissimilar elements in the given two tuples.,"// Write a function to find the dissimilar elements in the given two tuples. func findDissimilar(test_tup1 []int, test_tup2 []int) []int {","func findDissimilar(test_tup1 []int, test_tup2 []int) []int {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findDissimilar', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(test_tup1 []int, test_tup2 []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{3, 4, 5, 6}, \n\t[]int{5, 7, 4, 10}, []int{3, 6, 7, 10})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4}, \n\t[]int{7, 2, 3, 9}, []int{1, 4, 7, 9})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{21, 11, 25, 26}, \n\t[]int{26, 34, 21, 36}, []int{34, 36, 11, 25})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 581,MBPP/581,Go,Write a go function to find the surface area of the square pyramid.,"// Write a go function to find the surface area of the square pyramid. func surfaceArea(b int, s int) int {","func surfaceArea(b int, s int) int {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'surfaceArea', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(b int, s int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(b, s),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(3, \n\t4, 33)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(4, \n\t5, 56)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(1, \n\t2, 5)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 583,MBPP/583,Go,Write a function for nth catalan number.,"// Write a function for nth catalan number. func catalanNumber(num int) int {",func catalanNumber(num int) int {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'catalanNumber', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(num int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(num),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(10, 16796)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(9, 4862)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(7, 429)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 584,MBPP/584,Go,Write a function to find all adverbs and their positions in a given sentence by using regex.,"// Write a function to find all adverbs and their positions in a given sentence by using regex. func findAdverbs(text string) string {",func findAdverbs(text string) string {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findAdverbs', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(text string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(text),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""Complete the task quickly"", ""18-25: quickly"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 586,MBPP/586,Go,Write a go function to split the array and add the first part to the end.,"// Write a go function to split the array and add the first part to the end. func splitArr(a []int, n int, k int) []int {","func splitArr(a []int, n int, k int) []int {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'splitArr', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a []int, n int, k int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, n, k),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{12, 10, 5, 6, 52, 36}, \n\t6, \n\t2, []int{5, 6, 52, 36, 12, 10})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4}, \n\t4, \n\t1, []int{2, 3, 4, 1})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{0, 1, 2, 3, 4, 5, 6, 7}, \n\t8, \n\t3, []int{3, 4, 5, 6, 7, 0, 1, 2})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 587,MBPP/587,Go,Write a function to convert array to a tuple.,"// Write a function to convert array to a tuple. func listTuple(listx []int) []int {",func listTuple(listx []int) []int {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'listTuple', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(listx []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(listx),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{5, 10, 7, 4, 15, 3}, []int{5, 10, 7, 4, 15, 3})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{2, 4, 5, 6, 2, 3, 4, 4, 7}, []int{2, 4, 5, 6, 2, 3, 4, 4, 7})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{58, 44, 56}, []int{58, 44, 56})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 588,MBPP/588,Go,Write a go function to find the difference between largest and smallest value in a given array.,"// Write a go function to find the difference between largest and smallest value in a given array. func bigDiff(nums []int) int {",func bigDiff(nums []int) int {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'bigDiff', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(nums []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(nums),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 2, 3, 4}, 3)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{4, 5, 12}, 8)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{9, 2, 3}, 7)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 589,MBPP/589,Go,Write a function to find perfect squares between two given numbers.,"// Write a function to find perfect squares between two given numbers. func perfectSquares(a int, b int) []int {","func perfectSquares(a int, b int) []int {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'perfectSquares', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(a int, b int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(a, b),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(1, \n\t30, []int{1, 4, 9, 16, 25})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(50, \n\t100, []int{64, 81, 100})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(100, \n\t200, []int{100, 121, 144, 169, 196})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 591,MBPP/591,Go,Write a go function to interchange the first and last elements in array.,"// Write a go function to interchange the first and last elements in array. func swapList(newlist []int) []int {",func swapList(newlist []int) []int {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'swapList', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual []int, expected []int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(newlist []int, expected []int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(newlist),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{12, 35, 9, 56, 24}, []int{24, 35, 9, 56, 12})\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3}, []int{3, 2, 1})\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{4, 5, 6}, []int{6, 5, 4})\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 592,MBPP/592,Go,Write a go function to find sum of product of binomial co-efficients.,"// Write a go function to find sum of product of binomial co-efficients. func sumOfProduct(n int) int {",func sumOfProduct(n int) int {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'sumOfProduct', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(3, 15)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(4, 56)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(1, 1)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 593,MBPP/593,Go,Write a function to remove leading zeroes from an ip address.,"// Write a function to remove leading zeroes from an ip address. func removezeroIp(ip string) string {",func removezeroIp(ip string) string {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'removezeroIp', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual string, expected string) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(ip string, expected string) string {\n if validateSolution(PLACEHOLDER_FN_NAME(ip),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(""216.08.094.196"", ""216.8.94.196"")\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(""12.01.024"", ""12.1.24"")\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(""216.08.094.0196"", ""216.8.94.196"")\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 594,MBPP/594,Go,Write a function to find the difference of first even and odd number of a given array.,"// Write a function to find the difference of first even and odd number of a given array. func diffEvenOdd(list1 []int) int {",func diffEvenOdd(list1 []int) int {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(list1 []int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(list1),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{1, 3, 5, 7, 4, 1, 6, 8}, 3)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 1)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{1, 5, 7, 9, 10}, 9)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 597,MBPP/597,Go,Write a function to find kth element from the given two sorted arrays.,"// Write a function to find kth element from the given two sorted arrays. func findKth(arr1 []int, arr2 []int, m int, n int, k int) int {","func findKth(arr1 []int, arr2 []int, m int, n int, k int) int {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'findKth', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual int, expected int) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(arr1 []int, arr2 []int, m int, n int, k int, expected int) string {\n if validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver([]int{2, 3, 6, 7, 9}, \n\t[]int{1, 4, 8, 10}, \n\t5, \n\t4, \n\t5, 6)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver([]int{100, 112, 256, 349, 770}, \n\t[]int{72, 86, 113, 119, 265, 445, 892}, \n\t5, \n\t7, \n\t7, 256)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver([]int{3, 4, 7, 8, 10}, \n\t[]int{2, 5, 9, 11}, \n\t5, \n\t4, \n\t6, 8)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 598,MBPP/598,Go,Write a function to check whether the given number is armstrong or not.,"// Write a function to check whether the given number is armstrong or not. func armstrongNumber(number int) bool {",func armstrongNumber(number int) bool {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'armstrongNumber', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(number int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(number),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(153, true)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(259, false)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(4458, false)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 600,MBPP/600,Go,Write a go function to check whether the given number is even or not using bitwise operator.,"// Write a go function to check whether the given number is even or not using bitwise operator. func isEven(n int) bool {",func isEven(n int) bool {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'go', 'entry_fn_name': 'isEven', 'test_code': 'package main\n\nimport (\n ""fmt""\n ""reflect""\n ""math""\n ""sort""\n)\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfunc validateSolution(actual bool, expected bool) bool {\n return reflect.DeepEqual(actual,expected)\n}\n\nfunc driver(n int, expected bool) string {\n if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {\n return ""PASSED""\n }\n return ""FAILED""\n\n}\n\nfunc main() {\n\n // Use imports to avoid undefined errors\n var _ = reflect.DeepEqual\n _ = math.Abs\n _ = sort.Sort\n result := """"\n result = driver(1, false)\n fmt.Printf(""TEST-0...%s\\n"", result)\n \n result = driver(2, true)\n fmt.Printf(""TEST-1...%s\\n"", result)\n \n result = driver(3, false)\n fmt.Printf(""TEST-2...%s\\n"", result)\n \n \n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['go', 'build', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 511,MBPP/511,Haskell,Write a haskell function to find minimum sum of factors of a given number.,"-- | Write a haskell function to find minimum sum of factors of a given number. findMinSum :: Integer -> Integer findMinSum num = ","findMinSum :: Integer -> Integer findMinSum num = ",['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findMinSum', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find minimum sum of factors of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver num expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME num) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (12) (7) )\n\n printf ""TEST-1...%s\\n"" (driver (105) (15) )\n\n printf ""TEST-2...%s\\n"" (driver (2) (2) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 514,MBPP/514,Haskell,Write a function to find the summation of tuple elements in the given tuple list.,"-- | Write a function to find the summation of tuple elements in the given tuple list. sumElements :: [Integer] -> Integer sumElements test_tup = ","sumElements :: [Integer] -> Integer sumElements test_tup = ",['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'sumElements', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the summation of tuple elements in the given tuple list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver test_tup expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME test_tup) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([7, 8, 9, 1, 10, 7]) (42) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4, 5, 6]) (21) )\n\n printf ""TEST-2...%s\\n"" (driver ([11, 12, 13, 45, 14]) (95) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 515,MBPP/515,Haskell,Write a function to check if there is a subset with sum divisible by m.,"-- | Write a function to check if there is a subset with sum divisible by m. modularSum :: [Integer] -> Integer -> Integer -> Bool modularSum arr n m = ","modularSum :: [Integer] -> Integer -> Integer -> Bool modularSum arr n m = ","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'modularSum', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check if there is a subset with sum divisible by m.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> Bool -> String\ndriver arr n m expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n m) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([3, 1, 7, 5]) (4) (6) (True) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 7]) (2) (5) (False) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 6]) (2) (5) (False) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 516,MBPP/516,Haskell,Write a function to sort a list of elements using radix sort.,"-- | Write a function to sort a list of elements using radix sort. radixSort :: [Integer] -> [Integer] radixSort nums = ","radixSort :: [Integer] -> [Integer] radixSort nums = ",['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'radixSort', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to sort a list of elements using radix sort.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> String\ndriver nums expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME nums) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([15, 79, 25, 68, 37]) ([15, 25, 37, 68, 79]) )\n\n printf ""TEST-1...%s\\n"" (driver ([9, 11, 8, 7, 3, 2]) ([2, 3, 7, 8, 9, 11]) )\n\n printf ""TEST-2...%s\\n"" (driver ([36, 12, 24, 26, 29]) ([12, 24, 26, 29, 36]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 517,MBPP/517,Haskell,Write a haskell function to find the largest postive number from the given list.,"-- | Write a haskell function to find the largest postive number from the given list. largestPos :: [Integer] -> Integer largestPos list1 = ","largestPos :: [Integer] -> Integer largestPos list1 = ",['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'largestPos', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the largest postive number from the given list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver list1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 4, -1]) (4) )\n\n printf ""TEST-1...%s\\n"" (driver ([0, 1, 2, -5, -1, 6]) (6) )\n\n printf ""TEST-2...%s\\n"" (driver ([0, 0, 1, 0]) (1) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 518,MBPP/518,Haskell,Write a function to find the square root of a perfect number.,"-- | Write a function to find the square root of a perfect number. sqrtRoot :: Integer -> Integer sqrtRoot num = ","sqrtRoot :: Integer -> Integer sqrtRoot num = ",['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'sqrtRoot', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the square root of a perfect number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver num expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME num) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (4) (2) )\n\n printf ""TEST-1...%s\\n"" (driver (16) (4) )\n\n printf ""TEST-2...%s\\n"" (driver (400) (20) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 519,MBPP/519,Haskell,Write a function to calculate volume of a tetrahedron.,"-- | Write a function to calculate volume of a tetrahedron. volumeTetrahedron :: Integer -> Double volumeTetrahedron num = ","volumeTetrahedron :: Integer -> Double volumeTetrahedron num = ",['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to calculate volume of a tetrahedron.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Double -> Double -> Bool\nvalidateSolution actual expected = do\n (abs (actual-expected)) < 1e-06\n\ndriver :: Integer -> Double -> String\ndriver num expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME num) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (10) (117.85) )\n\n printf ""TEST-1...%s\\n"" (driver (15) (397.75) )\n\n printf ""TEST-2...%s\\n"" (driver (20) (942.81) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 520,MBPP/520,Haskell,Write a function to find the lcm of the given list elements.,"-- | Write a function to find the lcm of the given list elements. getLcm :: [Integer] -> Integer getLcm l = ","getLcm :: [Integer] -> Integer getLcm l = ",['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'getLcm', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the lcm of the given array elements.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver l expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME l) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([2, 7, 3, 9, 4]) (252) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 8, 3]) (24) )\n\n printf ""TEST-2...%s\\n"" (driver ([3, 8, 4, 10, 5]) (120) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 521,MBPP/521,Haskell,Write a function to print check if the triangle is scalene or not.,"-- | Write a function to print check if the triangle is scalene or not. checkIsosceles :: Integer -> Integer -> Integer -> Bool checkIsosceles x y z = ","checkIsosceles :: Integer -> Integer -> Integer -> Bool checkIsosceles x y z = ","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'checkIsosceles', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to print check if the triangle is scalene or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> Integer -> Bool -> String\ndriver x y z expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME x y z) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (6) (8) (12) (True) )\n\n printf ""TEST-1...%s\\n"" (driver (6) (6) (12) (False) )\n\n printf ""TEST-2...%s\\n"" (driver (6) (15) (20) (True) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 522,MBPP/522,Haskell,Write a function to find the longest bitonic subsequence for the given list.,"-- | Write a function to find the longest bitonic subsequence for the given list. lbs :: [Integer] -> Integer lbs arr = ","lbs :: [Integer] -> Integer lbs arr = ",['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'lbs', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the longest bitonic subsequence for the given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver arr expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]) (7) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 11, 2, 10, 4, 5, 2, 1]) (6) )\n\n printf ""TEST-2...%s\\n"" (driver ([80, 60, 30, 40, 20, 10]) (5) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 523,MBPP/523,Haskell,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","-- | Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. checkString :: String -> [String] checkString str1 = ","checkString :: String -> [String] checkString str1 = ",['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'checkString', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [String] -> [String] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> [String] -> String\ndriver str1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME str1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""python"") ([""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""]) )\n\n printf ""TEST-1...%s\\n"" (driver (""123python"") ([""String must have 1 upper case character.""]) )\n\n printf ""TEST-2...%s\\n"" (driver (""123Python"") ([""Valid string.""]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 524,MBPP/524,Haskell,Write a function to find the sum of maximum increasing subsequence of the given list.,"-- | Write a function to find the sum of maximum increasing subsequence of the given list. maxSumIncreasingSubsequence :: [Integer] -> Integer -> Integer maxSumIncreasingSubsequence arr n = ","maxSumIncreasingSubsequence :: [Integer] -> Integer -> Integer maxSumIncreasingSubsequence arr n = ","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the sum of maximum increasing subsequence of the given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> String\ndriver arr n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 101, 2, 3, 100, 4, 5]) (7) (106) )\n\n printf ""TEST-1...%s\\n"" (driver ([3, 4, 5, 10]) (4) (22) )\n\n printf ""TEST-2...%s\\n"" (driver ([10, 5, 4, 3]) (4) (10) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 525,MBPP/525,Haskell,Write a haskell function to check whether two given lines are parallel or not.,"-- | Write a haskell function to check whether two given lines are parallel or not. parallelLines :: [Integer] -> [Integer] -> Bool parallelLines line1 line2 = ","parallelLines :: [Integer] -> [Integer] -> Bool parallelLines line1 line2 = ","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'parallelLines', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether two given lines are parallel or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> Bool -> String\ndriver line1 line2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME line1 line2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([2, 3, 4]) ([2, 3, 8]) (True) )\n\n printf ""TEST-1...%s\\n"" (driver ([2, 3, 4]) ([4, -3, 8]) (False) )\n\n printf ""TEST-2...%s\\n"" (driver ([3, 3]) ([5, 5]) (True) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 526,MBPP/526,Haskell,Write a haskell function to capitalize first and last letters of each word of a given string.,"-- | Write a haskell function to capitalize first and last letters of each word of a given string. capitalizeFirstLastLetters :: String -> String capitalizeFirstLastLetters str1 = ","capitalizeFirstLastLetters :: String -> String capitalizeFirstLastLetters str1 = ",['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to capitalize first and last letters of each word of a given string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver str1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME str1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""python"") (""PythoN"") )\n\n printf ""TEST-1...%s\\n"" (driver (""bigdata"") (""BigdatA"") )\n\n printf ""TEST-2...%s\\n"" (driver (""Hadoop"") (""HadooP"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 527,MBPP/527,Haskell,Write a function to find all pairs in an integer list whose sum is equal to a given number.,"-- | Write a function to find all pairs in an integer list whose sum is equal to a given number. getPairsCount :: [Integer] -> Integer -> Integer -> Integer getPairsCount arr n sum = ","getPairsCount :: [Integer] -> Integer -> Integer -> Integer getPairsCount arr n sum = ","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'getPairsCount', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find all pairs in an integer array whose sum is equal to a given number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> Integer -> String\ndriver arr n sum expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n sum) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 5, 7, -1, 5]) (5) (6) (3) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 5, 7, -1]) (4) (6) (2) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 1, 1, 1]) (4) (2) (6) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 529,MBPP/529,Haskell,Write a function to find the nth jacobsthal-lucas number.,"-- | Write a function to find the nth jacobsthal-lucas number. jacobsthalLucas :: Integer -> Integer jacobsthalLucas n = ","jacobsthalLucas :: Integer -> Integer jacobsthalLucas n = ",['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the nth jacobsthal-lucas number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (5) (31) )\n\n printf ""TEST-1...%s\\n"" (driver (2) (5) )\n\n printf ""TEST-2...%s\\n"" (driver (4) (17) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 530,MBPP/530,Haskell,Write a function to find the ration of negative numbers in list of integers.,"-- | Write a function to find the ration of negative numbers in list of integers. negativeCount :: [Integer] -> Double negativeCount nums = ","negativeCount :: [Integer] -> Double negativeCount nums = ",['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'negativeCount', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the ration of negative numbers in an array of integers.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Double -> Double -> Bool\nvalidateSolution actual expected = do\n (abs (actual-expected)) < 1e-06\n\ndriver :: [Integer] -> Double -> String\ndriver nums expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME nums) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]) (0.31) )\n\n printf ""TEST-1...%s\\n"" (driver ([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]) (0.31) )\n\n printf ""TEST-2...%s\\n"" (driver ([2, 4, -6, -9, 11, -12, 14, -5, 17]) (0.44) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 531,MBPP/531,Haskell,Write a function to find minimum number of coins that make a given value.,"-- | Write a function to find minimum number of coins that make a given value. minCoins :: [Integer] -> Integer -> Integer -> Integer minCoins coins m v = ","minCoins :: [Integer] -> Integer -> Integer -> Integer minCoins coins m v = ","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'minCoins', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find minimum number of coins that make a given value.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> Integer -> String\ndriver coins m v expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME coins m v) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([9, 6, 5, 1]) (4) (11) (2) )\n\n printf ""TEST-1...%s\\n"" (driver ([4, 5, 6, 7, 8, 9]) (6) (9) (1) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3]) (3) (4) (2) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 532,MBPP/532,Haskell,Write a function to check if the two given strings are permutations of each other.,"-- | Write a function to check if the two given strings are permutations of each other. checkPermutation :: String -> String -> Bool checkPermutation str1 str2 = ","checkPermutation :: String -> String -> Bool checkPermutation str1 str2 = ","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'checkPermutation', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check if the two given strings are permutations of each other.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> Bool -> String\ndriver str1 str2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME str1 str2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""abc"") (""cba"") (True) )\n\n printf ""TEST-1...%s\\n"" (driver (""test"") (""ttew"") (False) )\n\n printf ""TEST-2...%s\\n"" (driver (""xxyz"") (""yxzx"") (True) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 534,MBPP/534,Haskell,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"-- | Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. searchLiteral :: String -> String -> [Integer] searchLiteral pattern text = ","searchLiteral :: String -> String -> [Integer] searchLiteral pattern text = ","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'searchLiteral', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> [Integer] -> String\ndriver pattern text expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME pattern text) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""python"") (""python programming language"") ([0, 6]) )\n\n printf ""TEST-1...%s\\n"" (driver (""programming"") (""python programming language"") ([7, 18]) )\n\n printf ""TEST-2...%s\\n"" (driver (""language"") (""python programming language"") ([19, 27]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 535,MBPP/535,Haskell,Write a function to find the top or bottom surface area of a cylinder.,"-- | Write a function to find the top or bottom surface area of a cylinder. topbottomSurfacearea :: Integer -> Double topbottomSurfacearea r = ","topbottomSurfacearea :: Integer -> Double topbottomSurfacearea r = ",['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the top or bottom surface area of a cylinder.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Double -> Double -> Bool\nvalidateSolution actual expected = do\n (abs (actual-expected)) < 1e-09\n\ndriver :: Integer -> Double -> String\ndriver r expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME r) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (10) (314.15000000000003) )\n\n printf ""TEST-1...%s\\n"" (driver (5) (78.53750000000001) )\n\n printf ""TEST-2...%s\\n"" (driver (4) (50.264) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 536,MBPP/536,Haskell,Write a function to select the nth items of a list.,"-- | Write a function to select the nth items of a list. nthItems :: [Integer] -> Integer -> [Integer] nthItems list n = ","nthItems :: [Integer] -> Integer -> [Integer] nthItems list n = ","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'nthItems', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to select the nth items of a list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> [Integer] -> String\ndriver list n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 4, 5, 6, 7, 8, 9]) (2) ([1, 3, 5, 7, 9]) )\n\n printf ""TEST-1...%s\\n"" (driver ([10, 15, 19, 17, 16, 18]) (3) ([10, 17]) )\n\n printf ""TEST-2...%s\\n"" (driver ([14, 16, 19, 15, 17]) (4) ([14, 17]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 537,MBPP/537,Haskell,Write a haskell function to find the first repeated word in a given string.,"-- | Write a haskell function to find the first repeated word in a given string. firstRepeatedWord :: String -> String firstRepeatedWord str1 = ","firstRepeatedWord :: String -> String firstRepeatedWord str1 = ",['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the first repeated word in a given string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver str1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME str1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""ab ca bc ab"") (""ab"") )\n\n printf ""TEST-1...%s\\n"" (driver (""ab ca bc"") (""None"") )\n\n printf ""TEST-2...%s\\n"" (driver (""ab ca bc ca ab bc"") (""ca"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 538,MBPP/538,Haskell,Write a haskell function to convert a given string list to a tuple.,"-- | Write a haskell function to convert a given string list to a tuple. stringListToTuple :: String -> [Char] stringListToTuple str1 = ","stringListToTuple :: String -> [Char] stringListToTuple str1 = ",['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'stringListToTuple', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to convert a given string list to a tuple.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Char] -> [Char] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> [Char] -> String\ndriver str1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME str1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""python 3.0"") ([\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\']) )\n\n printf ""TEST-1...%s\\n"" (driver (""bigdata"") ([\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\']) )\n\n printf ""TEST-2...%s\\n"" (driver (""language"") ([\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\']) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 539,MBPP/539,Haskell,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.,"-- | Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function. basesnumCoresspondingnum :: [Integer] -> [Integer] -> [Integer] basesnumCoresspondingnum bases_num index = ","basesnumCoresspondingnum :: [Integer] -> [Integer] -> [Integer] basesnumCoresspondingnum bases_num index = ","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> [Integer] -> String\ndriver bases_num index expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME bases_num index) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ([10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4, 5, 6, 7]) ([10, 20, 30, 40, 50, 60, 70]) ([1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249]) )\n\n printf ""TEST-2...%s\\n"" (driver ([4, 8, 12, 16, 20, 24, 28]) ([3, 6, 9, 12, 15, 18, 21]) ([64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 540,MBPP/540,Haskell,Write a haskell function to find the difference between highest and least frequencies in a given list.,"-- | Write a haskell function to find the difference between highest and least frequencies in a given list. findDiff :: [Integer] -> Integer -> Integer findDiff arr n = ","findDiff :: [Integer] -> Integer -> Integer findDiff arr n = ","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findDiff', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between highest and least frequencies in a given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> String\ndriver arr n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 1, 2, 2, 7, 8, 4, 5, 1, 4]) (10) (2) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 7, 9, 2, 3, 3, 1, 3, 3]) (9) (3) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 1, 2]) (4) (0) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 541,MBPP/541,Haskell,Write a function to find if the given number is abundant or not.,"-- | Write a function to find if the given number is abundant or not. checkAbundant :: Integer -> Bool checkAbundant n = ","checkAbundant :: Integer -> Bool checkAbundant n = ",['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'checkAbundant', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find if the given number is abundant or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Bool -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (12) (True) )\n\n printf ""TEST-1...%s\\n"" (driver (15) (False) )\n\n printf ""TEST-2...%s\\n"" (driver (18) (True) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 542,MBPP/542,Haskell,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","-- | Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. fillSpaces :: String -> String fillSpaces text = ","fillSpaces :: String -> String fillSpaces text = ",['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'fillSpaces', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver text expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME text) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""Boult Curve Wireless Neckband"") (""Boult:Curve:Wireless:Neckband"") )\n\n printf ""TEST-1...%s\\n"" (driver (""Stereo Sound Sweatproof"") (""Stereo:Sound:Sweatproof"") )\n\n printf ""TEST-2...%s\\n"" (driver (""Probass Curve Audio"") (""Probass:Curve:Audio"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 543,MBPP/543,Haskell,Write a function to add two numbers and print number of digits of sum.,"-- | Write a function to add two numbers and print number of digits of sum. countDigits :: Integer -> Integer -> Integer countDigits num1 num2 = ","countDigits :: Integer -> Integer -> Integer countDigits num1 num2 = ","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'countDigits', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to add two numbers and print number of digits of sum.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> Integer -> String\ndriver num1 num2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME num1 num2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (9875) (10) (4) )\n\n printf ""TEST-1...%s\\n"" (driver (98759853034) (100) (11) )\n\n printf ""TEST-2...%s\\n"" (driver (1234567) (500) (7) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 545,MBPP/545,Haskell,Write a haskell function to toggle only first and last bits of a given number.,"-- | Write a haskell function to toggle only first and last bits of a given number. toggleFAndLBits :: Integer -> Integer toggleFAndLBits n = ","toggleFAndLBits :: Integer -> Integer toggleFAndLBits n = ",['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to toggle only first and last bits of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (10) (3) )\n\n printf ""TEST-1...%s\\n"" (driver (15) (6) )\n\n printf ""TEST-2...%s\\n"" (driver (20) (5) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 546,MBPP/546,Haskell,Write a function to find the last occurrence of a character in a string.,"-- | Write a function to find the last occurrence of a character in a string. lastOccurenceChar :: String -> Char -> Integer lastOccurenceChar string_arg0 char_arg1 = ","lastOccurenceChar :: String -> Char -> Integer lastOccurenceChar string_arg0 char_arg1 = ","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the last occurrence of a character in a string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> Char -> Integer -> String\ndriver string_arg0 char_arg1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME string_arg0 char_arg1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""hello world"") (\'l\') (10) )\n\n printf ""TEST-1...%s\\n"" (driver (""language"") (\'g\') (7) )\n\n printf ""TEST-2...%s\\n"" (driver (""little"") (\'y\') (None) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 547,MBPP/547,Haskell,Write a haskell function to find the sum of hamming distances of all consecutive numbers from o to n.,"-- | Write a haskell function to find the sum of hamming distances of all consecutive numbers from o to n. totalHammingDistance :: Integer -> Integer totalHammingDistance n = ","totalHammingDistance :: Integer -> Integer totalHammingDistance n = ",['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (4) (7) )\n\n printf ""TEST-1...%s\\n"" (driver (2) (3) )\n\n printf ""TEST-2...%s\\n"" (driver (5) (8) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 548,MBPP/548,Haskell,Write a function to find the length of the longest increasing subsequence of the given sequence.,"-- | Write a function to find the length of the longest increasing subsequence of the given sequence. longestIncreasingSubsequence :: [Integer] -> Integer longestIncreasingSubsequence arr = ","longestIncreasingSubsequence :: [Integer] -> Integer longestIncreasingSubsequence arr = ",['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the length of the longest increasing subsequence of the given sequence.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver arr expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([10, 22, 9, 33, 21, 50, 41, 60]) (5) )\n\n printf ""TEST-1...%s\\n"" (driver ([3, 10, 2, 1, 20]) (3) )\n\n printf ""TEST-2...%s\\n"" (driver ([50, 3, 10, 7, 40, 80]) (4) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 549,MBPP/549,Haskell,Write a haskell function to find the sum of fifth power of first n odd natural numbers.,"-- | Write a haskell function to find the sum of fifth power of first n odd natural numbers. oddNumSum :: Integer -> Integer oddNumSum n = ","oddNumSum :: Integer -> Integer oddNumSum n = ",['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'oddNumSum', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the sum of fifth power of first n odd natural numbers.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (1) (1) )\n\n printf ""TEST-1...%s\\n"" (driver (2) (244) )\n\n printf ""TEST-2...%s\\n"" (driver (3) (3369) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 550,MBPP/550,Haskell,Write a haskell function to find the maximum element in a sorted and rotated list.,"-- | Write a haskell function to find the maximum element in a sorted and rotated list. findMax :: [Integer] -> Integer -> Integer -> Integer findMax arr low high = ","findMax :: [Integer] -> Integer -> Integer -> Integer findMax arr low high = ","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findMax', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the maximum element in a sorted and rotated array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> Integer -> String\ndriver arr low high expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr low high) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([2, 3, 5, 6, 9]) (0) (4) (9) )\n\n printf ""TEST-1...%s\\n"" (driver ([3, 4, 5, 2, 1]) (0) (4) (5) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3]) (0) (2) (3) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 551,MBPP/551,Haskell,Write a function to extract a specified column from a given nested list.,"-- | Write a function to extract a specified column from a given nested list. extractColumn :: [[Integer]] -> Integer -> [Integer] extractColumn list1 n = ","extractColumn :: [[Integer]] -> Integer -> [Integer] extractColumn list1 n = ","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'extractColumn', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to extract a specified column from a given nested list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [[Integer]] -> Integer -> [Integer] -> String\ndriver list1 n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1 n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([[1, 2, 3], [2, 4, 5], [1, 1, 1]]) (0) ([1, 2, 1]) )\n\n printf ""TEST-1...%s\\n"" (driver ([[1, 2, 3], [-2, 4, -5], [1, -1, 1]]) (2) ([3, -5, 1]) )\n\n printf ""TEST-2...%s\\n"" (driver ([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]]) (0) ([1, 5, 1, 13, 5, 9]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 552,MBPP/552,Haskell,Write a haskell function to check whether a given sequence is linear or not.,"-- | Write a haskell function to check whether a given sequence is linear or not. seqLinear :: [Integer] -> String seqLinear seq_nums = ","seqLinear :: [Integer] -> String seqLinear seq_nums = ",['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'seqLinear', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether a given sequence is linear or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> String -> String\ndriver seq_nums expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME seq_nums) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([0, 2, 4, 6, 8, 10]) (""Linear Sequence"") )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3]) (""Linear Sequence"") )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 5, 2]) (""Non Linear Sequence"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 553,MBPP/553,Haskell,Write a function to convert the given tuple to a floating-point number.,"-- | Write a function to convert the given tuple to a floating-point number. tupleToFloat :: [Integer] -> Double tupleToFloat test_tup = ","tupleToFloat :: [Integer] -> Double tupleToFloat test_tup = ",['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'tupleToFloat', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to convert the given tuple to a floating-point number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Double -> Double -> Bool\nvalidateSolution actual expected = do\n (abs (actual-expected)) < 1e-06\n\ndriver :: [Integer] -> Double -> String\ndriver test_tup expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME test_tup) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([4, 56]) (4.56) )\n\n printf ""TEST-1...%s\\n"" (driver ([7, 256]) (7.256) )\n\n printf ""TEST-2...%s\\n"" (driver ([8, 123]) (8.123) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 554,MBPP/554,Haskell,Write a haskell function to find odd numbers from a mixed list.,"-- | Write a haskell function to find odd numbers from a mixed list. split :: [Integer] -> [Integer] split list = ","split :: [Integer] -> [Integer] split list = ",['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'split', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find odd numbers from a mixed list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> String\ndriver list expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 4, 5, 6]) ([1, 3, 5]) )\n\n printf ""TEST-1...%s\\n"" (driver ([10, 11, 12, 13]) ([11, 13]) )\n\n printf ""TEST-2...%s\\n"" (driver ([7, 8, 9, 1]) ([7, 9, 1]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 555,MBPP/555,Haskell,Write a haskell function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"-- | Write a haskell function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. difference :: Integer -> Integer difference n = ","difference :: Integer -> Integer difference n = ",['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'difference', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (3) (30) )\n\n printf ""TEST-1...%s\\n"" (driver (5) (210) )\n\n printf ""TEST-2...%s\\n"" (driver (2) (6) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 556,MBPP/556,Haskell,Write a haskell function to count the pairs with xor as an odd number.,"-- | Write a haskell function to count the pairs with xor as an odd number. findOddPair :: [Integer] -> Integer -> Integer findOddPair a n = ","findOddPair :: [Integer] -> Integer -> Integer findOddPair a n = ","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findOddPair', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to count the pairs with xor as an odd number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> String\ndriver a n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([5, 4, 7, 2, 1]) (5) (6) )\n\n printf ""TEST-1...%s\\n"" (driver ([7, 2, 8, 1, 0, 5, 11]) (7) (12) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3]) (3) (2) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 557,MBPP/557,Haskell,Write a function to toggle characters case in a string.,"-- | Write a function to toggle characters case in a string. toggleString :: String -> String toggleString string_arg0 = ","toggleString :: String -> String toggleString string_arg0 = ",['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'toggleString', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to toggle characters case in a string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver string_arg0 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME string_arg0) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""Python"") (""pYTHON"") )\n\n printf ""TEST-1...%s\\n"" (driver (""Pangram"") (""pANGRAM"") )\n\n printf ""TEST-2...%s\\n"" (driver (""LIttLE"") (""liTTle"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 558,MBPP/558,Haskell,Write a haskell function to find the digit distance between two integers.,"-- | Write a haskell function to find the digit distance between two integers. digitDistanceNums :: Integer -> Integer -> Integer digitDistanceNums n1 n2 = ","digitDistanceNums :: Integer -> Integer -> Integer digitDistanceNums n1 n2 = ","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the digit distance between two integers.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> Integer -> String\ndriver n1 n2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n1 n2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (1) (2) (1) )\n\n printf ""TEST-1...%s\\n"" (driver (23) (56) (6) )\n\n printf ""TEST-2...%s\\n"" (driver (123) (256) (7) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 559,MBPP/559,Haskell,Write a function to find the largest sum of contiguous subarray in the given list.,"-- | Write a function to find the largest sum of contiguous subarray in the given list. maxSubArraySum :: [Integer] -> Integer -> Integer maxSubArraySum a size = ","maxSubArraySum :: [Integer] -> Integer -> Integer maxSubArraySum a size = ","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the largest sum of contiguous subarray in the given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> String\ndriver a size expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a size) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([-2, -3, 4, -1, -2, 1, 5, -3]) (8) (7) )\n\n printf ""TEST-1...%s\\n"" (driver ([-3, -4, 5, -2, -3, 2, 6, -4]) (8) (8) )\n\n printf ""TEST-2...%s\\n"" (driver ([-4, -5, 6, -3, -4, 3, 7, -5]) (8) (10) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 560,MBPP/560,Haskell,Write a function to find the union of elements of the given tuples.,"-- | Write a function to find the union of elements of the given tuples. unionElements :: [Integer] -> [Integer] -> [Integer] unionElements test_tup1 test_tup2 = ","unionElements :: [Integer] -> [Integer] -> [Integer] unionElements test_tup1 test_tup2 = ","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'unionElements', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the union of elements of the given tuples.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> [Integer] -> String\ndriver test_tup1 test_tup2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME test_tup1 test_tup2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([3, 4, 5, 6]) ([5, 7, 4, 10]) ([3, 4, 5, 6, 7, 10]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4]) ([3, 4, 5, 6]) ([1, 2, 3, 4, 5, 6]) )\n\n printf ""TEST-2...%s\\n"" (driver ([11, 12, 13, 14]) ([13, 15, 16, 17]) ([11, 12, 13, 14, 15, 16, 17]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 562,MBPP/562,Haskell,Write a haskell function to find the maximum length of sublist.,"-- | Write a haskell function to find the maximum length of sublist. findMaxLength :: [[Integer]] -> Integer findMaxLength lst = ","findMaxLength :: [[Integer]] -> Integer findMaxLength lst = ",['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findMaxLength', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the maximum length of sublist.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [[Integer]] -> Integer -> String\ndriver lst expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME lst) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([[1], [1, 4], [5, 6, 7, 8]]) (4) )\n\n printf ""TEST-1...%s\\n"" (driver ([[0, 1], [2, 2], [3, 2, 1]]) (3) )\n\n printf ""TEST-2...%s\\n"" (driver ([[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]) (5) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 563,MBPP/563,Haskell,Write a function to extract values between quotation marks of a string.,"-- | Write a function to extract values between quotation marks of a string. extractValues :: String -> [String] extractValues text = ","extractValues :: String -> [String] extractValues text = ",['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'extractValues', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to extract values between quotation marks of a string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [String] -> [String] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> [String] -> String\ndriver text expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME text) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""\\""Python\\"", \\""PHP\\"", \\""Java\\"""") ([""Python"", ""PHP"", ""Java""]) )\n\n printf ""TEST-1...%s\\n"" (driver (""\\""python\\"",\\""program\\"",\\""language\\"""") ([""python"", ""program"", ""language""]) )\n\n printf ""TEST-2...%s\\n"" (driver (""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""") ([""red"", ""blue"", ""green"", ""yellow""]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 564,MBPP/564,Haskell,Write a haskell function to count unequal element pairs from the given list.,"-- | Write a haskell function to count unequal element pairs from the given list. countPairs :: [Integer] -> Integer -> Integer countPairs arr n = ","countPairs :: [Integer] -> Integer -> Integer countPairs arr n = ","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'countPairs', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to count unequal element pairs from the given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> String\ndriver arr n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 1]) (3) (2) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 1, 1, 1]) (4) (0) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3, 4, 5]) (5) (10) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 565,MBPP/565,Haskell,Write a haskell function to split a string into characters.,"-- | Write a haskell function to split a string into characters. split :: String -> [Char] split word = ","split :: String -> [Char] split word = ",['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'split', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to split a string into characters.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Char] -> [Char] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> [Char] -> String\ndriver word expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME word) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""python"") ([\'p\', \'y\', \'t\', \'h\', \'o\', \'n\']) )\n\n printf ""TEST-1...%s\\n"" (driver (""Name"") ([\'N\', \'a\', \'m\', \'e\']) )\n\n printf ""TEST-2...%s\\n"" (driver (""program"") ([\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\']) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 566,MBPP/566,Haskell,Write a function to get the sum of a non-negative integer.,"-- | Write a function to get the sum of a non-negative integer. sumDigits :: Integer -> Integer sumDigits n = ","sumDigits :: Integer -> Integer sumDigits n = ",['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'sumDigits', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to get the sum of a non-negative integer.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (345) (12) )\n\n printf ""TEST-1...%s\\n"" (driver (12) (3) )\n\n printf ""TEST-2...%s\\n"" (driver (97) (16) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 567,MBPP/567,Haskell,Write a function to check whether a specified list is sorted or not.,"-- | Write a function to check whether a specified list is sorted or not. issortList :: [Integer] -> Bool issortList list1 = ","issortList :: [Integer] -> Bool issortList list1 = ",['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'issortList', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether a specified list is sorted or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Bool -> String\ndriver list1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 4, 6, 8, 10, 12, 14, 16, 17]) (True) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 4, 6, 8, 10, 12, 14, 20, 17]) (False) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 4, 6, 8, 10, 15, 14, 20]) (False) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 569,MBPP/569,Haskell,Write a function to sort each sublist of strings in a given list of lists.,"-- | Write a function to sort each sublist of strings in a given list of lists. sortSublists :: [[String]] -> [[String]] sortSublists list1 = ","sortSublists :: [[String]] -> [[String]] sortSublists list1 = ",['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'sortSublists', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to sort each sublist of strings in a given list of lists.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [[String]] -> [[String]] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [[String]] -> [[String]] -> String\ndriver list1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]) ([[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]]) )\n\n printf ""TEST-1...%s\\n"" (driver ([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]) ([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]) )\n\n printf ""TEST-2...%s\\n"" (driver ([[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]) ([[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 570,MBPP/570,Haskell,Write a function to remove words from a given list of strings containing a character or string.,"-- | Write a function to remove words from a given list of strings containing a character or string. removeWords :: [String] -> [String] -> [String] removeWords list1 charlist = ","removeWords :: [String] -> [String] -> [String] removeWords list1 charlist = ","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'removeWords', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to remove words from a given list of strings containing a character or string.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [String] -> [String] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [String] -> [String] -> [String] -> String\ndriver list1 charlist expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1 charlist) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""]) ([""#"", ""color"", ""@""]) ([""Red"", """", ""Green"", ""Orange"", ""White""]) )\n\n printf ""TEST-1...%s\\n"" (driver ([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""]) ([""&"", ""+"", ""@""]) ([""Red"", """", ""Green"", ""Orange"", ""White""]) )\n\n printf ""TEST-2...%s\\n"" (driver ([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""]) ([""@""]) ([""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 571,MBPP/571,Haskell,Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k.,"-- | Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k. maxSumPairDiffLessthanK :: [Integer] -> Integer -> Integer -> Integer maxSumPairDiffLessthanK arr n k = ","maxSumPairDiffLessthanK :: [Integer] -> Integer -> Integer -> Integer maxSumPairDiffLessthanK arr n k = ","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> Integer -> String\ndriver arr n k expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr n k) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([3, 5, 10, 15, 17, 12, 9]) (7) (4) (62) )\n\n printf ""TEST-1...%s\\n"" (driver ([5, 15, 10, 300]) (4) (12) (25) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3, 4, 5, 6]) (6) (6) (21) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 572,MBPP/572,Haskell,Write a haskell function to remove two duplicate numbers from a given number of lists.,"-- | Write a haskell function to remove two duplicate numbers from a given number of lists. twoUniqueNums :: [Integer] -> [Integer] twoUniqueNums nums = ","twoUniqueNums :: [Integer] -> [Integer] twoUniqueNums nums = ",['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to remove two duplicate numbers from a given number of lists.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> String\ndriver nums expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME nums) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 2, 3, 4, 5]) ([1, 4, 5]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 2, 4, 5]) ([1, 3, 4, 5]) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 2, 3, 4, 5]) ([1, 2, 3, 4, 5]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 573,MBPP/573,Haskell,Write a haskell function to calculate the product of the unique numbers of a given list.,"-- | Write a haskell function to calculate the product of the unique numbers of a given list. uniqueProduct :: [Integer] -> Integer uniqueProduct list_data = ","uniqueProduct :: [Integer] -> Integer uniqueProduct list_data = ",['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'uniqueProduct', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to calculate the product of the unique numbers of a given list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver list_data expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list_data) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([10, 20, 30, 40, 20, 50, 60, 40]) (720000000) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 1]) (6) )\n\n printf ""TEST-2...%s\\n"" (driver ([7, 8, 9, 0, 1, 1]) (0) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 574,MBPP/574,Haskell,Write a function to find the surface area of a cylinder.,"-- | Write a function to find the surface area of a cylinder. surfaceareaCylinder :: Integer -> Integer -> Double surfaceareaCylinder r h = ","surfaceareaCylinder :: Integer -> Integer -> Double surfaceareaCylinder r h = ","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the surface area of a cylinder.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Double -> Double -> Bool\nvalidateSolution actual expected = do\n (abs (actual-expected)) < 1e-09\n\ndriver :: Integer -> Integer -> Double -> String\ndriver r h expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME r h) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (10) (5) (942.45) )\n\n printf ""TEST-1...%s\\n"" (driver (4) (5) (226.18800000000002) )\n\n printf ""TEST-2...%s\\n"" (driver (4) (10) (351.848) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 575,MBPP/575,Haskell,Write a haskell function to find nth number in a sequence which is not a multiple of a given number.,"-- | Write a haskell function to find nth number in a sequence which is not a multiple of a given number. countNo :: Integer -> Integer -> Integer -> Integer -> Integer countNo a n l r = ","countNo :: Integer -> Integer -> Integer -> Integer -> Integer countNo a n l r = ","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'countNo', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find nth number in a sequence which is not a multiple of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> Integer -> Integer -> Integer -> String\ndriver a n l r expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a n l r) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (2) (3) (1) (10) (5) )\n\n printf ""TEST-1...%s\\n"" (driver (3) (6) (4) (20) (11) )\n\n printf ""TEST-2...%s\\n"" (driver (5) (10) (4) (20) (16) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 576,MBPP/576,Haskell,Write a haskell function to check whether list is subarray of another or not.,"-- | Write a haskell function to check whether list is subarray of another or not. isSubArray :: [Integer] -> [Integer] -> Integer -> Integer -> Bool isSubArray a b n m = ","isSubArray :: [Integer] -> [Integer] -> Integer -> Integer -> Bool isSubArray a b n m = ","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'isSubArray', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether an array is subarray of another or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> Integer -> Integer -> Bool -> String\ndriver a b n m expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a b n m) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 4, 3, 5]) ([1, 2]) (4) (2) (False) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 1]) ([1, 2, 1]) (3) (3) (True) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 0, 2, 2]) ([2, 2, 0]) (4) (3) (False) )\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 577,MBPP/577,Haskell,Write a haskell function to find the last digit in factorial of a given number.,"-- | Write a haskell function to find the last digit in factorial of a given number. lastDigitFactorial :: Integer -> Integer lastDigitFactorial n = ","lastDigitFactorial :: Integer -> Integer lastDigitFactorial n = ",['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the last digit in factorial of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (4) (4) )\n\n printf ""TEST-1...%s\\n"" (driver (21) (0) )\n\n printf ""TEST-2...%s\\n"" (driver (30) (0) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 578,MBPP/578,Haskell,Write a function to interleave lists of the same length.,"-- | Write a function to interleave lists of the same length. interleaveLists :: [Integer] -> [Integer] -> [Integer] -> [Integer] interleaveLists list1 list2 list3 = ","interleaveLists :: [Integer] -> [Integer] -> [Integer] -> [Integer] interleaveLists list1 list2 list3 = ","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'interleaveLists', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to interleave lists of the same length.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> [Integer] -> [Integer] -> String\ndriver list1 list2 list3 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1 list2 list3) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 4, 5, 6, 7]) ([10, 20, 30, 40, 50, 60, 70]) ([100, 200, 300, 400, 500, 600, 700]) ([1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]) )\n\n printf ""TEST-1...%s\\n"" (driver ([10, 20]) ([15, 2]) ([5, 10]) ([10, 15, 5, 20, 2, 10]) )\n\n printf ""TEST-2...%s\\n"" (driver ([11, 44]) ([10, 15]) ([20, 5]) ([11, 10, 20, 44, 15, 5]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 579,MBPP/579,Haskell,Write a function to find the dissimilar elements in the given two tuples.,"-- | Write a function to find the dissimilar elements in the given two tuples. findDissimilar :: [Integer] -> [Integer] -> [Integer] findDissimilar test_tup1 test_tup2 = ","findDissimilar :: [Integer] -> [Integer] -> [Integer] findDissimilar test_tup1 test_tup2 = ","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findDissimilar', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the dissimilar elements in the given two tuples.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> [Integer] -> String\ndriver test_tup1 test_tup2 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME test_tup1 test_tup2) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([3, 4, 5, 6]) ([5, 7, 4, 10]) ([3, 6, 7, 10]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4]) ([7, 2, 3, 9]) ([1, 4, 7, 9]) )\n\n printf ""TEST-2...%s\\n"" (driver ([21, 11, 25, 26]) ([26, 34, 21, 36]) ([34, 36, 11, 25]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 581,MBPP/581,Haskell,Write a haskell function to find the surface area of the square pyramid.,"-- | Write a haskell function to find the surface area of the square pyramid. surfaceArea :: Integer -> Integer -> Integer surfaceArea b s = ","surfaceArea :: Integer -> Integer -> Integer surfaceArea b s = ","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'surfaceArea', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the surface area of the square pyramid.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> Integer -> String\ndriver b s expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME b s) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (3) (4) (33) )\n\n printf ""TEST-1...%s\\n"" (driver (4) (5) (56) )\n\n printf ""TEST-2...%s\\n"" (driver (1) (2) (5) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 583,MBPP/583,Haskell,Write a function for nth catalan number.,"-- | Write a function for nth catalan number. catalanNumber :: Integer -> Integer catalanNumber num = ","catalanNumber :: Integer -> Integer catalanNumber num = ",['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'catalanNumber', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function for nth catalan number.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver num expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME num) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (10) (16796) )\n\n printf ""TEST-1...%s\\n"" (driver (9) (4862) )\n\n printf ""TEST-2...%s\\n"" (driver (7) (429) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 584,MBPP/584,Haskell,Write a function to find all adverbs and their positions in a given sentence by using regex.,"-- | Write a function to find all adverbs and their positions in a given sentence by using regex. findAdverbs :: String -> String findAdverbs text = ","findAdverbs :: String -> String findAdverbs text = ",['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findAdverbs', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find all adverbs and their positions in a given sentence by using regex.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver text expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME text) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""Clearly, he has no excuse for such behavior."") (""0-7: Clearly"") )\n\n printf ""TEST-1...%s\\n"" (driver (""Please handle the situation carefuly"") (""28-36: carefuly"") )\n\n printf ""TEST-2...%s\\n"" (driver (""Complete the task quickly"") (""18-25: quickly"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 586,MBPP/586,Haskell,Write a haskell function to split the list and add the first part to the end.,"-- | Write a haskell function to split the list and add the first part to the end. splitArr :: [Integer] -> Integer -> Integer -> [Integer] splitArr a n k = ","splitArr :: [Integer] -> Integer -> Integer -> [Integer] splitArr a n k = ","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'splitArr', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to split the array and add the first part to the end.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> Integer -> [Integer] -> String\ndriver a n k expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a n k) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([12, 10, 5, 6, 52, 36]) (6) (2) ([5, 6, 52, 36, 12, 10]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4]) (4) (1) ([2, 3, 4, 1]) )\n\n printf ""TEST-2...%s\\n"" (driver ([0, 1, 2, 3, 4, 5, 6, 7]) (8) (3) ([3, 4, 5, 6, 7, 0, 1, 2]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 587,MBPP/587,Haskell,Write a function to convert a list to a tuple.,"-- | Write a function to convert a list to a tuple. listTuple :: [Integer] -> [Integer] listTuple listx = ","listTuple :: [Integer] -> [Integer] listTuple listx = ",['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'listTuple', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to convert a list to a tuple.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> String\ndriver listx expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME listx) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([5, 10, 7, 4, 15, 3]) ([5, 10, 7, 4, 15, 3]) )\n\n printf ""TEST-1...%s\\n"" (driver ([2, 4, 5, 6, 2, 3, 4, 4, 7]) ([2, 4, 5, 6, 2, 3, 4, 4, 7]) )\n\n printf ""TEST-2...%s\\n"" (driver ([58, 44, 56]) ([58, 44, 56]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 588,MBPP/588,Haskell,Write a haskell function to find the difference between largest and smallest value in a given list.,"-- | Write a haskell function to find the difference between largest and smallest value in a given list. bigDiff :: [Integer] -> Integer bigDiff nums = ","bigDiff :: [Integer] -> Integer bigDiff nums = ",['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'bigDiff', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between largest and smallest value in a given array.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver nums expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME nums) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 2, 3, 4]) (3) )\n\n printf ""TEST-1...%s\\n"" (driver ([4, 5, 12]) (8) )\n\n printf ""TEST-2...%s\\n"" (driver ([9, 2, 3]) (7) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 589,MBPP/589,Haskell,Write a function to find perfect squares between two given numbers.,"-- | Write a function to find perfect squares between two given numbers. perfectSquares :: Integer -> Integer -> [Integer] perfectSquares a b = ","perfectSquares :: Integer -> Integer -> [Integer] perfectSquares a b = ","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'perfectSquares', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find perfect squares between two given numbers.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> [Integer] -> String\ndriver a b expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME a b) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (1) (30) ([1, 4, 9, 16, 25]) )\n\n printf ""TEST-1...%s\\n"" (driver (50) (100) ([64, 81, 100]) )\n\n printf ""TEST-2...%s\\n"" (driver (100) (200) ([100, 121, 144, 169, 196]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 591,MBPP/591,Haskell,Write a haskell function to interchange the first and last elements in a list.,"-- | Write a haskell function to interchange the first and last elements in a list. swapList :: [Integer] -> [Integer] swapList newlist = ","swapList :: [Integer] -> [Integer] swapList newlist = ",['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'swapList', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to interchange the first and last elements in a list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: [Integer] -> [Integer] -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> String\ndriver newlist expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME newlist) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([12, 35, 9, 56, 24]) ([24, 35, 9, 56, 12]) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3]) ([3, 2, 1]) )\n\n printf ""TEST-2...%s\\n"" (driver ([4, 5, 6]) ([6, 5, 4]) )\n', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 592,MBPP/592,Haskell,Write a haskell function to find sum of product of binomial co-efficients.,"-- | Write a haskell function to find sum of product of binomial co-efficients. sumOfProduct :: Integer -> Integer sumOfProduct n = ","sumOfProduct :: Integer -> Integer sumOfProduct n = ",['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'sumOfProduct', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find sum of product of binomial co-efficients.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Integer -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (3) (15) )\n\n printf ""TEST-1...%s\\n"" (driver (4) (56) )\n\n printf ""TEST-2...%s\\n"" (driver (1) (1) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 593,MBPP/593,Haskell,Write a function to remove leading zeroes from an ip address.,"-- | Write a function to remove leading zeroes from an ip address. removezeroIp :: String -> String removezeroIp ip = ","removezeroIp :: String -> String removezeroIp ip = ",['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'removezeroIp', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to remove leading zeroes from an ip address.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: String -> String -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: String -> String -> String\ndriver ip expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME ip) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (""216.08.094.196"") (""216.8.94.196"") )\n\n printf ""TEST-1...%s\\n"" (driver (""12.01.024"") (""12.1.24"") )\n\n printf ""TEST-2...%s\\n"" (driver (""216.08.094.0196"") (""216.8.94.196"") )\n', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 594,MBPP/594,Haskell,Write a function to find the difference of first even and odd number of a given list.,"-- | Write a function to find the difference of first even and odd number of a given list. diffEvenOdd :: [Integer] -> Integer diffEvenOdd list1 = ","diffEvenOdd :: [Integer] -> Integer diffEvenOdd list1 = ",['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the difference of first even and odd number of a given list.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> Integer -> String\ndriver list1 expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME list1) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([1, 3, 5, 7, 4, 1, 6, 8]) (3) )\n\n printf ""TEST-1...%s\\n"" (driver ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) (1) )\n\n printf ""TEST-2...%s\\n"" (driver ([1, 5, 7, 9, 10]) (9) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 597,MBPP/597,Haskell,Write a function to find kth element from the given two sorted lists.,"-- | Write a function to find kth element from the given two sorted lists. findKth :: [Integer] -> [Integer] -> Integer -> Integer -> Integer -> Integer findKth arr1 arr2 m n k = ","findKth :: [Integer] -> [Integer] -> Integer -> Integer -> Integer -> Integer findKth arr1 arr2 m n k = ","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'findKth', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find kth element from the given two sorted arrays.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Integer -> Integer -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: [Integer] -> [Integer] -> Integer -> Integer -> Integer -> Integer -> String\ndriver arr1 arr2 m n k expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME arr1 arr2 m n k) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver ([2, 3, 6, 7, 9]) ([1, 4, 8, 10]) (5) (4) (5) (6) )\n\n printf ""TEST-1...%s\\n"" (driver ([100, 112, 256, 349, 770]) ([72, 86, 113, 119, 265, 445, 892]) (5) (7) (7) (256) )\n\n printf ""TEST-2...%s\\n"" (driver ([3, 4, 7, 8, 10]) ([2, 5, 9, 11]) (5) (4) (6) (8) )\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 598,MBPP/598,Haskell,Write a function to check whether the given number is armstrong or not.,"-- | Write a function to check whether the given number is armstrong or not. armstrongNumber :: Integer -> Bool armstrongNumber number = ","armstrongNumber :: Integer -> Bool armstrongNumber number = ",['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'armstrongNumber', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether the given number is armstrong or not.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Bool -> String\ndriver number expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME number) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (153) (True) )\n\n printf ""TEST-1...%s\\n"" (driver (259) (False) )\n\n printf ""TEST-2...%s\\n"" (driver (4458) (False) )\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 600,MBPP/600,Haskell,Write a haskell function to check whether the given number is even or not using bitwise operator.,"-- | Write a haskell function to check whether the given number is even or not using bitwise operator. isEven :: Integer -> Bool isEven n = ","isEven :: Integer -> Bool isEven n = ",['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'hs', 'entry_fn_name': 'isEven', 'test_code': 'import Text.Printf\nimport Control.Exception (catch, SomeException)\nimport Data.Typeable\nimport qualified Data.List as List\nimport qualified Data.Map as Map\nimport qualified Data.Set as Set\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether the given number is even or not using bitwise operator.\n--\n-- SOLUTION CODE\n-- ============================================\n\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nvalidateSolution :: Bool -> Bool -> Bool\nvalidateSolution actual expected = do\n actual == expected\n\n\ndriver :: Integer -> Bool -> String\ndriver n expected = do\n if (validateSolution (PLACEHOLDER_FN_NAME n) expected)\n then ""PASSED""\n else ""FAILED""\n\nmain = do\n printf ""TEST-0...%s\\n"" (driver (1) (False) )\n\n printf ""TEST-1...%s\\n"" (driver (2) (True) )\n\n printf ""TEST-2...%s\\n"" (driver (3) (False) )\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['ghc', '-o', 'main.exe', '__FILENAME__'], ['./main.exe']], 'timeouts': [10, 10]}" 511,MBPP/511,Java,Write a java function to find minimum sum of factors of a given number.,"class Solution { /** * Write a java function to find minimum sum of factors of a given number. */ public Integer findMinSum(Integer num) {","class Solution { public Integer findMinSum(Integer num) {",['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findMinSum', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer num, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(num,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(12, 7);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(105, 15);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(2, 2);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer num, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 514,MBPP/514,Java,Write a function to find the summation of tuple elements in the given tuple array.,"class Solution { /** * Write a function to find the summation of tuple elements in the given tuple array. */ public Integer sumElements(ArrayList test_tup) {","class Solution { public Integer sumElements(ArrayList test_tup) {",['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'sumElements', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList test_tup, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(test_tup,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(7, 8, 9, 1, 10, 7)), 42);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)), 21);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(11, 12, 13, 45, 14)), 95);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList test_tup, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(test_tup),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 515,MBPP/515,Java,Write a function to check if there is a subset with sum divisible by m.,"class Solution { /** * Write a function to check if there is a subset with sum divisible by m. */ public Boolean modularSum(ArrayList arr, Integer n, Integer m) {","class Solution { public Boolean modularSum(ArrayList arr, Integer n, Integer m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'modularSum', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer m, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n, m,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(3, 1, 7, 5)), 4, 6, true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 7)), 2, 5, false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 6)), 2, 5, false);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer m, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n, m),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 516,MBPP/516,Java,Write a function to sort array of elements using radix sort.,"class Solution { /** * Write a function to sort array of elements using radix sort. */ public ArrayList radixSort(ArrayList nums) {","class Solution { public ArrayList radixSort(ArrayList nums) {",['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'radixSort', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList nums, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(nums,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(15, 79, 25, 68, 37)), new ArrayList<>(Arrays.asList(15, 25, 37, 68, 79)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(9, 11, 8, 7, 3, 2)), new ArrayList<>(Arrays.asList(2, 3, 7, 8, 9, 11)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(36, 12, 24, 26, 29)), new ArrayList<>(Arrays.asList(12, 24, 26, 29, 36)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList nums, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(nums),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 517,MBPP/517,Java,Write a java function to find the largest postive number from the given array.,"class Solution { /** * Write a java function to find the largest postive number from the given array. */ public Integer largestPos(ArrayList list1) {","class Solution { public Integer largestPos(ArrayList list1) {",['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'largestPos', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list1, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, -1)), 4);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(0, 1, 2, -5, -1, 6)), 6);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 1, 0)), 1);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list1, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 518,MBPP/518,Java,Write a function to find the square root of a perfect number.,"class Solution { /** * Write a function to find the square root of a perfect number. */ public Integer sqrtRoot(Integer num) {","class Solution { public Integer sqrtRoot(Integer num) {",['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'sqrtRoot', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer num, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(num,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(4, 2);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(16, 4);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(400, 20);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer num, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 519,MBPP/519,Java,Write a function to calculate volume of a tetrahedron.,"class Solution { /** * Write a function to calculate volume of a tetrahedron. */ public Float volumeTetrahedron(Integer num) {","class Solution { public Float volumeTetrahedron(Integer num) {",['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer num, Float expected){\n try{\n Driver driver = new Driver();\n if (driver.run(num,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(10, 117.85f);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(15, 397.75f);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(20, 942.81f);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer num, Float expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);\n }\n \n public boolean validateSolution(Float actual, Float expected){\n return Math.abs(actual - expected) < 1e-06f;\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 520,MBPP/520,Java,Write a function to find the lcm of the given array elements.,"class Solution { /** * Write a function to find the lcm of the given array elements. */ public Integer getLcm(ArrayList l) {","class Solution { public Integer getLcm(ArrayList l) {",['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'getLcm', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList l, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(l,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(2, 7, 3, 9, 4)), 252);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 8, 3)), 24);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 8, 4, 10, 5)), 120);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList l, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(l),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 521,MBPP/521,Java,Write a function to print check if the triangle is scalene or not.,"class Solution { /** * Write a function to print check if the triangle is scalene or not. */ public Boolean checkIsosceles(Integer x, Integer y, Integer z) {","class Solution { public Boolean checkIsosceles(Integer x, Integer y, Integer z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'checkIsosceles', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer x, Integer y, Integer z, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(x, y, z,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(6, 8, 12, true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(6, 6, 12, false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(6, 15, 20, true);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer x, Integer y, Integer z, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(x, y, z),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 522,MBPP/522,Java,Write a function to find the longest bitonic subsequence for the given array.,"class Solution { /** * Write a function to find the longest bitonic subsequence for the given array. */ public Integer lbs(ArrayList arr) {","class Solution { public Integer lbs(ArrayList arr) {",['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'lbs', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15)), 7);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 11, 2, 10, 4, 5, 2, 1)), 6);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(80, 60, 30, 40, 20, 10)), 5);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 523,MBPP/523,Java,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","class Solution { /** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ public ArrayList checkString(String str1) {","class Solution { public ArrayList checkString(String str1) {",['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'checkString', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String str1, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(str1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""python"", new ArrayList<>(Arrays.asList(""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8."")));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""123python"", new ArrayList<>(Arrays.asList(""String must have 1 upper case character."")));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""123Python"", new ArrayList<>(Arrays.asList(""Valid string."")));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String str1, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(str1),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 524,MBPP/524,Java,Write a function to find the sum of maximum increasing subsequence of the given array.,"class Solution { /** * Write a function to find the sum of maximum increasing subsequence of the given array. */ public Integer maxSumIncreasingSubsequence(ArrayList arr, Integer n) {","class Solution { public Integer maxSumIncreasingSubsequence(ArrayList arr, Integer n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 101, 2, 3, 100, 4, 5)), 7, 106);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 5, 10)), 4, 22);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(10, 5, 4, 3)), 4, 10);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 525,MBPP/525,Java,Write a java function to check whether two given lines are parallel or not.,"class Solution { /** * Write a java function to check whether two given lines are parallel or not. */ public Boolean parallelLines(ArrayList line1, ArrayList line2) {","class Solution { public Boolean parallelLines(ArrayList line1, ArrayList line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'parallelLines', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList line1, ArrayList line2, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(line1, line2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(2, 3, 4)), new ArrayList<>(Arrays.asList(2, 3, 8)), true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(2, 3, 4)), new ArrayList<>(Arrays.asList(4, -3, 8)), false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 3)), new ArrayList<>(Arrays.asList(5, 5)), true);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList line1, ArrayList line2, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(line1, line2),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 526,MBPP/526,Java,Write a java function to capitalize first and last letters of each word of a given string.,"class Solution { /** * Write a java function to capitalize first and last letters of each word of a given string. */ public String capitalizeFirstLastLetters(String str1) {","class Solution { public String capitalizeFirstLastLetters(String str1) {",['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String str1, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(str1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""python"", ""PythoN"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""bigdata"", ""BigdatA"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""Hadoop"", ""HadooP"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String str1, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(str1),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 527,MBPP/527,Java,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"class Solution { /** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ public Integer getPairsCount(ArrayList arr, Integer n, Integer sum) {","class Solution { public Integer getPairsCount(ArrayList arr, Integer n, Integer sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'getPairsCount', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer sum, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n, sum,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 5, 7, -1, 5)), 5, 6, 3);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 5, 7, -1)), 4, 6, 2);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 1, 1)), 4, 2, 6);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer sum, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n, sum),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 529,MBPP/529,Java,Write a function to find the nth jacobsthal-lucas number.,"class Solution { /** * Write a function to find the nth jacobsthal-lucas number. */ public Integer jacobsthalLucas(Integer n) {","class Solution { public Integer jacobsthalLucas(Integer n) {",['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(5, 31);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(2, 5);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(4, 17);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 530,MBPP/530,Java,Write a function to find the ration of negative numbers in an array of integers.,"class Solution { /** * Write a function to find the ration of negative numbers in an array of integers. */ public Float negativeCount(ArrayList nums) {","class Solution { public Float negativeCount(ArrayList nums) {",['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'negativeCount', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList nums, Float expected){\n try{\n Driver driver = new Driver();\n if (driver.run(nums,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8)), 0.31f);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8)), 0.31f);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(2, 4, -6, -9, 11, -12, 14, -5, 17)), 0.44f);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList nums, Float expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(nums),expected);\n }\n \n public boolean validateSolution(Float actual, Float expected){\n return Math.abs(actual - expected) < 1e-06f;\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 531,MBPP/531,Java,Write a function to find minimum number of coins that make a given value.,"class Solution { /** * Write a function to find minimum number of coins that make a given value. */ public Integer minCoins(ArrayList coins, Integer m, Integer v) {","class Solution { public Integer minCoins(ArrayList coins, Integer m, Integer v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'minCoins', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList coins, Integer m, Integer v, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(coins, m, v,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(9, 6, 5, 1)), 4, 11, 2);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(4, 5, 6, 7, 8, 9)), 6, 9, 1);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3)), 3, 4, 2);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList coins, Integer m, Integer v, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(coins, m, v),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 532,MBPP/532,Java,Write a function to check if the two given strings are permutations of each other.,"class Solution { /** * Write a function to check if the two given strings are permutations of each other. */ public Boolean checkPermutation(String str1, String str2) {","class Solution { public Boolean checkPermutation(String str1, String str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'checkPermutation', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String str1, String str2, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(str1, str2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""abc"", ""cba"", true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""test"", ""ttew"", false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""xxyz"", ""yxzx"", true);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String str1, String str2, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(str1, str2),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 534,MBPP/534,Java,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"class Solution { /** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ public ArrayList searchLiteral(String pattern, String text) {","class Solution { public ArrayList searchLiteral(String pattern, String text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'searchLiteral', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String pattern, String text, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(pattern, text,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""python"", ""python programming language"", new ArrayList<>(Arrays.asList(0, 6)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""programming"", ""python programming language"", new ArrayList<>(Arrays.asList(7, 18)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""language"", ""python programming language"", new ArrayList<>(Arrays.asList(19, 27)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String pattern, String text, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(pattern, text),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 535,MBPP/535,Java,Write a function to find the top or bottom surface area of a cylinder.,"class Solution { /** * Write a function to find the top or bottom surface area of a cylinder. */ public Double topbottomSurfacearea(Integer r) {","class Solution { public Double topbottomSurfacearea(Integer r) {",['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer r, Double expected){\n try{\n Driver driver = new Driver();\n if (driver.run(r,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(10, 314.15000000000003);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(5, 78.53750000000001);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(4, 50.264);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer r, Double expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(r),expected);\n }\n \n public boolean validateSolution(Double actual, Double expected){\n return Math.abs(actual - expected) < 1e-09;\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 536,MBPP/536,Java,Write a function to select the nth items of array.,"class Solution { /** * Write a function to select the nth items of array. */ public ArrayList nthItems(ArrayList list, Integer n) {","class Solution { public ArrayList nthItems(ArrayList list, Integer n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'nthItems', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list, Integer n, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9)), 2, new ArrayList<>(Arrays.asList(1, 3, 5, 7, 9)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(10, 15, 19, 17, 16, 18)), 3, new ArrayList<>(Arrays.asList(10, 17)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(14, 16, 19, 15, 17)), 4, new ArrayList<>(Arrays.asList(14, 17)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list, Integer n, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list, n),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 537,MBPP/537,Java,Write a java function to find the first repeated word in a given string.,"class Solution { /** * Write a java function to find the first repeated word in a given string. */ public String firstRepeatedWord(String str1) {","class Solution { public String firstRepeatedWord(String str1) {",['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String str1, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(str1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""ab ca bc ab"", ""ab"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""ab ca bc"", ""None"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""ab ca bc ca ab bc"", ""ca"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String str1, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(str1),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 538,MBPP/538,Java,Write a java function to convert a given string array to a tuple.,"class Solution { /** * Write a java function to convert a given string array to a tuple. */ public ArrayList stringListToTuple(String str1) {","class Solution { public ArrayList stringListToTuple(String str1) {",['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'stringListToTuple', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String str1, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(str1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""python 3.0"", new ArrayList<>(Arrays.asList(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\')));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""bigdata"", new ArrayList<>(Arrays.asList(\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\')));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""language"", new ArrayList<>(Arrays.asList(\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\')));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String str1, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(str1),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 539,MBPP/539,Java,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function.,"class Solution { /** * Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function. */ public ArrayList basesnumCoresspondingnum(ArrayList bases_num, ArrayList index) {","class Solution { public ArrayList basesnumCoresspondingnum(ArrayList bases_num, ArrayList index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList bases_num, ArrayList index, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(bases_num, index,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)), new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), new ArrayList<>(Arrays.asList(10L, 400L, 27000L, 2560000L, 312500000L, 46656000000L, 8235430000000L, 1677721600000000L, 387420489000000000L, 100000000000000000000L)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7)), new ArrayList<>(Arrays.asList(10, 20, 30, 40, 50, 60, 70)), new ArrayList<>(Arrays.asList(1L, 1048576L, 205891132094649L, 1208925819614629174706176L, 88817841970012523233890533447265625L, 48873677980689257489322752273774603865660850176L, 143503601609868434285603076356671071740077383739246066639249L)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(4, 8, 12, 16, 20, 24, 28)), new ArrayList<>(Arrays.asList(3, 6, 9, 12, 15, 18, 21)), new ArrayList<>(Arrays.asList(64L, 262144L, 5159780352L, 281474976710656L, 32768000000000000000L, 6979147079584381377970176L, 2456510688823056210273111113728L)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList bases_num, ArrayList index, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(bases_num, index),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 540,MBPP/540,Java,Write a java function to find the difference between highest and least frequencies in a given array.,"class Solution { /** * Write a java function to find the difference between highest and least frequencies in a given array. */ public Integer findDiff(ArrayList arr, Integer n) {","class Solution { public Integer findDiff(ArrayList arr, Integer n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findDiff', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 2, 2, 7, 8, 4, 5, 1, 4)), 10, 2);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 7, 9, 2, 3, 3, 1, 3, 3)), 9, 3);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 1, 2)), 4, 0);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 541,MBPP/541,Java,Write a function to find if the given number is abundant or not.,"class Solution { /** * Write a function to find if the given number is abundant or not. */ public Boolean checkAbundant(Integer n) {","class Solution { public Boolean checkAbundant(Integer n) {",['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'checkAbundant', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(12, true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(15, false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(18, true);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 542,MBPP/542,Java,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","class Solution { /** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ public String fillSpaces(String text) {","class Solution { public String fillSpaces(String text) {",['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'fillSpaces', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String text, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(text,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""Probass Curve Audio"", ""Probass:Curve:Audio"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String text, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(text),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 543,MBPP/543,Java,Write a function to add two numbers and print number of digits of sum.,"class Solution { /** * Write a function to add two numbers and print number of digits of sum. */ public Integer countDigits(Long num1, Integer num2) {","class Solution { public Integer countDigits(Long num1, Integer num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'countDigits', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Long num1, Integer num2, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(num1, num2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(9875L, 10, 4);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(98759853034L, 100, 11);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(1234567L, 500, 7);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Long num1, Integer num2, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(num1, num2),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 545,MBPP/545,Java,Write a java function to toggle only first and last bits of a given number.,"class Solution { /** * Write a java function to toggle only first and last bits of a given number. */ public Integer toggleFAndLBits(Integer n) {","class Solution { public Integer toggleFAndLBits(Integer n) {",['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(10, 3);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(15, 6);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(20, 5);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 546,MBPP/546,Java,Write a function to find the last occurrence of a character in a string.,"class Solution { /** * Write a function to find the last occurrence of a character in a string. */ public Integer lastOccurenceChar(String string_arg0, Character char_arg1) {","class Solution { public Integer lastOccurenceChar(String string_arg0, Character char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String string_arg0, Character char_arg1, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(string_arg0, char_arg1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""hello world"", \'l\', 10);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""language"", \'g\', 7);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""little"", \'y\', None);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String string_arg0, Character char_arg1, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(string_arg0, char_arg1),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 547,MBPP/547,Java,Write a java function to find the sum of hamming distances of all consecutive numbers from o to n.,"class Solution { /** * Write a java function to find the sum of hamming distances of all consecutive numbers from o to n. */ public Integer totalHammingDistance(Integer n) {","class Solution { public Integer totalHammingDistance(Integer n) {",['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(4, 7);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(2, 3);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(5, 8);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 548,MBPP/548,Java,Write a function to find the length of the longest increasing subsequence of the given sequence.,"class Solution { /** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ public Integer longestIncreasingSubsequence(ArrayList arr) {","class Solution { public Integer longestIncreasingSubsequence(ArrayList arr) {",['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(10, 22, 9, 33, 21, 50, 41, 60)), 5);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 10, 2, 1, 20)), 3);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(50, 3, 10, 7, 40, 80)), 4);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 549,MBPP/549,Java,Write a java function to find the sum of fifth power of first n odd natural numbers.,"class Solution { /** * Write a java function to find the sum of fifth power of first n odd natural numbers. */ public Integer oddNumSum(Integer n) {","class Solution { public Integer oddNumSum(Integer n) {",['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'oddNumSum', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(1, 1);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(2, 244);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(3, 3369);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 550,MBPP/550,Java,Write a java function to find the maximum element in a sorted and rotated array.,"class Solution { /** * Write a java function to find the maximum element in a sorted and rotated array. */ public Integer findMax(ArrayList arr, Integer low, Integer high) {","class Solution { public Integer findMax(ArrayList arr, Integer low, Integer high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findMax', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer low, Integer high, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, low, high,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(2, 3, 5, 6, 9)), 0, 4, 9);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 5, 2, 1)), 0, 4, 5);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3)), 0, 2, 3);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer low, Integer high, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, low, high),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 551,MBPP/551,Java,Write a function to extract a specified column from a given nested array.,"class Solution { /** * Write a function to extract a specified column from a given nested array. */ public ArrayList extractColumn(ArrayList> list1, Integer n) {","class Solution { public ArrayList extractColumn(ArrayList> list1, Integer n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'extractColumn', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList> list1, Integer n, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(2, 4, 5)), new ArrayList<>(Arrays.asList(1, 1, 1)))), 0, new ArrayList<>(Arrays.asList(1, 2, 1)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(-2, 4, -5)), new ArrayList<>(Arrays.asList(1, -1, 1)))), 2, new ArrayList<>(Arrays.asList(3, -5, 1)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1, 3)), new ArrayList<>(Arrays.asList(5, 7)), new ArrayList<>(Arrays.asList(1, 3)), new ArrayList<>(Arrays.asList(13, 15, 17)), new ArrayList<>(Arrays.asList(5, 7)), new ArrayList<>(Arrays.asList(9, 11)))), 0, new ArrayList<>(Arrays.asList(1, 5, 1, 13, 5, 9)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList> list1, Integer n, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1, n),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 552,MBPP/552,Java,Write a java function to check whether a given sequence is linear or not.,"class Solution { /** * Write a java function to check whether a given sequence is linear or not. */ public String seqLinear(ArrayList seq_nums) {","class Solution { public String seqLinear(ArrayList seq_nums) {",['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'seqLinear', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList seq_nums, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(seq_nums,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(0, 2, 4, 6, 8, 10)), ""Linear Sequence"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3)), ""Linear Sequence"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 5, 2)), ""Non Linear Sequence"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList seq_nums, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(seq_nums),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 553,MBPP/553,Java,Write a function to convert the given tuple to a floating-point number.,"class Solution { /** * Write a function to convert the given tuple to a floating-point number. */ public Float tupleToFloat(ArrayList test_tup) {","class Solution { public Float tupleToFloat(ArrayList test_tup) {",['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'tupleToFloat', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList test_tup, Float expected){\n try{\n Driver driver = new Driver();\n if (driver.run(test_tup,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(4, 56)), 4.56f);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(7, 256)), 7.256f);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(8, 123)), 8.123f);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList test_tup, Float expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(test_tup),expected);\n }\n \n public boolean validateSolution(Float actual, Float expected){\n return Math.abs(actual - expected) < 1e-06f;\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 554,MBPP/554,Java,Write a java function to find odd numbers from a mixed array.,"class Solution { /** * Write a java function to find odd numbers from a mixed array. */ public ArrayList split(ArrayList list) {","class Solution { public ArrayList split(ArrayList list) {",['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'split', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)), new ArrayList<>(Arrays.asList(1, 3, 5)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(10, 11, 12, 13)), new ArrayList<>(Arrays.asList(11, 13)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(7, 8, 9, 1)), new ArrayList<>(Arrays.asList(7, 9, 1)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 555,MBPP/555,Java,Write a java function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"class Solution { /** * Write a java function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ public Integer difference(Integer n) {","class Solution { public Integer difference(Integer n) {",['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'difference', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(3, 30);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(5, 210);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(2, 6);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 556,MBPP/556,Java,Write a java function to count the pairs with xor as an odd number.,"class Solution { /** * Write a java function to count the pairs with xor as an odd number. */ public Integer findOddPair(ArrayList a, Integer n) {","class Solution { public Integer findOddPair(ArrayList a, Integer n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findOddPair', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList a, Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(5, 4, 7, 2, 1)), 5, 6);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(7, 2, 8, 1, 0, 5, 11)), 7, 12);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3)), 3, 2);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList a, Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 557,MBPP/557,Java,Write a function to toggle characters case in a string.,"class Solution { /** * Write a function to toggle characters case in a string. */ public String toggleString(String string_arg0) {","class Solution { public String toggleString(String string_arg0) {",['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'toggleString', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String string_arg0, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(string_arg0,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""Python"", ""pYTHON"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""Pangram"", ""pANGRAM"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""LIttLE"", ""liTTle"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String string_arg0, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(string_arg0),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 558,MBPP/558,Java,Write a java function to find the digit distance between two integers.,"class Solution { /** * Write a java function to find the digit distance between two integers. */ public Integer digitDistanceNums(Integer n1, Integer n2) {","class Solution { public Integer digitDistanceNums(Integer n1, Integer n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n1, Integer n2, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n1, n2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(1, 2, 1);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(23, 56, 6);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(123, 256, 7);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n1, Integer n2, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n1, n2),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 559,MBPP/559,Java,Write a function to find the largest sum of contiguous subarray in the given array.,"class Solution { /** * Write a function to find the largest sum of contiguous subarray in the given array. */ public Integer maxSubArraySum(ArrayList a, Integer size) {","class Solution { public Integer maxSubArraySum(ArrayList a, Integer size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList a, Integer size, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, size,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(-2, -3, 4, -1, -2, 1, 5, -3)), 8, 7);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(-3, -4, 5, -2, -3, 2, 6, -4)), 8, 8);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(-4, -5, 6, -3, -4, 3, 7, -5)), 8, 10);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList a, Integer size, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, size),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 560,MBPP/560,Java,Write a function to find the union of elements of the given tuples.,"class Solution { /** * Write a function to find the union of elements of the given tuples. */ public ArrayList unionElements(ArrayList test_tup1, ArrayList test_tup2) {","class Solution { public ArrayList unionElements(ArrayList test_tup1, ArrayList test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'unionElements', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList test_tup1, ArrayList test_tup2, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(test_tup1, test_tup2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 5, 6)), new ArrayList<>(Arrays.asList(5, 7, 4, 10)), new ArrayList<>(Arrays.asList(3, 4, 5, 6, 7, 10)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4)), new ArrayList<>(Arrays.asList(3, 4, 5, 6)), new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(11, 12, 13, 14)), new ArrayList<>(Arrays.asList(13, 15, 16, 17)), new ArrayList<>(Arrays.asList(11, 12, 13, 14, 15, 16, 17)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList test_tup1, ArrayList test_tup2, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 562,MBPP/562,Java,Write a java function to find the maximum length of sublist.,"class Solution { /** * Write a java function to find the maximum length of sublist. */ public Integer findMaxLength(ArrayList> lst) {","class Solution { public Integer findMaxLength(ArrayList> lst) {",['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findMaxLength', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList> lst, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(lst,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1)), new ArrayList<>(Arrays.asList(1, 4)), new ArrayList<>(Arrays.asList(5, 6, 7, 8)))), 4);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0, 1)), new ArrayList<>(Arrays.asList(2, 2)), new ArrayList<>(Arrays.asList(3, 2, 1)))), 3);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(7)), new ArrayList<>(Arrays.asList(22, 23)), new ArrayList<>(Arrays.asList(13, 14, 15)), new ArrayList<>(Arrays.asList(10, 20, 30, 40, 50)))), 5);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList> lst, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(lst),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 563,MBPP/563,Java,Write a function to extract values between quotation marks of a string.,"class Solution { /** * Write a function to extract values between quotation marks of a string. */ public ArrayList extractValues(String text) {","class Solution { public ArrayList extractValues(String text) {",['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'extractValues', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String text, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(text,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", new ArrayList<>(Arrays.asList(""Python"", ""PHP"", ""Java"")));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""\\""python\\"",\\""program\\"",\\""language\\"""", new ArrayList<>(Arrays.asList(""python"", ""program"", ""language"")));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", new ArrayList<>(Arrays.asList(""red"", ""blue"", ""green"", ""yellow"")));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String text, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(text),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 564,MBPP/564,Java,Write a java function to count unequal element pairs from the given array.,"class Solution { /** * Write a java function to count unequal element pairs from the given array. */ public Integer countPairs(ArrayList arr, Integer n) {","class Solution { public Integer countPairs(ArrayList arr, Integer n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'countPairs', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 1)), 3, 2);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 1, 1)), 4, 0);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5)), 5, 10);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 565,MBPP/565,Java,Write a java function to split a string into characters.,"class Solution { /** * Write a java function to split a string into characters. */ public ArrayList split(String word) {","class Solution { public ArrayList split(String word) {",['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'split', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String word, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(word,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""python"", new ArrayList<>(Arrays.asList(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\')));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""Name"", new ArrayList<>(Arrays.asList(\'N\', \'a\', \'m\', \'e\')));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""program"", new ArrayList<>(Arrays.asList(\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\')));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String word, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(word),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 566,MBPP/566,Java,Write a function to get the sum of a non-negative integer.,"class Solution { /** * Write a function to get the sum of a non-negative integer. */ public Integer sumDigits(Integer n) {","class Solution { public Integer sumDigits(Integer n) {",['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'sumDigits', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(345, 12);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(12, 3);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(97, 16);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 567,MBPP/567,Java,Write a function to check whether a specified array is sorted or not.,"class Solution { /** * Write a function to check whether a specified array is sorted or not. */ public Boolean issortList(ArrayList list1) {","class Solution { public Boolean issortList(ArrayList list1) {",['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'issortList', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list1, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 4, 6, 8, 10, 12, 14, 16, 17)), true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 4, 6, 8, 10, 12, 14, 20, 17)), false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 4, 6, 8, 10, 15, 14, 20)), false);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list1, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 569,MBPP/569,Java,Write a function to sort each sublist of strings in a given array of arrays.,"class Solution { /** * Write a function to sort each sublist of strings in a given array of arrays. */ public ArrayList> sortSublists(ArrayList> list1) {","class Solution { public ArrayList> sortSublists(ArrayList> list1) {",['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'sortSublists', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList> list1, ArrayList> expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""black"", ""white"")), new ArrayList<>(Arrays.asList(""white"", ""black"", ""orange"")))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""black"", ""white"")), new ArrayList<>(Arrays.asList(""black"", ""orange"", ""white"")))));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""black"")), new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""white"")))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""black"")), new ArrayList<>(Arrays.asList(""green"", ""orange"")), new ArrayList<>(Arrays.asList(""white"")))));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""a"", ""b"")), new ArrayList<>(Arrays.asList(""d"", ""c"")), new ArrayList<>(Arrays.asList(""g"", ""h"")), new ArrayList<>(Arrays.asList(""f"", ""e"")))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(""a"", ""b"")), new ArrayList<>(Arrays.asList(""c"", ""d"")), new ArrayList<>(Arrays.asList(""g"", ""h"")), new ArrayList<>(Arrays.asList(""e"", ""f"")))));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList> list1, ArrayList> expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1),expected);\n }\n \n public boolean validateSolution(ArrayList> actual, ArrayList> expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 570,MBPP/570,Java,Write a function to remove words from a given array of strings containing a character or string.,"class Solution { /** * Write a function to remove words from a given array of strings containing a character or string. */ public ArrayList removeWords(ArrayList list1, ArrayList charlist) {","class Solution { public ArrayList removeWords(ArrayList list1, ArrayList charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'removeWords', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list1, ArrayList charlist, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1, charlist,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White"")), new ArrayList<>(Arrays.asList(""#"", ""color"", ""@"")), new ArrayList<>(Arrays.asList(""Red"", """", ""Green"", ""Orange"", ""White"")));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White"")), new ArrayList<>(Arrays.asList(""&"", ""+"", ""@"")), new ArrayList<>(Arrays.asList(""Red"", """", ""Green"", ""Orange"", ""White"")));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White"")), new ArrayList<>(Arrays.asList(""@"")), new ArrayList<>(Arrays.asList(""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White"")));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list1, ArrayList charlist, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1, charlist),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 571,MBPP/571,Java,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"class Solution { /** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ public Integer maxSumPairDiffLessthanK(ArrayList arr, Integer n, Integer k) {","class Solution { public Integer maxSumPairDiffLessthanK(ArrayList arr, Integer n, Integer k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr, Integer n, Integer k, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr, n, k,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(3, 5, 10, 15, 17, 12, 9)), 7, 4, 62);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(5, 15, 10, 300)), 4, 12, 25);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6)), 6, 6, 21);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr, Integer n, Integer k, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n, k),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 572,MBPP/572,Java,Write a java function to remove two duplicate numbers from a given number of arrays.,"class Solution { /** * Write a java function to remove two duplicate numbers from a given number of arrays. */ public ArrayList twoUniqueNums(ArrayList nums) {","class Solution { public ArrayList twoUniqueNums(ArrayList nums) {",['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList nums, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(nums,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 2, 3, 4, 5)), new ArrayList<>(Arrays.asList(1, 4, 5)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 2, 4, 5)), new ArrayList<>(Arrays.asList(1, 3, 4, 5)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5)), new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList nums, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(nums),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 573,MBPP/573,Java,Write a java function to calculate the product of the unique numbers of a given array.,"class Solution { /** * Write a java function to calculate the product of the unique numbers of a given array. */ public Integer uniqueProduct(ArrayList list_data) {","class Solution { public Integer uniqueProduct(ArrayList list_data) {",['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'uniqueProduct', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list_data, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list_data,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(10, 20, 30, 40, 20, 50, 60, 40)), 720000000);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 1)), 6);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(7, 8, 9, 0, 1, 1)), 0);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list_data, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list_data),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 574,MBPP/574,Java,Write a function to find the surface area of a cylinder.,"class Solution { /** * Write a function to find the surface area of a cylinder. */ public Double surfaceareaCylinder(Integer r, Integer h) {","class Solution { public Double surfaceareaCylinder(Integer r, Integer h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer r, Integer h, Double expected){\n try{\n Driver driver = new Driver();\n if (driver.run(r, h,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(10, 5, 942.45);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(4, 5, 226.18800000000002);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(4, 10, 351.848);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer r, Integer h, Double expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(r, h),expected);\n }\n \n public boolean validateSolution(Double actual, Double expected){\n return Math.abs(actual - expected) < 1e-09;\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 575,MBPP/575,Java,Write a java function to find nth number in a sequence which is not a multiple of a given number.,"class Solution { /** * Write a java function to find nth number in a sequence which is not a multiple of a given number. */ public Integer countNo(Integer a, Integer n, Integer l, Integer r) {","class Solution { public Integer countNo(Integer a, Integer n, Integer l, Integer r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'countNo', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer a, Integer n, Integer l, Integer r, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, n, l, r,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(2, 3, 1, 10, 5);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(3, 6, 4, 20, 11);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(5, 10, 4, 20, 16);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer a, Integer n, Integer l, Integer r, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, n, l, r),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 576,MBPP/576,Java,Write a java function to check whether an array is subarray of another or not.,"class Solution { /** * Write a java function to check whether an array is subarray of another or not. */ public Boolean isSubArray(ArrayList a, ArrayList b, Integer n, Integer m) {","class Solution { public Boolean isSubArray(ArrayList a, ArrayList b, Integer n, Integer m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'isSubArray', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList a, ArrayList b, Integer n, Integer m, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, b, n, m,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 4, 3, 5)), new ArrayList<>(Arrays.asList(1, 2)), 4, 2, false);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 1)), new ArrayList<>(Arrays.asList(1, 2, 1)), 3, 3, true);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 0, 2, 2)), new ArrayList<>(Arrays.asList(2, 2, 0)), 4, 3, false);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList a, ArrayList b, Integer n, Integer m, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b, n, m),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 577,MBPP/577,Java,Write a java function to find the last digit in factorial of a given number.,"class Solution { /** * Write a java function to find the last digit in factorial of a given number. */ public Integer lastDigitFactorial(Integer n) {","class Solution { public Integer lastDigitFactorial(Integer n) {",['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(4, 4);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(21, 0);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(30, 0);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 578,MBPP/578,Java,Write a function to interleave arrays of the same length.,"class Solution { /** * Write a function to interleave arrays of the same length. */ public ArrayList interleaveLists(ArrayList list1, ArrayList list2, ArrayList list3) {","class Solution { public ArrayList interleaveLists(ArrayList list1, ArrayList list2, ArrayList list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'interleaveLists', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list1, ArrayList list2, ArrayList list3, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1, list2, list3,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7)), new ArrayList<>(Arrays.asList(10, 20, 30, 40, 50, 60, 70)), new ArrayList<>(Arrays.asList(100, 200, 300, 400, 500, 600, 700)), new ArrayList<>(Arrays.asList(1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(10, 20)), new ArrayList<>(Arrays.asList(15, 2)), new ArrayList<>(Arrays.asList(5, 10)), new ArrayList<>(Arrays.asList(10, 15, 5, 20, 2, 10)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(11, 44)), new ArrayList<>(Arrays.asList(10, 15)), new ArrayList<>(Arrays.asList(20, 5)), new ArrayList<>(Arrays.asList(11, 10, 20, 44, 15, 5)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list1, ArrayList list2, ArrayList list3, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1, list2, list3),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 579,MBPP/579,Java,Write a function to find the dissimilar elements in the given two tuples.,"class Solution { /** * Write a function to find the dissimilar elements in the given two tuples. */ public ArrayList findDissimilar(ArrayList test_tup1, ArrayList test_tup2) {","class Solution { public ArrayList findDissimilar(ArrayList test_tup1, ArrayList test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findDissimilar', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList test_tup1, ArrayList test_tup2, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(test_tup1, test_tup2,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 5, 6)), new ArrayList<>(Arrays.asList(5, 7, 4, 10)), new ArrayList<>(Arrays.asList(3, 6, 7, 10)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4)), new ArrayList<>(Arrays.asList(7, 2, 3, 9)), new ArrayList<>(Arrays.asList(1, 4, 7, 9)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(21, 11, 25, 26)), new ArrayList<>(Arrays.asList(26, 34, 21, 36)), new ArrayList<>(Arrays.asList(34, 36, 11, 25)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList test_tup1, ArrayList test_tup2, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 581,MBPP/581,Java,Write a java function to find the surface area of the square pyramid.,"class Solution { /** * Write a java function to find the surface area of the square pyramid. */ public Integer surfaceArea(Integer b, Integer s) {","class Solution { public Integer surfaceArea(Integer b, Integer s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'surfaceArea', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer b, Integer s, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(b, s,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(3, 4, 33);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(4, 5, 56);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(1, 2, 5);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer b, Integer s, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(b, s),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 583,MBPP/583,Java,Write a function for nth catalan number.,"class Solution { /** * Write a function for nth catalan number. */ public Integer catalanNumber(Integer num) {","class Solution { public Integer catalanNumber(Integer num) {",['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'catalanNumber', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer num, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(num,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(10, 16796);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(9, 4862);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(7, 429);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer num, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(num),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 584,MBPP/584,Java,Write a function to find all adverbs and their positions in a given sentence by using regex.,"class Solution { /** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ public String findAdverbs(String text) {","class Solution { public String findAdverbs(String text) {",['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findAdverbs', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String text, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(text,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""Please handle the situation carefuly"", ""28-36: carefuly"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""Complete the task quickly"", ""18-25: quickly"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String text, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(text),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 586,MBPP/586,Java,Write a java function to split the array and add the first part to the end.,"class Solution { /** * Write a java function to split the array and add the first part to the end. */ public ArrayList splitArr(ArrayList a, Integer n, Integer k) {","class Solution { public ArrayList splitArr(ArrayList a, Integer n, Integer k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'splitArr', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList a, Integer n, Integer k, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, n, k,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(12, 10, 5, 6, 52, 36)), 6, 2, new ArrayList<>(Arrays.asList(5, 6, 52, 36, 12, 10)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4)), 4, 1, new ArrayList<>(Arrays.asList(2, 3, 4, 1)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7)), 8, 3, new ArrayList<>(Arrays.asList(3, 4, 5, 6, 7, 0, 1, 2)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList a, Integer n, Integer k, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, n, k),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 587,MBPP/587,Java,Write a function to convert array to a tuple.,"class Solution { /** * Write a function to convert array to a tuple. */ public ArrayList listTuple(ArrayList listx) {","class Solution { public ArrayList listTuple(ArrayList listx) {",['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'listTuple', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList listx, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(listx,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(5, 10, 7, 4, 15, 3)), new ArrayList<>(Arrays.asList(5, 10, 7, 4, 15, 3)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(2, 4, 5, 6, 2, 3, 4, 4, 7)), new ArrayList<>(Arrays.asList(2, 4, 5, 6, 2, 3, 4, 4, 7)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(58, 44, 56)), new ArrayList<>(Arrays.asList(58, 44, 56)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList listx, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(listx),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 588,MBPP/588,Java,Write a java function to find the difference between largest and smallest value in a given array.,"class Solution { /** * Write a java function to find the difference between largest and smallest value in a given array. */ public Integer bigDiff(ArrayList nums) {","class Solution { public Integer bigDiff(ArrayList nums) {",['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'bigDiff', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList nums, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(nums,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4)), 3);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(4, 5, 12)), 8);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(9, 2, 3)), 7);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList nums, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(nums),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 589,MBPP/589,Java,Write a function to find perfect squares between two given numbers.,"class Solution { /** * Write a function to find perfect squares between two given numbers. */ public ArrayList perfectSquares(Integer a, Integer b) {","class Solution { public ArrayList perfectSquares(Integer a, Integer b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'perfectSquares', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer a, Integer b, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(a, b,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(1, 30, new ArrayList<>(Arrays.asList(1, 4, 9, 16, 25)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(50, 100, new ArrayList<>(Arrays.asList(64, 81, 100)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(100, 200, new ArrayList<>(Arrays.asList(100, 121, 144, 169, 196)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer a, Integer b, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 591,MBPP/591,Java,Write a java function to interchange the first and last elements in array.,"class Solution { /** * Write a java function to interchange the first and last elements in array. */ public ArrayList swapList(ArrayList newlist) {","class Solution { public ArrayList swapList(ArrayList newlist) {",['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'swapList', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList newlist, ArrayList expected){\n try{\n Driver driver = new Driver();\n if (driver.run(newlist,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(12, 35, 9, 56, 24)), new ArrayList<>(Arrays.asList(24, 35, 9, 56, 12)));\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3)), new ArrayList<>(Arrays.asList(3, 2, 1)));\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(4, 5, 6)), new ArrayList<>(Arrays.asList(6, 5, 4)));\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList newlist, ArrayList expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(newlist),expected);\n }\n \n public boolean validateSolution(ArrayList actual, ArrayList expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 592,MBPP/592,Java,Write a java function to find sum of product of binomial co-efficients.,"class Solution { /** * Write a java function to find sum of product of binomial co-efficients. */ public Integer sumOfProduct(Integer n) {","class Solution { public Integer sumOfProduct(Integer n) {",['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'sumOfProduct', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(3, 15);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(4, 56);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(1, 1);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 593,MBPP/593,Java,Write a function to remove leading zeroes from an ip address.,"class Solution { /** * Write a function to remove leading zeroes from an ip address. */ public String removezeroIp(String ip) {","class Solution { public String removezeroIp(String ip) {",['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'removezeroIp', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(String ip, String expected){\n try{\n Driver driver = new Driver();\n if (driver.run(ip,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(""216.08.094.196"", ""216.8.94.196"");\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(""12.01.024"", ""12.1.24"");\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(""216.08.094.0196"", ""216.8.94.196"");\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(String ip, String expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(ip),expected);\n }\n \n public boolean validateSolution(String actual, String expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 594,MBPP/594,Java,Write a function to find the difference of first even and odd number of a given array.,"class Solution { /** * Write a function to find the difference of first even and odd number of a given array. */ public Integer diffEvenOdd(ArrayList list1) {","class Solution { public Integer diffEvenOdd(ArrayList list1) {",['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList list1, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(list1,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(1, 3, 5, 7, 4, 1, 6, 8)), 3);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), 1);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(1, 5, 7, 9, 10)), 9);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList list1, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(list1),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 597,MBPP/597,Java,Write a function to find kth element from the given two sorted arrays.,"class Solution { /** * Write a function to find kth element from the given two sorted arrays. */ public Integer findKth(ArrayList arr1, ArrayList arr2, Integer m, Integer n, Integer k) {","class Solution { public Integer findKth(ArrayList arr1, ArrayList arr2, Integer m, Integer n, Integer k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'findKth', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(ArrayList arr1, ArrayList arr2, Integer m, Integer n, Integer k, Integer expected){\n try{\n Driver driver = new Driver();\n if (driver.run(arr1, arr2, m, n, k,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(new ArrayList<>(Arrays.asList(2, 3, 6, 7, 9)), new ArrayList<>(Arrays.asList(1, 4, 8, 10)), 5, 4, 5, 6);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(100, 112, 256, 349, 770)), new ArrayList<>(Arrays.asList(72, 86, 113, 119, 265, 445, 892)), 5, 7, 7, 256);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 7, 8, 10)), new ArrayList<>(Arrays.asList(2, 5, 9, 11)), 5, 4, 6, 8);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(ArrayList arr1, ArrayList arr2, Integer m, Integer n, Integer k, Integer expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k),expected);\n }\n \n public boolean validateSolution(Integer actual, Integer expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 598,MBPP/598,Java,Write a function to check whether the given number is armstrong or not.,"class Solution { /** * Write a function to check whether the given number is armstrong or not. */ public Boolean armstrongNumber(Integer number) {","class Solution { public Boolean armstrongNumber(Integer number) {",['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'armstrongNumber', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer number, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(number,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(153, true);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(259, false);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(4458, false);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer number, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(number),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 600,MBPP/600,Java,Write a java function to check whether the given number is even or not using bitwise operator.,"class Solution { /** * Write a java function to check whether the given number is even or not using bitwise operator. */ public Boolean isEven(Integer n) {","class Solution { public Boolean isEven(Integer n) {",['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'java', 'entry_fn_name': 'isEven', 'test_code': 'import static java.util.Map.entry; \nimport java.util.*;\nimport java.lang.*;\n// TESTING CODE \n// ============================================\nclass QuestionEvaluator {\n public static String validateSolution(Integer n, Boolean expected){\n try{\n Driver driver = new Driver();\n if (driver.run(n,expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n \n } catch (Exception exception_obj){\n return exception_obj.getClass().getSimpleName();\n }\n\n }\n public static void main(String[] args) {\n String result;\n result = validateSolution(1, false);\n System.out.println(String.format(""%s%s"",""TEST-0..."",result)); \n \n result = validateSolution(2, true);\n System.out.println(String.format(""%s%s"",""TEST-1..."",result)); \n \n result = validateSolution(3, false);\n System.out.println(String.format(""%s%s"",""TEST-2..."",result)); \n \n }\n}\n\nclass Driver{\n public boolean run(Integer n, Boolean expected){\n\n PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();\n return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);\n }\n \n public boolean validateSolution(Boolean actual, Boolean expected){\n return actual.equals(expected);\n }\n}\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['java', '__FILENAME__']], 'timeouts': [15]}" 511,MBPP/511,Javascript,Write a javascript function to find minimum sum of factors of a given number.,"/** * Write a javascript function to find minimum sum of factors of a given number. */ function findMinSum(num) {",function findMinSum(num) {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findMinSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(num, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(12, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver(105, 15);\n console.log(`TEST-1...${result}`);\n\n result = driver(2, 2);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,Javascript,Write a function to find the summation of tuple elements in the given tuple array.,"/** * Write a function to find the summation of tuple elements in the given tuple array. */ function sumElements(test_tup) {",function sumElements(test_tup) {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'sumElements', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(test_tup, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([7, 8, 9, 1, 10, 7], 42);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6], 21);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 12, 13, 45, 14], 95);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,Javascript,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ function modularSum(arr, n, m) {","function modularSum(arr, n, m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'modularSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, m, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 1, 7, 5], 4, 6, true);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 7], 2, 5, false);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 6], 2, 5, false);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,Javascript,Write a function to sort array of elements using radix sort.,"/** * Write a function to sort array of elements using radix sort. */ function radixSort(nums) {",function radixSort(nums) {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'radixSort', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(nums, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([15, 79, 25, 68, 37], [15, 25, 37, 68, 79]);\n console.log(`TEST-0...${result}`);\n\n result = driver([9, 11, 8, 7, 3, 2], [2, 3, 7, 8, 9, 11]);\n console.log(`TEST-1...${result}`);\n\n result = driver([36, 12, 24, 26, 29], [12, 24, 26, 29, 36]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,Javascript,Write a javascript function to find the largest postive number from the given array.,"/** * Write a javascript function to find the largest postive number from the given array. */ function largestPos(list1) {",function largestPos(list1) {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'largestPos', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, -1], 4);\n console.log(`TEST-0...${result}`);\n\n result = driver([0, 1, 2, -5, -1, 6], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([0, 0, 1, 0], 1);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,Javascript,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ function sqrtRoot(num) {",function sqrtRoot(num) {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'sqrtRoot', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(num, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver(16, 4);\n console.log(`TEST-1...${result}`);\n\n result = driver(400, 20);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,Javascript,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ function volumeTetrahedron(num) {",function volumeTetrahedron(num) {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'volumeTetrahedron', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(num, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 117.85);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, 397.75);\n console.log(`TEST-1...${result}`);\n\n result = driver(20, 942.81);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,Javascript,Write a function to find the lcm of the given array elements.,"/** * Write a function to find the lcm of the given array elements. */ function getLcm(l) {",function getLcm(l) {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'getLcm', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(l, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(l),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 7, 3, 9, 4], 252);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 8, 3], 24);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 8, 4, 10, 5], 120);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,Javascript,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ function checkIsosceles(x, y, z) {","function checkIsosceles(x, y, z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'checkIsosceles', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(x, y, z, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(6, 8, 12, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(6, 6, 12, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(6, 15, 20, true);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,Javascript,Write a function to find the longest bitonic subsequence for the given array.,"/** * Write a function to find the longest bitonic subsequence for the given array. */ function lbs(arr) {",function lbs(arr) {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'lbs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], 7);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 11, 2, 10, 4, 5, 2, 1], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([80, 60, 30, 40, 20, 10], 5);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,Javascript,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ function checkString(str1) {",function checkString(str1) {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'checkString', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(str1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""123python"", [""String must have 1 upper case character.""]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""123Python"", [""Valid string.""]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,Javascript,Write a function to find the sum of maximum increasing subsequence of the given array.,"/** * Write a function to find the sum of maximum increasing subsequence of the given array. */ function maxSumIncreasingSubsequence(arr, n) {","function maxSumIncreasingSubsequence(arr, n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 101, 2, 3, 100, 4, 5], 7, 106);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 4, 5, 10], 4, 22);\n console.log(`TEST-1...${result}`);\n\n result = driver([10, 5, 4, 3], 4, 10);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,Javascript,Write a javascript function to check whether two given lines are parallel or not.,"/** * Write a javascript function to check whether two given lines are parallel or not. */ function parallelLines(line1, line2) {","function parallelLines(line1, line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'parallelLines', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(line1, line2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 4], [2, 3, 8], true);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 3, 4], [4, -3, 8], false);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 3], [5, 5], true);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,Javascript,Write a javascript function to capitalize first and last letters of each word of a given string.,"/** * Write a javascript function to capitalize first and last letters of each word of a given string. */ function capitalizeFirstLastLetters(str1) {",function capitalizeFirstLastLetters(str1) {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(str1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", ""PythoN"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""bigdata"", ""BigdatA"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Hadoop"", ""HadooP"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,Javascript,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ function getPairsCount(arr, n, sum) {","function getPairsCount(arr, n, sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'getPairsCount', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, sum, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 5, 7, -1, 5], 5, 6, 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 5, 7, -1], 4, 6, 2);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 1, 1, 1], 4, 2, 6);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,Javascript,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ function jacobsthalLucas(n) {",function jacobsthalLucas(n) {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'jacobsthalLucas', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(5, 31);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 5);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 17);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,Javascript,Write a function to find the ration of negative numbers in an array of integers.,"/** * Write a function to find the ration of negative numbers in an array of integers. */ function negativeCount(nums) {",function negativeCount(nums) {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'negativeCount', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(nums, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], 0.31);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8], 0.31);\n console.log(`TEST-1...${result}`);\n\n result = driver([2, 4, -6, -9, 11, -12, 14, -5, 17], 0.44);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,Javascript,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ function minCoins(coins, m, v) {","function minCoins(coins, m, v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'minCoins', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(coins, m, v, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([9, 6, 5, 1], 4, 11, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([4, 5, 6, 7, 8, 9], 6, 9, 1);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 3, 4, 2);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,Javascript,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ function checkPermutation(str1, str2) {","function checkPermutation(str1, str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'checkPermutation', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(str1, str2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""abc"", ""cba"", true);\n console.log(`TEST-0...${result}`);\n\n result = driver(""test"", ""ttew"", false);\n console.log(`TEST-1...${result}`);\n\n result = driver(""xxyz"", ""yxzx"", true);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,Javascript,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ function searchLiteral(pattern, text) {","function searchLiteral(pattern, text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'searchLiteral', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(pattern, text, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", ""python programming language"", [0, 6]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""programming"", ""python programming language"", [7, 18]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""language"", ""python programming language"", [19, 27]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,Javascript,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ function topbottomSurfacearea(r) {",function topbottomSurfacearea(r) {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return Math.abs(actual - expected) < 1e-09;\n}\n\nfunction driver(r, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 314.15000000000003);\n console.log(`TEST-0...${result}`);\n\n result = driver(5, 78.53750000000001);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 50.264);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,Javascript,Write a function to select the nth items of array.,"/** * Write a function to select the nth items of array. */ function nthItems(list, n) {","function nthItems(list, n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'nthItems', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, [1, 3, 5, 7, 9]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 15, 19, 17, 16, 18], 3, [10, 17]);\n console.log(`TEST-1...${result}`);\n\n result = driver([14, 16, 19, 15, 17], 4, [14, 17]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,Javascript,Write a javascript function to find the first repeated word in a given string.,"/** * Write a javascript function to find the first repeated word in a given string. */ function firstRepeatedWord(str1) {",function firstRepeatedWord(str1) {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'firstRepeatedWord', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(str1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""ab ca bc ab"", ""ab"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""ab ca bc"", ""None"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""ab ca bc ca ab bc"", ""ca"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,Javascript,Write a javascript function to convert a given string array to a tuple.,"/** * Write a javascript function to convert a given string array to a tuple. */ function stringListToTuple(str1) {",function stringListToTuple(str1) {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'stringListToTuple', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(str1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python 3.0"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\']);\n console.log(`TEST-0...${result}`);\n\n result = driver(""bigdata"", [\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\']);\n console.log(`TEST-1...${result}`);\n\n result = driver(""language"", [\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\']);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,Javascript,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function.,"/** * Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function. */ function basesnumCoresspondingnum(bases_num, index) {","function basesnumCoresspondingnum(bases_num, index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(bases_num, index, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249]);\n console.log(`TEST-1...${result}`);\n\n result = driver([4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21], [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,Javascript,Write a javascript function to find the difference between highest and least frequencies in a given array.,"/** * Write a javascript function to find the difference between highest and least frequencies in a given array. */ function findDiff(arr, n) {","function findDiff(arr, n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findDiff', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 7, 9, 2, 3, 3, 1, 3, 3], 9, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 1, 2], 4, 0);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,Javascript,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ function checkAbundant(n) {",function checkAbundant(n) {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'checkAbundant', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(12, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(18, true);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,Javascript,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ function fillSpaces(text) {",function fillSpaces(text) {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'fillSpaces', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(text, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,Javascript,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ function countDigits(num1, num2) {","function countDigits(num1, num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'countDigits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(num1, num2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(9875, 10, 4);\n console.log(`TEST-0...${result}`);\n\n result = driver(98759853034, 100, 11);\n console.log(`TEST-1...${result}`);\n\n result = driver(1234567, 500, 7);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,Javascript,Write a javascript function to toggle only first and last bits of a given number.,"/** * Write a javascript function to toggle only first and last bits of a given number. */ function toggleFAndLBits(n) {",function toggleFAndLBits(n) {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'toggleFAndLBits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 3);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, 6);\n console.log(`TEST-1...${result}`);\n\n result = driver(20, 5);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,Javascript,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ function lastOccurenceChar(string_arg0, char_arg1) {","function lastOccurenceChar(string_arg0, char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'lastOccurenceChar', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(string_arg0, char_arg1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""hello world"", \'l\', 10);\n console.log(`TEST-0...${result}`);\n\n result = driver(""language"", \'g\', 7);\n console.log(`TEST-1...${result}`);\n\n result = driver(""little"", \'y\', None);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,Javascript,Write a javascript function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a javascript function to find the sum of hamming distances of all consecutive numbers from o to n. */ function totalHammingDistance(n) {",function totalHammingDistance(n) {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'totalHammingDistance', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver(5, 8);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,Javascript,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ function longestIncreasingSubsequence(arr) {",function longestIncreasingSubsequence(arr) {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 22, 9, 33, 21, 50, 41, 60], 5);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 10, 2, 1, 20], 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([50, 3, 10, 7, 40, 80], 4);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,Javascript,Write a javascript function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a javascript function to find the sum of fifth power of first n odd natural numbers. */ function oddNumSum(n) {",function oddNumSum(n) {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'oddNumSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 1);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 244);\n console.log(`TEST-1...${result}`);\n\n result = driver(3, 3369);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,Javascript,Write a javascript function to find the maximum element in a sorted and rotated array.,"/** * Write a javascript function to find the maximum element in a sorted and rotated array. */ function findMax(arr, low, high) {","function findMax(arr, low, high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findMax', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, low, high, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 5, 6, 9], 0, 4, 9);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 4, 5, 2, 1], 0, 4, 5);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 0, 2, 3);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,Javascript,Write a function to extract a specified column from a given nested array.,"/** * Write a function to extract a specified column from a given nested array. */ function extractColumn(list1, n) {","function extractColumn(list1, n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'extractColumn', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0, [1, 2, 1]);\n console.log(`TEST-0...${result}`);\n\n result = driver([[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2, [3, -5, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0, [1, 5, 1, 13, 5, 9]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,Javascript,Write a javascript function to check whether a given sequence is linear or not.,"/** * Write a javascript function to check whether a given sequence is linear or not. */ function seqLinear(seq_nums) {",function seqLinear(seq_nums) {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'seqLinear', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(seq_nums, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 2, 4, 6, 8, 10], ""Linear Sequence"");\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3], ""Linear Sequence"");\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 5, 2], ""Non Linear Sequence"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,Javascript,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ function tupleToFloat(test_tup) {",function tupleToFloat(test_tup) {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'tupleToFloat', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(test_tup, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([4, 56], 4.56);\n console.log(`TEST-0...${result}`);\n\n result = driver([7, 256], 7.256);\n console.log(`TEST-1...${result}`);\n\n result = driver([8, 123], 8.123);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,Javascript,Write a javascript function to find odd numbers from a mixed array.,"/** * Write a javascript function to find odd numbers from a mixed array. */ function split(list) {",function split(list) {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'split', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6], [1, 3, 5]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 11, 12, 13], [11, 13]);\n console.log(`TEST-1...${result}`);\n\n result = driver([7, 8, 9, 1], [7, 9, 1]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,Javascript,Write a javascript function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a javascript function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ function difference(n) {",function difference(n) {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'difference', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 30);\n console.log(`TEST-0...${result}`);\n\n result = driver(5, 210);\n console.log(`TEST-1...${result}`);\n\n result = driver(2, 6);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,Javascript,Write a javascript function to count the pairs with xor as an odd number.,"/** * Write a javascript function to count the pairs with xor as an odd number. */ function findOddPair(a, n) {","function findOddPair(a, n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findOddPair', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([5, 4, 7, 2, 1], 5, 6);\n console.log(`TEST-0...${result}`);\n\n result = driver([7, 2, 8, 1, 0, 5, 11], 7, 12);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 3, 2);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,Javascript,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ function toggleString(string_arg0) {",function toggleString(string_arg0) {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'toggleString', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(string_arg0, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Python"", ""pYTHON"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Pangram"", ""pANGRAM"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""LIttLE"", ""liTTle"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,Javascript,Write a javascript function to find the digit distance between two integers.,"/** * Write a javascript function to find the digit distance between two integers. */ function digitDistanceNums(n1, n2) {","function digitDistanceNums(n1, n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'digitDistanceNums', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n1, n2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 2, 1);\n console.log(`TEST-0...${result}`);\n\n result = driver(23, 56, 6);\n console.log(`TEST-1...${result}`);\n\n result = driver(123, 256, 7);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,Javascript,Write a function to find the largest sum of contiguous subarray in the given array.,"/** * Write a function to find the largest sum of contiguous subarray in the given array. */ function maxSubArraySum(a, size) {","function maxSubArraySum(a, size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'maxSubArraySum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, size, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([-2, -3, 4, -1, -2, 1, 5, -3], 8, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver([-3, -4, 5, -2, -3, 2, 6, -4], 8, 8);\n console.log(`TEST-1...${result}`);\n\n result = driver([-4, -5, 6, -3, -4, 3, 7, -5], 8, 10);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,Javascript,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ function unionElements(test_tup1, test_tup2) {","function unionElements(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'unionElements', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(test_tup1, test_tup2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 4, 5, 6, 7, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], [3, 4, 5, 6], [1, 2, 3, 4, 5, 6]);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 12, 13, 14], [13, 15, 16, 17], [11, 12, 13, 14, 15, 16, 17]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,Javascript,Write a javascript function to find the maximum length of sublist.,"/** * Write a javascript function to find the maximum length of sublist. */ function findMaxLength(lst) {",function findMaxLength(lst) {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findMaxLength', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(lst, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(lst),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[1], [1, 4], [5, 6, 7, 8]], 4);\n console.log(`TEST-0...${result}`);\n\n result = driver([[0, 1], [2, 2], [3, 2, 1]], 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]], 5);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,Javascript,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ function extractValues(text) {",function extractValues(text) {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'extractValues', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(text, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", [""Python"", ""PHP"", ""Java""]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", [""python"", ""program"", ""language""]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", [""red"", ""blue"", ""green"", ""yellow""]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,Javascript,Write a javascript function to count unequal element pairs from the given array.,"/** * Write a javascript function to count unequal element pairs from the given array. */ function countPairs(arr, n) {","function countPairs(arr, n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'countPairs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 1], 3, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 1, 1, 1], 4, 0);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5], 5, 10);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,Javascript,Write a javascript function to split a string into characters.,"/** * Write a javascript function to split a string into characters. */ function split(word) {",function split(word) {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'split', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(word, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(word),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\']);\n console.log(`TEST-0...${result}`);\n\n result = driver(""Name"", [\'N\', \'a\', \'m\', \'e\']);\n console.log(`TEST-1...${result}`);\n\n result = driver(""program"", [\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\']);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,Javascript,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ function sumDigits(n) {",function sumDigits(n) {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'sumDigits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(345, 12);\n console.log(`TEST-0...${result}`);\n\n result = driver(12, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver(97, 16);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,Javascript,Write a function to check whether a specified array is sorted or not.,"/** * Write a function to check whether a specified array is sorted or not. */ function issortList(list1) {",function issortList(list1) {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'issortList', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 16, 17], true);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 20, 17], false);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 4, 6, 8, 10, 15, 14, 20], false);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,Javascript,Write a function to sort each sublist of strings in a given array of arrays.,"/** * Write a function to sort each sublist of strings in a given array of arrays. */ function sortSublists(list1) {",function sortSublists(list1) {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'sortSublists', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]], [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]]);\n console.log(`TEST-0...${result}`);\n\n result = driver([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]);\n console.log(`TEST-1...${result}`);\n\n result = driver([[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]], [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,Javascript,Write a function to remove words from a given array of strings containing a character or string.,"/** * Write a function to remove words from a given array of strings containing a character or string. */ function removeWords(list1, charlist) {","function removeWords(list1, charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'removeWords', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, charlist, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], [""#"", ""color"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-0...${result}`);\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""&"", ""+"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-1...${result}`);\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""@""], [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,Javascript,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ function maxSumPairDiffLessthanK(arr, n, k) {","function maxSumPairDiffLessthanK(arr, n, k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr, n, k, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 5, 10, 15, 17, 12, 9], 7, 4, 62);\n console.log(`TEST-0...${result}`);\n\n result = driver([5, 15, 10, 300], 4, 12, 25);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6], 6, 6, 21);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,Javascript,Write a javascript function to remove two duplicate numbers from a given number of arrays.,"/** * Write a javascript function to remove two duplicate numbers from a given number of arrays. */ function twoUniqueNums(nums) {",function twoUniqueNums(nums) {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'twoUniqueNums', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(nums, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 2, 3, 4, 5], [1, 4, 5]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 2, 4, 5], [1, 3, 4, 5]);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,Javascript,Write a javascript function to calculate the product of the unique numbers of a given array.,"/** * Write a javascript function to calculate the product of the unique numbers of a given array. */ function uniqueProduct(list_data) {",function uniqueProduct(list_data) {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'uniqueProduct', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list_data, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 20, 30, 40, 20, 50, 60, 40], 720000000);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 1], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([7, 8, 9, 0, 1, 1], 0);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,Javascript,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ function surfaceareaCylinder(r, h) {","function surfaceareaCylinder(r, h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return Math.abs(actual - expected) < 1e-09;\n}\n\nfunction driver(r, h, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 5, 942.45);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 5, 226.18800000000002);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 10, 351.848);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,Javascript,Write a javascript function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a javascript function to find nth number in a sequence which is not a multiple of a given number. */ function countNo(a, n, l, r) {","function countNo(a, n, l, r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'countNo', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, n, l, r, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(2, 3, 1, 10, 5);\n console.log(`TEST-0...${result}`);\n\n result = driver(3, 6, 4, 20, 11);\n console.log(`TEST-1...${result}`);\n\n result = driver(5, 10, 4, 20, 16);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,Javascript,Write a javascript function to check whether an array is subarray of another or not.,"/** * Write a javascript function to check whether an array is subarray of another or not. */ function isSubArray(a, b, n, m) {","function isSubArray(a, b, n, m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'isSubArray', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, b, n, m, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 4, 3, 5], [1, 2], 4, 2, false);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 1], [1, 2, 1], 3, 3, true);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 0, 2, 2], [2, 2, 0], 4, 3, false);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,Javascript,Write a javascript function to find the last digit in factorial of a given number.,"/** * Write a javascript function to find the last digit in factorial of a given number. */ function lastDigitFactorial(n) {",function lastDigitFactorial(n) {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'lastDigitFactorial', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 4);\n console.log(`TEST-0...${result}`);\n\n result = driver(21, 0);\n console.log(`TEST-1...${result}`);\n\n result = driver(30, 0);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,Javascript,Write a function to interleave arrays of the same length.,"/** * Write a function to interleave arrays of the same length. */ function interleaveLists(list1, list2, list3) {","function interleaveLists(list1, list2, list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'interleaveLists', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, list2, list3, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700], [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 20], [15, 2], [5, 10], [10, 15, 5, 20, 2, 10]);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 44], [10, 15], [20, 5], [11, 10, 20, 44, 15, 5]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,Javascript,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ function findDissimilar(test_tup1, test_tup2) {","function findDissimilar(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findDissimilar', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(test_tup1, test_tup2, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 6, 7, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], [7, 2, 3, 9], [1, 4, 7, 9]);\n console.log(`TEST-1...${result}`);\n\n result = driver([21, 11, 25, 26], [26, 34, 21, 36], [34, 36, 11, 25]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,Javascript,Write a javascript function to find the surface area of the square pyramid.,"/** * Write a javascript function to find the surface area of the square pyramid. */ function surfaceArea(b, s) {","function surfaceArea(b, s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'surfaceArea', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(b, s, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 4, 33);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 5, 56);\n console.log(`TEST-1...${result}`);\n\n result = driver(1, 2, 5);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,Javascript,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ function catalanNumber(num) {",function catalanNumber(num) {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'catalanNumber', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(num, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 16796);\n console.log(`TEST-0...${result}`);\n\n result = driver(9, 4862);\n console.log(`TEST-1...${result}`);\n\n result = driver(7, 429);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,Javascript,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ function findAdverbs(text) {",function findAdverbs(text) {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findAdverbs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(text, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Complete the task quickly"", ""18-25: quickly"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,Javascript,Write a javascript function to split the array and add the first part to the end.,"/** * Write a javascript function to split the array and add the first part to the end. */ function splitArr(a, n, k) {","function splitArr(a, n, k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'splitArr', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, n, k, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([12, 10, 5, 6, 52, 36], 6, 2, [5, 6, 52, 36, 12, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], 4, 1, [2, 3, 4, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([0, 1, 2, 3, 4, 5, 6, 7], 8, 3, [3, 4, 5, 6, 7, 0, 1, 2]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,Javascript,Write a function to convert array to a tuple.,"/** * Write a function to convert array to a tuple. */ function listTuple(listx) {",function listTuple(listx) {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'listTuple', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(listx, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(listx),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([5, 10, 7, 4, 15, 3], [5, 10, 7, 4, 15, 3]);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 4, 5, 6, 2, 3, 4, 4, 7], [2, 4, 5, 6, 2, 3, 4, 4, 7]);\n console.log(`TEST-1...${result}`);\n\n result = driver([58, 44, 56], [58, 44, 56]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,Javascript,Write a javascript function to find the difference between largest and smallest value in a given array.,"/** * Write a javascript function to find the difference between largest and smallest value in a given array. */ function bigDiff(nums) {",function bigDiff(nums) {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'bigDiff', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(nums, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4], 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([4, 5, 12], 8);\n console.log(`TEST-1...${result}`);\n\n result = driver([9, 2, 3], 7);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,Javascript,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ function perfectSquares(a, b) {","function perfectSquares(a, b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'perfectSquares', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(a, b, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 30, [1, 4, 9, 16, 25]);\n console.log(`TEST-0...${result}`);\n\n result = driver(50, 100, [64, 81, 100]);\n console.log(`TEST-1...${result}`);\n\n result = driver(100, 200, [100, 121, 144, 169, 196]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,Javascript,Write a javascript function to interchange the first and last elements in array.,"/** * Write a javascript function to interchange the first and last elements in array. */ function swapList(newlist) {",function swapList(newlist) {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'swapList', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(newlist, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([12, 35, 9, 56, 24], [24, 35, 9, 56, 12]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3], [3, 2, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([4, 5, 6], [6, 5, 4]);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,Javascript,Write a javascript function to find sum of product of binomial co-efficients.,"/** * Write a javascript function to find sum of product of binomial co-efficients. */ function sumOfProduct(n) {",function sumOfProduct(n) {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'sumOfProduct', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 15);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 56);\n console.log(`TEST-1...${result}`);\n\n result = driver(1, 1);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,Javascript,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ function removezeroIp(ip) {",function removezeroIp(ip) {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'removezeroIp', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(ip, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(ip),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""216.08.094.196"", ""216.8.94.196"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""12.01.024"", ""12.1.24"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""216.08.094.0196"", ""216.8.94.196"");\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,Javascript,Write a function to find the difference of first even and odd number of a given array.,"/** * Write a function to find the difference of first even and odd number of a given array. */ function diffEvenOdd(list1) {",function diffEvenOdd(list1) {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'diffEvenOdd', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(list1, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 3, 5, 7, 4, 1, 6, 8], 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 5, 7, 9, 10], 9);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,Javascript,Write a function to find kth element from the given two sorted arrays.,"/** * Write a function to find kth element from the given two sorted arrays. */ function findKth(arr1, arr2, m, n, k) {","function findKth(arr1, arr2, m, n, k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'findKth', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(arr1, arr2, m, n, k, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5, 6);\n console.log(`TEST-0...${result}`);\n\n result = driver([100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7, 256);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6, 8);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,Javascript,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ function armstrongNumber(number) {",function armstrongNumber(number) {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'armstrongNumber', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(number, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(number),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(153, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(259, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(4458, false);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,Javascript,Write a javascript function to check whether the given number is even or not using bitwise operator.,"/** * Write a javascript function to check whether the given number is even or not using bitwise operator. */ function isEven(n) {",function isEven(n) {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'js', 'entry_fn_name': 'isEven', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value) {\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual, expected){\n return convertToString(actual)===convertToString(expected);\n}\n\nfunction driver(n, expected){\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, false);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, true);\n console.log(`TEST-1...${result}`);\n\n result = driver(3, false);\n console.log(`TEST-2...${result}`);\n\n process.exit(0);\n};\n\nif (require.main === module) {\n main();\n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['node', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,Julia,Write a julia function to find minimum sum of factors of a given number.,""""""" Write a julia function to find minimum sum of factors of a given number. """""" function find_min_sum(num)",function find_min_sum(num),['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_min_sum', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find minimum sum of factors of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(num, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(12, 7);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(105, 15);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(2, 2);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,Julia,Write a function to find the summation of tuple elements in the given tuple vector.,""""""" Write a function to find the summation of tuple elements in the given tuple vector. """""" function sum_elements(test_tup)",function sum_elements(test_tup),['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'sum_elements', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the summation of tuple elements in the given tuple list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(test_tup, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([7, 8, 9, 1, 10, 7], 42);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5, 6], 21);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([11, 12, 13, 45, 14], 95);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,Julia,Write a function to check if there is a subset with sum divisible by m.,""""""" Write a function to check if there is a subset with sum divisible by m. """""" function modular_sum(arr, n, m)","function modular_sum(arr, n, m)","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'modular_sum', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if there is a subset with sum divisible by m.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, m, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, m), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([3, 1, 7, 5], 4, 6, true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 7], 2, 5, false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 6], 2, 5, false);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,Julia,Write a function to sort vector of elements using radix sort.,""""""" Write a function to sort vector of elements using radix sort. """""" function radix_sort(nums)",function radix_sort(nums),['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'radix_sort', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort a list of elements using radix sort.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(nums, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([15, 79, 25, 68, 37], [15, 25, 37, 68, 79]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([9, 11, 8, 7, 3, 2], [2, 3, 7, 8, 9, 11]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([36, 12, 24, 26, 29], [12, 24, 26, 29, 36]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,Julia,Write a julia function to find the largest postive number from the given vector.,""""""" Write a julia function to find the largest postive number from the given vector. """""" function largest_pos(list1)",function largest_pos(list1),['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'largest_pos', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the largest postive number from the given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 4, -1], 4);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([0, 1, 2, -5, -1, 6], 6);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([0, 0, 1, 0], 1);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,Julia,Write a function to find the square root of a perfect number.,""""""" Write a function to find the square root of a perfect number. """""" function sqrt_root(num)",function sqrt_root(num),['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'sqrt_root', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the square root of a perfect number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(num, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(4, 2);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(16, 4);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(400, 20);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,Julia,Write a function to calculate volume of a tetrahedron.,""""""" Write a function to calculate volume of a tetrahedron. """""" function volume_tetrahedron(num)",function volume_tetrahedron(num),['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'volume_tetrahedron', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to calculate volume of a tetrahedron.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return abs(actual - expected) < 1e-06\nend\n\nfunction driver(num, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(10, 117.85);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(15, 397.75);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(20, 942.81);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,Julia,Write a function to find the lcm of the given vector elements.,""""""" Write a function to find the lcm of the given vector elements. """""" function get_lcm(l)",function get_lcm(l),['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'get_lcm', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the lcm of the given array elements.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(l, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(l), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([2, 7, 3, 9, 4], 252);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 8, 3], 24);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([3, 8, 4, 10, 5], 120);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,Julia,Write a function to print check if the triangle is scalene or not.,""""""" Write a function to print check if the triangle is scalene or not. """""" function check_isosceles(x, y, z)","function check_isosceles(x, y, z)","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'check_isosceles', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to print check if the triangle is scalene or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(x, y, z, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(x, y, z), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(6, 8, 12, true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(6, 6, 12, false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(6, 15, 20, true);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,Julia,Write a function to find the longest bitonic subsequence for the given vector.,""""""" Write a function to find the longest bitonic subsequence for the given vector. """""" function lbs(arr)",function lbs(arr),['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'lbs', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the longest bitonic subsequence for the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], 7);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 11, 2, 10, 4, 5, 2, 1], 6);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([80, 60, 30, 40, 20, 10], 5);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,Julia,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.",""""""" Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. """""" function check_string(str1)",function check_string(str1),['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'check_string', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(str1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""python"", [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""123python"", [""String must have 1 upper case character.""]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""123Python"", [""Valid string.""]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,Julia,Write a function to find the sum of maximum increasing subsequence of the given vector.,""""""" Write a function to find the sum of maximum increasing subsequence of the given vector. """""" function max_sum_increasing_subsequence(arr, n)","function max_sum_increasing_subsequence(arr, n)","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'max_sum_increasing_subsequence', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the sum of maximum increasing subsequence of the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 101, 2, 3, 100, 4, 5], 7, 106);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([3, 4, 5, 10], 4, 22);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([10, 5, 4, 3], 4, 10);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,Julia,Write a julia function to check whether two given lines are parallel or not.,""""""" Write a julia function to check whether two given lines are parallel or not. """""" function parallel_lines(line1, line2)","function parallel_lines(line1, line2)","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'parallel_lines', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether two given lines are parallel or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(line1, line2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(line1, line2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([2, 3, 4], [2, 3, 8], true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([2, 3, 4], [4, -3, 8], false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([3, 3], [5, 5], true);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,Julia,Write a julia function to capitalize first and last letters of each word of a given string.,""""""" Write a julia function to capitalize first and last letters of each word of a given string. """""" function capitalize_first_last_letters(str1)",function capitalize_first_last_letters(str1),['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'capitalize_first_last_letters', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to capitalize first and last letters of each word of a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(str1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""python"", ""PythoN"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""bigdata"", ""BigdatA"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""Hadoop"", ""HadooP"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,Julia,Write a function to find all pairs in an integer vector whose sum is equal to a given number.,""""""" Write a function to find all pairs in an integer vector whose sum is equal to a given number. """""" function get_pairs_count(arr, n, sum)","function get_pairs_count(arr, n, sum)","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'get_pairs_count', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all pairs in an integer array whose sum is equal to a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, sum, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, sum), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 5, 7, -1, 5], 5, 6, 3);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 5, 7, -1], 4, 6, 2);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 1, 1, 1], 4, 2, 6);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,Julia,Write a function to find the nth jacobsthal-lucas number.,""""""" Write a function to find the nth jacobsthal-lucas number. """""" function jacobsthal_lucas(n)",function jacobsthal_lucas(n),['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'jacobsthal_lucas', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the nth jacobsthal-lucas number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(5, 31);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(2, 5);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(4, 17);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,Julia,Write a function to find the ration of negative numbers in vector of integers.,""""""" Write a function to find the ration of negative numbers in vector of integers. """""" function negative_count(nums)",function negative_count(nums),['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'negative_count', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the ration of negative numbers in an array of integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return abs(actual - expected) < 1e-06\nend\n\nfunction driver(nums, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], 0.31);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8], 0.31);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([2, 4, -6, -9, 11, -12, 14, -5, 17], 0.44);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,Julia,Write a function to find minimum number of coins that make a given value.,""""""" Write a function to find minimum number of coins that make a given value. """""" function min_coins(coins, m, v)","function min_coins(coins, m, v)","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'min_coins', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find minimum number of coins that make a given value.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(coins, m, v, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(coins, m, v), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([9, 6, 5, 1], 4, 11, 2);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([4, 5, 6, 7, 8, 9], 6, 9, 1);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3], 3, 4, 2);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,Julia,Write a function to check if the two given strings are permutations of each other.,""""""" Write a function to check if the two given strings are permutations of each other. """""" function check_permutation(str1, str2)","function check_permutation(str1, str2)","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'check_permutation', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if the two given strings are permutations of each other.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(str1, str2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(str1, str2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""abc"", ""cba"", true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""test"", ""ttew"", false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""xxyz"", ""yxzx"", true);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,Julia,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,""""""" Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. """""" function search_literal(pattern, text)","function search_literal(pattern, text)","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'search_literal', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(pattern, text, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(pattern, text), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""python"", ""python programming language"", [0, 6]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""programming"", ""python programming language"", [7, 18]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""language"", ""python programming language"", [19, 27]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,Julia,Write a function to find the top or bottom surface area of a cylinder.,""""""" Write a function to find the top or bottom surface area of a cylinder. """""" function topbottom_surfacearea(r)",function topbottom_surfacearea(r),['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'topbottom_surfacearea', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the top or bottom surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return abs(actual - expected) < 1e-09\nend\n\nfunction driver(r, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(r), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(10, 314.15000000000003);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(5, 78.53750000000001);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(4, 50.264);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,Julia,Write a function to select the nth items of vector.,""""""" Write a function to select the nth items of vector. """""" function nth_items(list, n)","function nth_items(list, n)","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'nth_items', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to select the nth items of a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, [1, 3, 5, 7, 9]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([10, 15, 19, 17, 16, 18], 3, [10, 17]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([14, 16, 19, 15, 17], 4, [14, 17]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,Julia,Write a julia function to find the first repeated word in a given string.,""""""" Write a julia function to find the first repeated word in a given string. """""" function first_repeated_word(str1)",function first_repeated_word(str1),['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'first_repeated_word', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the first repeated word in a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(str1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""ab ca bc ab"", ""ab"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""ab ca bc"", ""None"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""ab ca bc ca ab bc"", ""ca"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,Julia,Write a julia function to convert a given string vector to a tuple.,""""""" Write a julia function to convert a given string vector to a tuple. """""" function string_list_to_tuple(str1)",function string_list_to_tuple(str1),['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'string_list_to_tuple', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to convert a given string list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(str1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""python 3.0"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\']);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""bigdata"", [\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\']);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""language"", [\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\']);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,Julia,Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using dictionary function.,""""""" Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using dictionary function. """""" function basesnum_coresspondingnum(bases_num, index)","function basesnum_coresspondingnum(bases_num, index)","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'basesnum_coresspondingnum', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(bases_num, index, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(bases_num, index), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21], [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,Julia,Write a julia function to find the difference between highest and least frequencies in a given vector.,""""""" Write a julia function to find the difference between highest and least frequencies in a given vector. """""" function find_diff(arr, n)","function find_diff(arr, n)","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_diff', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between highest and least frequencies in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10, 2);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 7, 9, 2, 3, 3, 1, 3, 3], 9, 3);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 1, 2], 4, 0);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,Julia,Write a function to find if the given number is abundant or not.,""""""" Write a function to find if the given number is abundant or not. """""" function check_abundant(n)",function check_abundant(n),['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'check_abundant', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find if the given number is abundant or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(12, true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(15, false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(18, true);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,Julia,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.",""""""" Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. """""" function fill_spaces(text)",function fill_spaces(text),['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'fill_spaces', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(text, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,Julia,Write a function to add two numbers and print number of digits of sum.,""""""" Write a function to add two numbers and print number of digits of sum. """""" function count_digits(num1, num2)","function count_digits(num1, num2)","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'count_digits', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to add two numbers and print number of digits of sum.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(num1, num2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(num1, num2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(9875, 10, 4);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(98759853034, 100, 11);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(1234567, 500, 7);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,Julia,Write a julia function to toggle only first and last bits of a given number.,""""""" Write a julia function to toggle only first and last bits of a given number. """""" function toggle_f_and_l_bits(n)",function toggle_f_and_l_bits(n),['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'toggle_f_and_l_bits', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to toggle only first and last bits of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(10, 3);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(15, 6);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(20, 5);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,Julia,Write a function to find the last occurrence of a character in a string.,""""""" Write a function to find the last occurrence of a character in a string. """""" function last_occurence_char(string_arg0, char_arg1)","function last_occurence_char(string_arg0, char_arg1)","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'last_occurence_char', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the last occurrence of a character in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(string_arg0, char_arg1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""hello world"", \'l\', 10);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""language"", \'g\', 7);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""little"", \'y\', None);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,Julia,Write a julia function to find the sum of hamming distances of all consecutive numbers from o to n.,""""""" Write a julia function to find the sum of hamming distances of all consecutive numbers from o to n. """""" function total_hamming_distance(n)",function total_hamming_distance(n),['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'total_hamming_distance', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(4, 7);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(2, 3);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(5, 8);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,Julia,Write a function to find the length of the longest increasing subsequence of the given sequence.,""""""" Write a function to find the length of the longest increasing subsequence of the given sequence. """""" function longest_increasing_subsequence(arr)",function longest_increasing_subsequence(arr),['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'longest_increasing_subsequence', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the length of the longest increasing subsequence of the given sequence.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([10, 22, 9, 33, 21, 50, 41, 60], 5);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([3, 10, 2, 1, 20], 3);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([50, 3, 10, 7, 40, 80], 4);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,Julia,Write a julia function to find the sum of fifth power of first n odd natural numbers.,""""""" Write a julia function to find the sum of fifth power of first n odd natural numbers. """""" function odd_num_sum(n)",function odd_num_sum(n),['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'odd_num_sum', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of fifth power of first n odd natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(1, 1);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(2, 244);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(3, 3369);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,Julia,Write a julia function to find the maximum element in a sorted and rotated vector.,""""""" Write a julia function to find the maximum element in a sorted and rotated vector. """""" function find_max(arr, low, high)","function find_max(arr, low, high)","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_max', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum element in a sorted and rotated array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, low, high, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, low, high), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([2, 3, 5, 6, 9], 0, 4, 9);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([3, 4, 5, 2, 1], 0, 4, 5);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3], 0, 2, 3);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,Julia,Write a function to extract a specified column from a given nested vector.,""""""" Write a function to extract a specified column from a given nested vector. """""" function extract_column(list1, n)","function extract_column(list1, n)","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'extract_column', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract a specified column from a given nested list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0, [1, 2, 1]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2, [3, -5, 1]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0, [1, 5, 1, 13, 5, 9]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,Julia,Write a julia function to check whether a given sequence is linear or not.,""""""" Write a julia function to check whether a given sequence is linear or not. """""" function seq_linear(seq_nums)",function seq_linear(seq_nums),['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'seq_linear', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether a given sequence is linear or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(seq_nums, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(seq_nums), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([0, 2, 4, 6, 8, 10], ""Linear Sequence"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3], ""Linear Sequence"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 5, 2], ""Non Linear Sequence"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,Julia,Write a function to convert the given tuple to a floating-point number.,""""""" Write a function to convert the given tuple to a floating-point number. """""" function tuple_to_float(test_tup)",function tuple_to_float(test_tup),['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'tuple_to_float', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert the given tuple to a floating-point number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return abs(actual - expected) < 1e-06\nend\n\nfunction driver(test_tup, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([4, 56], 4.56);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([7, 256], 7.256);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([8, 123], 8.123);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,Julia,Write a julia function to find odd numbers from a mixed vector.,""""""" Write a julia function to find odd numbers from a mixed vector. """""" function split(list)",function split(list),['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'split', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find odd numbers from a mixed list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 4, 5, 6], [1, 3, 5]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([10, 11, 12, 13], [11, 13]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([7, 8, 9, 1], [7, 9, 1]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,Julia,Write a julia function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,""""""" Write a julia function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. """""" function difference(n)",function difference(n),['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'difference', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(3, 30);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(5, 210);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(2, 6);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,Julia,Write a julia function to count the pairs with xor as an odd number.,""""""" Write a julia function to count the pairs with xor as an odd number. """""" function find_odd_pair(a, n)","function find_odd_pair(a, n)","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_odd_pair', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count the pairs with xor as an odd number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([5, 4, 7, 2, 1], 5, 6);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([7, 2, 8, 1, 0, 5, 11], 7, 12);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3], 3, 2);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,Julia,Write a function to toggle characters case in a string.,""""""" Write a function to toggle characters case in a string. """""" function toggle_string(string_arg0)",function toggle_string(string_arg0),['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'toggle_string', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to toggle characters case in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(string_arg0, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(string_arg0), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""Python"", ""pYTHON"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""Pangram"", ""pANGRAM"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""LIttLE"", ""liTTle"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,Julia,Write a julia function to find the digit distance between two integers.,""""""" Write a julia function to find the digit distance between two integers. """""" function digit_distance_nums(n1, n2)","function digit_distance_nums(n1, n2)","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'digit_distance_nums', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the digit distance between two integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n1, n2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n1, n2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(1, 2, 1);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(23, 56, 6);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(123, 256, 7);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,Julia,Write a function to find the largest sum of contiguous subarray in the given vector.,""""""" Write a function to find the largest sum of contiguous subarray in the given vector. """""" function max_sub_array_sum(a, size)","function max_sub_array_sum(a, size)","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'max_sub_array_sum', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the largest sum of contiguous subarray in the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, size, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, size), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([-2, -3, 4, -1, -2, 1, 5, -3], 8, 7);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([-3, -4, 5, -2, -3, 2, 6, -4], 8, 8);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([-4, -5, 6, -3, -4, 3, 7, -5], 8, 10);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,Julia,Write a function to find the union of elements of the given tuples.,""""""" Write a function to find the union of elements of the given tuples. """""" function union_elements(test_tup1, test_tup2)","function union_elements(test_tup1, test_tup2)","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'union_elements', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the union of elements of the given tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(test_tup1, test_tup2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 4, 5, 6, 7, 10]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4], [3, 4, 5, 6], [1, 2, 3, 4, 5, 6]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([11, 12, 13, 14], [13, 15, 16, 17], [11, 12, 13, 14, 15, 16, 17]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,Julia,Write a julia function to find the maximum length of sublist.,""""""" Write a julia function to find the maximum length of sublist. """""" function find_max_length(lst)",function find_max_length(lst),['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_max_length', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum length of sublist.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(lst, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(lst), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([[1], [1, 4], [5, 6, 7, 8]], 4);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([[0, 1], [2, 2], [3, 2, 1]], 3);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]], 5);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,Julia,Write a function to extract values between quotation marks of a string.,""""""" Write a function to extract values between quotation marks of a string. """""" function extract_values(text)",function extract_values(text),['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'extract_values', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract values between quotation marks of a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(text, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", [""Python"", ""PHP"", ""Java""]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", [""python"", ""program"", ""language""]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", [""red"", ""blue"", ""green"", ""yellow""]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,Julia,Write a julia function to count unequal element pairs from the given vector.,""""""" Write a julia function to count unequal element pairs from the given vector. """""" function count_pairs(arr, n)","function count_pairs(arr, n)","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'count_pairs', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count unequal element pairs from the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 1], 3, 2);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 1, 1, 1], 4, 0);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5], 5, 10);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,Julia,Write a julia function to split a string into characters.,""""""" Write a julia function to split a string into characters. """""" function split(word)",function split(word),['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'split', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split a string into characters.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(word, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(word), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""python"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\']);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""Name"", [\'N\', \'a\', \'m\', \'e\']);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""program"", [\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\']);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,Julia,Write a function to get the sum of a non-negative integer.,""""""" Write a function to get the sum of a non-negative integer. """""" function sum_digits(n)",function sum_digits(n),['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'sum_digits', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to get the sum of a non-negative integer.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(345, 12);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(12, 3);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(97, 16);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,Julia,Write a function to check whether a specified vector is sorted or not.,""""""" Write a function to check whether a specified vector is sorted or not. """""" function issort_list(list1)",function issort_list(list1),['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'issort_list', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a specified list is sorted or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 16, 17], true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 20, 17], false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 4, 6, 8, 10, 15, 14, 20], false);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,Julia,Write a function to sort each sublist of strings in a given vector of vectors.,""""""" Write a function to sort each sublist of strings in a given vector of vectors. """""" function sort_sublists(list1)",function sort_sublists(list1),['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'sort_sublists', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort each sublist of strings in a given list of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]], [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]], [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,Julia,Write a function to remove words from a given vector of strings containing a character or string.,""""""" Write a function to remove words from a given vector of strings containing a character or string. """""" function remove_words(list1, charlist)","function remove_words(list1, charlist)","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'remove_words', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove words from a given list of strings containing a character or string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, charlist, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1, charlist), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], [""#"", ""color"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""&"", ""+"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""@""], [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,Julia,Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k.,""""""" Write a function to find maximum possible sum of disjoint pairs for the given vector of integers and a number k. """""" function max_sum_pair_diff_lessthan_k(arr, n, k)","function max_sum_pair_diff_lessthan_k(arr, n, k)","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'max_sum_pair_diff_lessthan_k', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr, n, k, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, k), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([3, 5, 10, 15, 17, 12, 9], 7, 4, 62);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([5, 15, 10, 300], 4, 12, 25);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5, 6], 6, 6, 21);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,Julia,Write a julia function to remove two duplicate numbers from a given number of vectors.,""""""" Write a julia function to remove two duplicate numbers from a given number of vectors. """""" function two_unique_nums(nums)",function two_unique_nums(nums),['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'two_unique_nums', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to remove two duplicate numbers from a given number of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(nums, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 2, 3, 4, 5], [1, 4, 5]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 2, 4, 5], [1, 3, 4, 5]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,Julia,Write a julia function to calculate the product of the unique numbers of a given vector.,""""""" Write a julia function to calculate the product of the unique numbers of a given vector. """""" function unique_product(list_data)",function unique_product(list_data),['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'unique_product', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to calculate the product of the unique numbers of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list_data, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list_data), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([10, 20, 30, 40, 20, 50, 60, 40], 720000000);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 1], 6);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([7, 8, 9, 0, 1, 1], 0);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,Julia,Write a function to find the surface area of a cylinder.,""""""" Write a function to find the surface area of a cylinder. """""" function surfacearea_cylinder(r, h)","function surfacearea_cylinder(r, h)","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'surfacearea_cylinder', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return abs(actual - expected) < 1e-09\nend\n\nfunction driver(r, h, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(r, h), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(10, 5, 942.45);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(4, 5, 226.18800000000002);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(4, 10, 351.848);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,Julia,Write a julia function to find nth number in a sequence which is not a multiple of a given number.,""""""" Write a julia function to find nth number in a sequence which is not a multiple of a given number. """""" function count_no(a, n, l, r)","function count_no(a, n, l, r)","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'count_no', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find nth number in a sequence which is not a multiple of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, n, l, r, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, n, l, r), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(2, 3, 1, 10, 5);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(3, 6, 4, 20, 11);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(5, 10, 4, 20, 16);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,Julia,Write a julia function to check whether vector is subarray of another or not.,""""""" Write a julia function to check whether vector is subarray of another or not. """""" function is_sub_array(a, b, n, m)","function is_sub_array(a, b, n, m)","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'is_sub_array', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether an array is subarray of another or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, b, n, m, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, b, n, m), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 4, 3, 5], [1, 2], 4, 2, false);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 1], [1, 2, 1], 3, 3, true);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 0, 2, 2], [2, 2, 0], 4, 3, false);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,Julia,Write a julia function to find the last digit in factorial of a given number.,""""""" Write a julia function to find the last digit in factorial of a given number. """""" function last_digit_factorial(n)",function last_digit_factorial(n),['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'last_digit_factorial', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the last digit in factorial of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(4, 4);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(21, 0);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(30, 0);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,Julia,Write a function to interleave vectors of the same length.,""""""" Write a function to interleave vectors of the same length. """""" function interleave_lists(list1, list2, list3)","function interleave_lists(list1, list2, list3)","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'interleave_lists', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to interleave lists of the same length.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, list2, list3, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700], [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([10, 20], [15, 2], [5, 10], [10, 15, 5, 20, 2, 10]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([11, 44], [10, 15], [20, 5], [11, 10, 20, 44, 15, 5]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,Julia,Write a function to find the dissimilar elements in the given two tuples.,""""""" Write a function to find the dissimilar elements in the given two tuples. """""" function find_dissimilar(test_tup1, test_tup2)","function find_dissimilar(test_tup1, test_tup2)","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_dissimilar', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the dissimilar elements in the given two tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(test_tup1, test_tup2, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 6, 7, 10]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4], [7, 2, 3, 9], [1, 4, 7, 9]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([21, 11, 25, 26], [26, 34, 21, 36], [34, 36, 11, 25]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,Julia,Write a julia function to find the surface area of the square pyramid.,""""""" Write a julia function to find the surface area of the square pyramid. """""" function surface_area(b, s)","function surface_area(b, s)","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'surface_area', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the surface area of the square pyramid.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(b, s, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(b, s), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(3, 4, 33);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(4, 5, 56);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(1, 2, 5);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,Julia,Write a function for nth catalan number.,""""""" Write a function for nth catalan number. """""" function catalan_number(num)",function catalan_number(num),['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'catalan_number', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function for nth catalan number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(num, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(10, 16796);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(9, 4862);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(7, 429);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,Julia,Write a function to find all adverbs and their positions in a given sentence by using regex.,""""""" Write a function to find all adverbs and their positions in a given sentence by using regex. """""" function find_adverbs(text)",function find_adverbs(text),['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_adverbs', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all adverbs and their positions in a given sentence by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(text, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""Complete the task quickly"", ""18-25: quickly"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,Julia,Write a julia function to split the vector and add the first part to the end.,""""""" Write a julia function to split the vector and add the first part to the end. """""" function split_arr(a, n, k)","function split_arr(a, n, k)","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'split_arr', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split the array and add the first part to the end.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, n, k, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, n, k), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([12, 10, 5, 6, 52, 36], 6, 2, [5, 6, 52, 36, 12, 10]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4], 4, 1, [2, 3, 4, 1]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([0, 1, 2, 3, 4, 5, 6, 7], 8, 3, [3, 4, 5, 6, 7, 0, 1, 2]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,Julia,Write a function to convert vector to a tuple.,""""""" Write a function to convert vector to a tuple. """""" function list_tuple(listx)",function list_tuple(listx),['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'list_tuple', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert a list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(listx, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(listx), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([5, 10, 7, 4, 15, 3], [5, 10, 7, 4, 15, 3]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([2, 4, 5, 6, 2, 3, 4, 4, 7], [2, 4, 5, 6, 2, 3, 4, 4, 7]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([58, 44, 56], [58, 44, 56]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,Julia,Write a julia function to find the difference between largest and smallest value in a given vector.,""""""" Write a julia function to find the difference between largest and smallest value in a given vector. """""" function big_diff(nums)",function big_diff(nums),['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'big_diff', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between largest and smallest value in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(nums, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 2, 3, 4], 3);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([4, 5, 12], 8);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([9, 2, 3], 7);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,Julia,Write a function to find perfect squares between two given numbers.,""""""" Write a function to find perfect squares between two given numbers. """""" function perfect_squares(a, b)","function perfect_squares(a, b)","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'perfect_squares', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find perfect squares between two given numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(a, b, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(1, 30, [1, 4, 9, 16, 25]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(50, 100, [64, 81, 100]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(100, 200, [100, 121, 144, 169, 196]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,Julia,Write a julia function to interchange the first and last elements in vector.,""""""" Write a julia function to interchange the first and last elements in vector. """""" function swap_list(newlist)",function swap_list(newlist),['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'swap_list', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to interchange the first and last elements in a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(newlist, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(newlist), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([12, 35, 9, 56, 24], [24, 35, 9, 56, 12]);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3], [3, 2, 1]);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([4, 5, 6], [6, 5, 4]);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,Julia,Write a julia function to find sum of product of binomial co-efficients.,""""""" Write a julia function to find sum of product of binomial co-efficients. """""" function sum_of_product(n)",function sum_of_product(n),['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'sum_of_product', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find sum of product of binomial co-efficients.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(3, 15);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(4, 56);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(1, 1);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,Julia,Write a function to remove leading zeroes from an ip address.,""""""" Write a function to remove leading zeroes from an ip address. """""" function removezero_ip(ip)",function removezero_ip(ip),['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'removezero_ip', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove leading zeroes from an ip address.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(ip, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(ip), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(""216.08.094.196"", ""216.8.94.196"");\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(""12.01.024"", ""12.1.24"");\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(""216.08.094.0196"", ""216.8.94.196"");\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,Julia,Write a function to find the difference of first even and odd number of a given vector.,""""""" Write a function to find the difference of first even and odd number of a given vector. """""" function diff_even_odd(list1)",function diff_even_odd(list1),['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'diff_even_odd', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the difference of first even and odd number of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(list1, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([1, 3, 5, 7, 4, 1, 6, 8], 3);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([1, 5, 7, 9, 10], 9);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,Julia,Write a function to find kth element from the given two sorted vectors.,""""""" Write a function to find kth element from the given two sorted vectors. """""" function find_kth(arr1, arr2, m, n, k)","function find_kth(arr1, arr2, m, n, k)","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'find_kth', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find kth element from the given two sorted arrays.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(arr1, arr2, m, n, k, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver([2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5, 6);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver([100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7, 256);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver([3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6, 8);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,Julia,Write a function to check whether the given number is armstrong or not.,""""""" Write a function to check whether the given number is armstrong or not. """""" function armstrong_number(number)",function armstrong_number(number),['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'armstrong_number', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether the given number is armstrong or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(number, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(number), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(153, true);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(259, false);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(4458, false);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,Julia,Write a julia function to check whether the given number is even or not using bitwise operator.,""""""" Write a julia function to check whether the given number is even or not using bitwise operator. """""" function is_even(n)",function is_even(n),['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'jl', 'entry_fn_name': 'is_even', 'test_code': 'using Printf\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether the given number is even or not using bitwise operator.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nfunction validate_solution(actual, expected)\n return actual == expected\nend\n\nfunction driver(n, expected)\n try\n\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected)\n return ""PASSED"";\n end\n return ""FAILED"";\n catch exception_obj\n return string(Base.typename(typeof(exception_obj)).wrapper);\n end\nend\n\nfunction main()\n \n result = driver(1, false);\n @printf(""TEST-0...%s\\n"",result);\n \n result = driver(2, true);\n @printf(""TEST-1...%s\\n"",result);\n \n result = driver(3, false);\n @printf(""TEST-2...%s\\n"",result);\n \nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['julia', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,Kotlin,Write a kotlin function to find minimum sum of factors of a given number.,"/** * Write a kotlin function to find minimum sum of factors of a given number. */ fun findMinSum(num: Int): Int {",fun findMinSum(num: Int): Int {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findMinSum', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(num: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(12, 7)\n println(""TEST-0...${result}"")\n \n result = driver(105, 15)\n println(""TEST-1...${result}"")\n \n result = driver(2, 2)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 514,MBPP/514,Kotlin,Write a function to find the summation of tuple elements in the given tuple array.,"/** * Write a function to find the summation of tuple elements in the given tuple array. */ fun sumElements(test_tup: ArrayList): Int {",fun sumElements(test_tup: ArrayList): Int {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'sumElements', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(test_tup: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(7, 8, 9, 1, 10, 7), 42)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5, 6), 21)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(11, 12, 13, 45, 14), 95)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 515,MBPP/515,Kotlin,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ fun modularSum(arr: ArrayList, n: Int, m: Int): Boolean {","fun modularSum(arr: ArrayList, n: Int, m: Int): Boolean {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'modularSum', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, m: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(3, 1, 7, 5), 4, 6, true)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 7), 2, 5, false)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 6), 2, 5, false)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 516,MBPP/516,Kotlin,Write a function to sort array of elements using radix sort.,"/** * Write a function to sort array of elements using radix sort. */ fun radixSort(nums: ArrayList): ArrayList {",fun radixSort(nums: ArrayList): ArrayList {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'radixSort', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(nums: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(15, 79, 25, 68, 37), arrayListOf(15, 25, 37, 68, 79))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(9, 11, 8, 7, 3, 2), arrayListOf(2, 3, 7, 8, 9, 11))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(36, 12, 24, 26, 29), arrayListOf(12, 24, 26, 29, 36))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 517,MBPP/517,Kotlin,Write a kotlin function to find the largest postive number from the given array.,"/** * Write a kotlin function to find the largest postive number from the given array. */ fun largestPos(list1: ArrayList): Int {",fun largestPos(list1: ArrayList): Int {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'largestPos', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 4, -1), 4)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(0, 1, 2, -5, -1, 6), 6)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(0, 0, 1, 0), 1)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 518,MBPP/518,Kotlin,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ fun sqrtRoot(num: Int): Int {",fun sqrtRoot(num: Int): Int {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'sqrtRoot', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(num: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(4, 2)\n println(""TEST-0...${result}"")\n \n result = driver(16, 4)\n println(""TEST-1...${result}"")\n \n result = driver(400, 20)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 519,MBPP/519,Kotlin,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ fun volumeTetrahedron(num: Int): Float {",fun volumeTetrahedron(num: Int): Float {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Float, expected:Float):Boolean{\n return abs(actual - expected) < 1e-06f\n}\nfun driver(num: Int, expected:Float):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(10, 117.85f)\n println(""TEST-0...${result}"")\n \n result = driver(15, 397.75f)\n println(""TEST-1...${result}"")\n \n result = driver(20, 942.81f)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 520,MBPP/520,Kotlin,Write a function to find the lcm of the given array elements.,"/** * Write a function to find the lcm of the given array elements. */ fun getLcm(l: ArrayList): Int {",fun getLcm(l: ArrayList): Int {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'getLcm', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(l: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(l), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(2, 7, 3, 9, 4), 252)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 8, 3), 24)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(3, 8, 4, 10, 5), 120)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 521,MBPP/521,Kotlin,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ fun checkIsosceles(x: Int, y: Int, z: Int): Boolean {","fun checkIsosceles(x: Int, y: Int, z: Int): Boolean {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'checkIsosceles', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(x: Int, y: Int, z: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(6, 8, 12, true)\n println(""TEST-0...${result}"")\n \n result = driver(6, 6, 12, false)\n println(""TEST-1...${result}"")\n \n result = driver(6, 15, 20, true)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 522,MBPP/522,Kotlin,Write a function to find the longest bitonic subsequence for the given array.,"/** * Write a function to find the longest bitonic subsequence for the given array. */ fun lbs(arr: ArrayList): Int {",fun lbs(arr: ArrayList): Int {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'lbs', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15), 7)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 11, 2, 10, 4, 5, 2, 1), 6)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(80, 60, 30, 40, 20, 10), 5)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 523,MBPP/523,Kotlin,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ fun checkString(str1: String): ArrayList {",fun checkString(str1: String): ArrayList {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'checkString', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(str1: String, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""python"", arrayListOf(""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""))\n println(""TEST-0...${result}"")\n \n result = driver(""123python"", arrayListOf(""String must have 1 upper case character.""))\n println(""TEST-1...${result}"")\n \n result = driver(""123Python"", arrayListOf(""Valid string.""))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 524,MBPP/524,Kotlin,Write a function to find the sum of maximum increasing subsequence of the given array.,"/** * Write a function to find the sum of maximum increasing subsequence of the given array. */ fun maxSumIncreasingSubsequence(arr: ArrayList, n: Int): Int {","fun maxSumIncreasingSubsequence(arr: ArrayList, n: Int): Int {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 101, 2, 3, 100, 4, 5), 7, 106)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(3, 4, 5, 10), 4, 22)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(10, 5, 4, 3), 4, 10)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 525,MBPP/525,Kotlin,Write a kotlin function to check whether two given lines are parallel or not.,"/** * Write a kotlin function to check whether two given lines are parallel or not. */ fun parallelLines(line1: ArrayList, line2: ArrayList): Boolean {","fun parallelLines(line1: ArrayList, line2: ArrayList): Boolean {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'parallelLines', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(line1: ArrayList, line2: ArrayList, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(2, 3, 4), arrayListOf(2, 3, 8), true)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(2, 3, 4), arrayListOf(4, -3, 8), false)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(3, 3), arrayListOf(5, 5), true)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 526,MBPP/526,Kotlin,Write a kotlin function to capitalize first and last letters of each word of a given string.,"/** * Write a kotlin function to capitalize first and last letters of each word of a given string. */ fun capitalizeFirstLastLetters(str1: String): String {",fun capitalizeFirstLastLetters(str1: String): String {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(str1: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""python"", ""PythoN"")\n println(""TEST-0...${result}"")\n \n result = driver(""bigdata"", ""BigdatA"")\n println(""TEST-1...${result}"")\n \n result = driver(""Hadoop"", ""HadooP"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 527,MBPP/527,Kotlin,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ fun getPairsCount(arr: ArrayList, n: Int, sum: Int): Int {","fun getPairsCount(arr: ArrayList, n: Int, sum: Int): Int {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'getPairsCount', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, sum: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 5, 7, -1, 5), 5, 6, 3)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 5, 7, -1), 4, 6, 2)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 1, 1, 1), 4, 2, 6)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 529,MBPP/529,Kotlin,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ fun jacobsthalLucas(n: Int): Int {",fun jacobsthalLucas(n: Int): Int {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(5, 31)\n println(""TEST-0...${result}"")\n \n result = driver(2, 5)\n println(""TEST-1...${result}"")\n \n result = driver(4, 17)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 530,MBPP/530,Kotlin,Write a function to find the ration of negative numbers in an array of integers.,"/** * Write a function to find the ration of negative numbers in an array of integers. */ fun negativeCount(nums: ArrayList): Float {",fun negativeCount(nums: ArrayList): Float {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'negativeCount', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Float, expected:Float):Boolean{\n return abs(actual - expected) < 1e-06f\n}\nfun driver(nums: ArrayList, expected:Float):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8), 0.31f)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8), 0.31f)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(2, 4, -6, -9, 11, -12, 14, -5, 17), 0.44f)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 531,MBPP/531,Kotlin,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ fun minCoins(coins: ArrayList, m: Int, v: Int): Int {","fun minCoins(coins: ArrayList, m: Int, v: Int): Int {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'minCoins', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(coins: ArrayList, m: Int, v: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(9, 6, 5, 1), 4, 11, 2)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(4, 5, 6, 7, 8, 9), 6, 9, 1)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3), 3, 4, 2)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 532,MBPP/532,Kotlin,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ fun checkPermutation(str1: String, str2: String): Boolean {","fun checkPermutation(str1: String, str2: String): Boolean {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'checkPermutation', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(str1: String, str2: String, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""abc"", ""cba"", true)\n println(""TEST-0...${result}"")\n \n result = driver(""test"", ""ttew"", false)\n println(""TEST-1...${result}"")\n \n result = driver(""xxyz"", ""yxzx"", true)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 534,MBPP/534,Kotlin,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ fun searchLiteral(pattern: String, text: String): ArrayList {","fun searchLiteral(pattern: String, text: String): ArrayList {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'searchLiteral', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(pattern: String, text: String, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""python"", ""python programming language"", arrayListOf(0, 6))\n println(""TEST-0...${result}"")\n \n result = driver(""programming"", ""python programming language"", arrayListOf(7, 18))\n println(""TEST-1...${result}"")\n \n result = driver(""language"", ""python programming language"", arrayListOf(19, 27))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 535,MBPP/535,Kotlin,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ fun topbottomSurfacearea(r: Int): Double {",fun topbottomSurfacearea(r: Int): Double {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Double, expected:Double):Boolean{\n return abs(actual - expected) < 1e-09\n}\nfun driver(r: Int, expected:Double):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(10, 314.15000000000003)\n println(""TEST-0...${result}"")\n \n result = driver(5, 78.53750000000001)\n println(""TEST-1...${result}"")\n \n result = driver(4, 50.264)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 536,MBPP/536,Kotlin,Write a function to select the nth items of array.,"/** * Write a function to select the nth items of array. */ fun nthItems(list: ArrayList, n: Int): ArrayList {","fun nthItems(list: ArrayList, n: Int): ArrayList {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'nthItems', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(list: ArrayList, n: Int, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 4, 5, 6, 7, 8, 9), 2, arrayListOf(1, 3, 5, 7, 9))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(10, 15, 19, 17, 16, 18), 3, arrayListOf(10, 17))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(14, 16, 19, 15, 17), 4, arrayListOf(14, 17))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 537,MBPP/537,Kotlin,Write a kotlin function to find the first repeated word in a given string.,"/** * Write a kotlin function to find the first repeated word in a given string. */ fun firstRepeatedWord(str1: String): String {",fun firstRepeatedWord(str1: String): String {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(str1: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""ab ca bc ab"", ""ab"")\n println(""TEST-0...${result}"")\n \n result = driver(""ab ca bc"", ""None"")\n println(""TEST-1...${result}"")\n \n result = driver(""ab ca bc ca ab bc"", ""ca"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 538,MBPP/538,Kotlin,Write a kotlin function to convert a given string array to a tuple.,"/** * Write a kotlin function to convert a given string array to a tuple. */ fun stringListToTuple(str1: String): ArrayList {",fun stringListToTuple(str1: String): ArrayList {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'stringListToTuple', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(str1: String, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""python 3.0"", arrayListOf(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'))\n println(""TEST-0...${result}"")\n \n result = driver(""bigdata"", arrayListOf(\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'))\n println(""TEST-1...${result}"")\n \n result = driver(""language"", arrayListOf(\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 539,MBPP/539,Kotlin,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function.,"/** * Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function. */ fun basesnumCoresspondingnum(bases_num: ArrayList, index: ArrayList): ArrayList {","fun basesnumCoresspondingnum(bases_num: ArrayList, index: ArrayList): ArrayList {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(bases_num: ArrayList, index: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(10, 20, 30, 40, 50, 60, 70, 80, 90, 100), arrayListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), arrayListOf(10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5, 6, 7), arrayListOf(10, 20, 30, 40, 50, 60, 70), arrayListOf(1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(4, 8, 12, 16, 20, 24, 28), arrayListOf(3, 6, 9, 12, 15, 18, 21), arrayListOf(64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 540,MBPP/540,Kotlin,Write a kotlin function to find the difference between highest and least frequencies in a given array.,"/** * Write a kotlin function to find the difference between highest and least frequencies in a given array. */ fun findDiff(arr: ArrayList, n: Int): Int {","fun findDiff(arr: ArrayList, n: Int): Int {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findDiff', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 1, 2, 2, 7, 8, 4, 5, 1, 4), 10, 2)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 7, 9, 2, 3, 3, 1, 3, 3), 9, 3)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 1, 2), 4, 0)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 541,MBPP/541,Kotlin,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ fun checkAbundant(n: Int): Boolean {",fun checkAbundant(n: Int): Boolean {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'checkAbundant', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(12, true)\n println(""TEST-0...${result}"")\n \n result = driver(15, false)\n println(""TEST-1...${result}"")\n \n result = driver(18, true)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 542,MBPP/542,Kotlin,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ fun fillSpaces(text: String): String {",fun fillSpaces(text: String): String {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'fillSpaces', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(text: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"")\n println(""TEST-0...${result}"")\n \n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"")\n println(""TEST-1...${result}"")\n \n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 543,MBPP/543,Kotlin,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ fun countDigits(num1: Long, num2: Int): Int {","fun countDigits(num1: Long, num2: Int): Int {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'countDigits', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(num1: Long, num2: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(9875, 10, 4)\n println(""TEST-0...${result}"")\n \n result = driver(98759853034, 100, 11)\n println(""TEST-1...${result}"")\n \n result = driver(1234567, 500, 7)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 545,MBPP/545,Kotlin,Write a kotlin function to toggle only first and last bits of a given number.,"/** * Write a kotlin function to toggle only first and last bits of a given number. */ fun toggleFAndLBits(n: Int): Int {",fun toggleFAndLBits(n: Int): Int {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(10, 3)\n println(""TEST-0...${result}"")\n \n result = driver(15, 6)\n println(""TEST-1...${result}"")\n \n result = driver(20, 5)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 546,MBPP/546,Kotlin,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ fun lastOccurenceChar(string_arg0: String, char_arg1: Char): Int {","fun lastOccurenceChar(string_arg0: String, char_arg1: Char): Int {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(string_arg0: String, char_arg1: Char, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""hello world"", \'l\', 10)\n println(""TEST-0...${result}"")\n \n result = driver(""language"", \'g\', 7)\n println(""TEST-1...${result}"")\n \n result = driver(""little"", \'y\', None)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 547,MBPP/547,Kotlin,Write a kotlin function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a kotlin function to find the sum of hamming distances of all consecutive numbers from o to n. */ fun totalHammingDistance(n: Int): Int {",fun totalHammingDistance(n: Int): Int {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(4, 7)\n println(""TEST-0...${result}"")\n \n result = driver(2, 3)\n println(""TEST-1...${result}"")\n \n result = driver(5, 8)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 548,MBPP/548,Kotlin,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ fun longestIncreasingSubsequence(arr: ArrayList): Int {",fun longestIncreasingSubsequence(arr: ArrayList): Int {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(10, 22, 9, 33, 21, 50, 41, 60), 5)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(3, 10, 2, 1, 20), 3)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(50, 3, 10, 7, 40, 80), 4)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 549,MBPP/549,Kotlin,Write a kotlin function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a kotlin function to find the sum of fifth power of first n odd natural numbers. */ fun oddNumSum(n: Int): Int {",fun oddNumSum(n: Int): Int {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'oddNumSum', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(1, 1)\n println(""TEST-0...${result}"")\n \n result = driver(2, 244)\n println(""TEST-1...${result}"")\n \n result = driver(3, 3369)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 550,MBPP/550,Kotlin,Write a kotlin function to find the maximum element in a sorted and rotated array.,"/** * Write a kotlin function to find the maximum element in a sorted and rotated array. */ fun findMax(arr: ArrayList, low: Int, high: Int): Int {","fun findMax(arr: ArrayList, low: Int, high: Int): Int {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findMax', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, low: Int, high: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(2, 3, 5, 6, 9), 0, 4, 9)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(3, 4, 5, 2, 1), 0, 4, 5)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3), 0, 2, 3)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 551,MBPP/551,Kotlin,Write a function to extract a specified column from a given nested array.,"/** * Write a function to extract a specified column from a given nested array. */ fun extractColumn(list1: ArrayList>, n: Int): ArrayList {","fun extractColumn(list1: ArrayList>, n: Int): ArrayList {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'extractColumn', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList>, n: Int, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(arrayListOf(1, 2, 3), arrayListOf(2, 4, 5), arrayListOf(1, 1, 1)), 0, arrayListOf(1, 2, 1))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(arrayListOf(1, 2, 3), arrayListOf(-2, 4, -5), arrayListOf(1, -1, 1)), 2, arrayListOf(3, -5, 1))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(arrayListOf(1, 3), arrayListOf(5, 7), arrayListOf(1, 3), arrayListOf(13, 15, 17), arrayListOf(5, 7), arrayListOf(9, 11)), 0, arrayListOf(1, 5, 1, 13, 5, 9))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 552,MBPP/552,Kotlin,Write a kotlin function to check whether a given sequence is linear or not.,"/** * Write a kotlin function to check whether a given sequence is linear or not. */ fun seqLinear(seq_nums: ArrayList): String {",fun seqLinear(seq_nums: ArrayList): String {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'seqLinear', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(seq_nums: ArrayList, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(0, 2, 4, 6, 8, 10), ""Linear Sequence"")\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3), ""Linear Sequence"")\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 5, 2), ""Non Linear Sequence"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 553,MBPP/553,Kotlin,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ fun tupleToFloat(test_tup: ArrayList): Float {",fun tupleToFloat(test_tup: ArrayList): Float {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'tupleToFloat', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Float, expected:Float):Boolean{\n return abs(actual - expected) < 1e-06f\n}\nfun driver(test_tup: ArrayList, expected:Float):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(4, 56), 4.56f)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(7, 256), 7.256f)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(8, 123), 8.123f)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 554,MBPP/554,Kotlin,Write a kotlin function to find odd numbers from a mixed array.,"/** * Write a kotlin function to find odd numbers from a mixed array. */ fun split(list: ArrayList): ArrayList {",fun split(list: ArrayList): ArrayList {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'split', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(list: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 4, 5, 6), arrayListOf(1, 3, 5))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(10, 11, 12, 13), arrayListOf(11, 13))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(7, 8, 9, 1), arrayListOf(7, 9, 1))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 555,MBPP/555,Kotlin,Write a kotlin function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a kotlin function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ fun difference(n: Int): Int {",fun difference(n: Int): Int {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'difference', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(3, 30)\n println(""TEST-0...${result}"")\n \n result = driver(5, 210)\n println(""TEST-1...${result}"")\n \n result = driver(2, 6)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 556,MBPP/556,Kotlin,Write a kotlin function to count the pairs with xor as an odd number.,"/** * Write a kotlin function to count the pairs with xor as an odd number. */ fun findOddPair(a: ArrayList, n: Int): Int {","fun findOddPair(a: ArrayList, n: Int): Int {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findOddPair', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: ArrayList, n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(5, 4, 7, 2, 1), 5, 6)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(7, 2, 8, 1, 0, 5, 11), 7, 12)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3), 3, 2)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 557,MBPP/557,Kotlin,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ fun toggleString(string_arg0: String): String {",fun toggleString(string_arg0: String): String {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'toggleString', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(string_arg0: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""Python"", ""pYTHON"")\n println(""TEST-0...${result}"")\n \n result = driver(""Pangram"", ""pANGRAM"")\n println(""TEST-1...${result}"")\n \n result = driver(""LIttLE"", ""liTTle"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 558,MBPP/558,Kotlin,Write a kotlin function to find the digit distance between two integers.,"/** * Write a kotlin function to find the digit distance between two integers. */ fun digitDistanceNums(n1: Int, n2: Int): Int {","fun digitDistanceNums(n1: Int, n2: Int): Int {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n1: Int, n2: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(1, 2, 1)\n println(""TEST-0...${result}"")\n \n result = driver(23, 56, 6)\n println(""TEST-1...${result}"")\n \n result = driver(123, 256, 7)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 559,MBPP/559,Kotlin,Write a function to find the largest sum of contiguous subarray in the given array.,"/** * Write a function to find the largest sum of contiguous subarray in the given array. */ fun maxSubArraySum(a: ArrayList, size: Int): Int {","fun maxSubArraySum(a: ArrayList, size: Int): Int {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: ArrayList, size: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(-2, -3, 4, -1, -2, 1, 5, -3), 8, 7)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(-3, -4, 5, -2, -3, 2, 6, -4), 8, 8)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(-4, -5, 6, -3, -4, 3, 7, -5), 8, 10)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 560,MBPP/560,Kotlin,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ fun unionElements(test_tup1: ArrayList, test_tup2: ArrayList): ArrayList {","fun unionElements(test_tup1: ArrayList, test_tup2: ArrayList): ArrayList {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'unionElements', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(test_tup1: ArrayList, test_tup2: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(3, 4, 5, 6), arrayListOf(5, 7, 4, 10), arrayListOf(3, 4, 5, 6, 7, 10))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4), arrayListOf(3, 4, 5, 6), arrayListOf(1, 2, 3, 4, 5, 6))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(11, 12, 13, 14), arrayListOf(13, 15, 16, 17), arrayListOf(11, 12, 13, 14, 15, 16, 17))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 562,MBPP/562,Kotlin,Write a kotlin function to find the maximum length of sublist.,"/** * Write a kotlin function to find the maximum length of sublist. */ fun findMaxLength(lst: ArrayList>): Int {",fun findMaxLength(lst: ArrayList>): Int {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findMaxLength', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(lst: ArrayList>, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(lst), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(arrayListOf(1), arrayListOf(1, 4), arrayListOf(5, 6, 7, 8)), 4)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(arrayListOf(0, 1), arrayListOf(2, 2), arrayListOf(3, 2, 1)), 3)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(arrayListOf(7), arrayListOf(22, 23), arrayListOf(13, 14, 15), arrayListOf(10, 20, 30, 40, 50)), 5)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 563,MBPP/563,Kotlin,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ fun extractValues(text: String): ArrayList {",fun extractValues(text: String): ArrayList {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'extractValues', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(text: String, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", arrayListOf(""Python"", ""PHP"", ""Java""))\n println(""TEST-0...${result}"")\n \n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", arrayListOf(""python"", ""program"", ""language""))\n println(""TEST-1...${result}"")\n \n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", arrayListOf(""red"", ""blue"", ""green"", ""yellow""))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 564,MBPP/564,Kotlin,Write a kotlin function to count unequal element pairs from the given array.,"/** * Write a kotlin function to count unequal element pairs from the given array. */ fun countPairs(arr: ArrayList, n: Int): Int {","fun countPairs(arr: ArrayList, n: Int): Int {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'countPairs', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 1), 3, 2)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 1, 1, 1), 4, 0)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5), 5, 10)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 565,MBPP/565,Kotlin,Write a kotlin function to split a string into characters.,"/** * Write a kotlin function to split a string into characters. */ fun split(word: String): ArrayList {",fun split(word: String): ArrayList {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'split', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(word: String, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(word), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""python"", arrayListOf(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'))\n println(""TEST-0...${result}"")\n \n result = driver(""Name"", arrayListOf(\'N\', \'a\', \'m\', \'e\'))\n println(""TEST-1...${result}"")\n \n result = driver(""program"", arrayListOf(\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 566,MBPP/566,Kotlin,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ fun sumDigits(n: Int): Int {",fun sumDigits(n: Int): Int {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'sumDigits', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(345, 12)\n println(""TEST-0...${result}"")\n \n result = driver(12, 3)\n println(""TEST-1...${result}"")\n \n result = driver(97, 16)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 567,MBPP/567,Kotlin,Write a function to check whether a specified array is sorted or not.,"/** * Write a function to check whether a specified array is sorted or not. */ fun issortList(list1: ArrayList): Boolean {",fun issortList(list1: ArrayList): Boolean {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'issortList', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 4, 6, 8, 10, 12, 14, 16, 17), true)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 4, 6, 8, 10, 12, 14, 20, 17), false)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 4, 6, 8, 10, 15, 14, 20), false)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 569,MBPP/569,Kotlin,Write a function to sort each sublist of strings in a given array of arrays.,"/** * Write a function to sort each sublist of strings in a given array of arrays. */ fun sortSublists(list1: ArrayList>): ArrayList> {",fun sortSublists(list1: ArrayList>): ArrayList> {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'sortSublists', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList>, expected:ArrayList>):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList>, expected:ArrayList>):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(arrayListOf(""green"", ""orange""), arrayListOf(""black"", ""white""), arrayListOf(""white"", ""black"", ""orange"")), arrayListOf(arrayListOf(""green"", ""orange""), arrayListOf(""black"", ""white""), arrayListOf(""black"", ""orange"", ""white"")))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(arrayListOf(""green"", ""orange""), arrayListOf(""black""), arrayListOf(""green"", ""orange""), arrayListOf(""white"")), arrayListOf(arrayListOf(""green"", ""orange""), arrayListOf(""black""), arrayListOf(""green"", ""orange""), arrayListOf(""white"")))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(arrayListOf(""a"", ""b""), arrayListOf(""d"", ""c""), arrayListOf(""g"", ""h""), arrayListOf(""f"", ""e"")), arrayListOf(arrayListOf(""a"", ""b""), arrayListOf(""c"", ""d""), arrayListOf(""g"", ""h""), arrayListOf(""e"", ""f"")))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 570,MBPP/570,Kotlin,Write a function to remove words from a given array of strings containing a character or string.,"/** * Write a function to remove words from a given array of strings containing a character or string. */ fun removeWords(list1: ArrayList, charlist: ArrayList): ArrayList {","fun removeWords(list1: ArrayList, charlist: ArrayList): ArrayList {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'removeWords', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList, charlist: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""), arrayListOf(""#"", ""color"", ""@""), arrayListOf(""Red"", """", ""Green"", ""Orange"", ""White""))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), arrayListOf(""&"", ""+"", ""@""), arrayListOf(""Red"", """", ""Green"", ""Orange"", ""White""))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), arrayListOf(""@""), arrayListOf(""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 571,MBPP/571,Kotlin,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ fun maxSumPairDiffLessthanK(arr: ArrayList, n: Int, k: Int): Int {","fun maxSumPairDiffLessthanK(arr: ArrayList, n: Int, k: Int): Int {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr: ArrayList, n: Int, k: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(3, 5, 10, 15, 17, 12, 9), 7, 4, 62)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(5, 15, 10, 300), 4, 12, 25)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5, 6), 6, 6, 21)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 572,MBPP/572,Kotlin,Write a kotlin function to remove two duplicate numbers from a given number of arrays.,"/** * Write a kotlin function to remove two duplicate numbers from a given number of arrays. */ fun twoUniqueNums(nums: ArrayList): ArrayList {",fun twoUniqueNums(nums: ArrayList): ArrayList {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(nums: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 2, 3, 4, 5), arrayListOf(1, 4, 5))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 2, 4, 5), arrayListOf(1, 3, 4, 5))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5), arrayListOf(1, 2, 3, 4, 5))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 573,MBPP/573,Kotlin,Write a kotlin function to calculate the product of the unique numbers of a given array.,"/** * Write a kotlin function to calculate the product of the unique numbers of a given array. */ fun uniqueProduct(list_data: ArrayList): Int {",fun uniqueProduct(list_data: ArrayList): Int {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'uniqueProduct', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(list_data: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(10, 20, 30, 40, 20, 50, 60, 40), 720000000)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 1), 6)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(7, 8, 9, 0, 1, 1), 0)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 574,MBPP/574,Kotlin,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ fun surfaceareaCylinder(r: Int, h: Int): Double {","fun surfaceareaCylinder(r: Int, h: Int): Double {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Double, expected:Double):Boolean{\n return abs(actual - expected) < 1e-09\n}\nfun driver(r: Int, h: Int, expected:Double):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(10, 5, 942.45)\n println(""TEST-0...${result}"")\n \n result = driver(4, 5, 226.18800000000002)\n println(""TEST-1...${result}"")\n \n result = driver(4, 10, 351.848)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 575,MBPP/575,Kotlin,Write a kotlin function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a kotlin function to find nth number in a sequence which is not a multiple of a given number. */ fun countNo(a: Int, n: Int, l: Int, r: Int): Int {","fun countNo(a: Int, n: Int, l: Int, r: Int): Int {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'countNo', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: Int, n: Int, l: Int, r: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(2, 3, 1, 10, 5)\n println(""TEST-0...${result}"")\n \n result = driver(3, 6, 4, 20, 11)\n println(""TEST-1...${result}"")\n \n result = driver(5, 10, 4, 20, 16)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 576,MBPP/576,Kotlin,Write a kotlin function to check whether an array is subarray of another or not.,"/** * Write a kotlin function to check whether an array is subarray of another or not. */ fun isSubArray(a: ArrayList, b: ArrayList, n: Int, m: Int): Boolean {","fun isSubArray(a: ArrayList, b: ArrayList, n: Int, m: Int): Boolean {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'isSubArray', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: ArrayList, b: ArrayList, n: Int, m: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 4, 3, 5), arrayListOf(1, 2), 4, 2, false)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 1), arrayListOf(1, 2, 1), 3, 3, true)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 0, 2, 2), arrayListOf(2, 2, 0), 4, 3, false)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 577,MBPP/577,Kotlin,Write a kotlin function to find the last digit in factorial of a given number.,"/** * Write a kotlin function to find the last digit in factorial of a given number. */ fun lastDigitFactorial(n: Int): Int {",fun lastDigitFactorial(n: Int): Int {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(4, 4)\n println(""TEST-0...${result}"")\n \n result = driver(21, 0)\n println(""TEST-1...${result}"")\n \n result = driver(30, 0)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 578,MBPP/578,Kotlin,Write a function to interleave arrays of the same length.,"/** * Write a function to interleave arrays of the same length. */ fun interleaveLists(list1: ArrayList, list2: ArrayList, list3: ArrayList): ArrayList {","fun interleaveLists(list1: ArrayList, list2: ArrayList, list3: ArrayList): ArrayList {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'interleaveLists', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList, list2: ArrayList, list3: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 4, 5, 6, 7), arrayListOf(10, 20, 30, 40, 50, 60, 70), arrayListOf(100, 200, 300, 400, 500, 600, 700), arrayListOf(1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(10, 20), arrayListOf(15, 2), arrayListOf(5, 10), arrayListOf(10, 15, 5, 20, 2, 10))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(11, 44), arrayListOf(10, 15), arrayListOf(20, 5), arrayListOf(11, 10, 20, 44, 15, 5))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 579,MBPP/579,Kotlin,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ fun findDissimilar(test_tup1: ArrayList, test_tup2: ArrayList): ArrayList {","fun findDissimilar(test_tup1: ArrayList, test_tup2: ArrayList): ArrayList {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findDissimilar', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(test_tup1: ArrayList, test_tup2: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(3, 4, 5, 6), arrayListOf(5, 7, 4, 10), arrayListOf(3, 6, 7, 10))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4), arrayListOf(7, 2, 3, 9), arrayListOf(1, 4, 7, 9))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(21, 11, 25, 26), arrayListOf(26, 34, 21, 36), arrayListOf(34, 36, 11, 25))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 581,MBPP/581,Kotlin,Write a kotlin function to find the surface area of the square pyramid.,"/** * Write a kotlin function to find the surface area of the square pyramid. */ fun surfaceArea(b: Int, s: Int): Int {","fun surfaceArea(b: Int, s: Int): Int {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'surfaceArea', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(b: Int, s: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(3, 4, 33)\n println(""TEST-0...${result}"")\n \n result = driver(4, 5, 56)\n println(""TEST-1...${result}"")\n \n result = driver(1, 2, 5)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 583,MBPP/583,Kotlin,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ fun catalanNumber(num: Int): Int {",fun catalanNumber(num: Int): Int {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'catalanNumber', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(num: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(10, 16796)\n println(""TEST-0...${result}"")\n \n result = driver(9, 4862)\n println(""TEST-1...${result}"")\n \n result = driver(7, 429)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 584,MBPP/584,Kotlin,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ fun findAdverbs(text: String): String {",fun findAdverbs(text: String): String {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findAdverbs', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(text: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"")\n println(""TEST-0...${result}"")\n \n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"")\n println(""TEST-1...${result}"")\n \n result = driver(""Complete the task quickly"", ""18-25: quickly"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 586,MBPP/586,Kotlin,Write a kotlin function to split the array and add the first part to the end.,"/** * Write a kotlin function to split the array and add the first part to the end. */ fun splitArr(a: ArrayList, n: Int, k: Int): ArrayList {","fun splitArr(a: ArrayList, n: Int, k: Int): ArrayList {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'splitArr', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: ArrayList, n: Int, k: Int, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(12, 10, 5, 6, 52, 36), 6, 2, arrayListOf(5, 6, 52, 36, 12, 10))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4), 4, 1, arrayListOf(2, 3, 4, 1))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(0, 1, 2, 3, 4, 5, 6, 7), 8, 3, arrayListOf(3, 4, 5, 6, 7, 0, 1, 2))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 587,MBPP/587,Kotlin,Write a function to convert array to a tuple.,"/** * Write a function to convert array to a tuple. */ fun listTuple(listx: ArrayList): ArrayList {",fun listTuple(listx: ArrayList): ArrayList {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'listTuple', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(listx: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(listx), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(5, 10, 7, 4, 15, 3), arrayListOf(5, 10, 7, 4, 15, 3))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(2, 4, 5, 6, 2, 3, 4, 4, 7), arrayListOf(2, 4, 5, 6, 2, 3, 4, 4, 7))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(58, 44, 56), arrayListOf(58, 44, 56))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 588,MBPP/588,Kotlin,Write a kotlin function to find the difference between largest and smallest value in a given array.,"/** * Write a kotlin function to find the difference between largest and smallest value in a given array. */ fun bigDiff(nums: ArrayList): Int {",fun bigDiff(nums: ArrayList): Int {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'bigDiff', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(nums: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 2, 3, 4), 3)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(4, 5, 12), 8)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(9, 2, 3), 7)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 589,MBPP/589,Kotlin,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ fun perfectSquares(a: Int, b: Int): ArrayList {","fun perfectSquares(a: Int, b: Int): ArrayList {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'perfectSquares', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(a: Int, b: Int, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(1, 30, arrayListOf(1, 4, 9, 16, 25))\n println(""TEST-0...${result}"")\n \n result = driver(50, 100, arrayListOf(64, 81, 100))\n println(""TEST-1...${result}"")\n \n result = driver(100, 200, arrayListOf(100, 121, 144, 169, 196))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 591,MBPP/591,Kotlin,Write a kotlin function to interchange the first and last elements in array.,"/** * Write a kotlin function to interchange the first and last elements in array. */ fun swapList(newlist: ArrayList): ArrayList {",fun swapList(newlist: ArrayList): ArrayList {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'swapList', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:ArrayList, expected:ArrayList):Boolean{\n return actual.equals(expected)\n}\nfun driver(newlist: ArrayList, expected:ArrayList):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(12, 35, 9, 56, 24), arrayListOf(24, 35, 9, 56, 12))\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3), arrayListOf(3, 2, 1))\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(4, 5, 6), arrayListOf(6, 5, 4))\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 592,MBPP/592,Kotlin,Write a kotlin function to find sum of product of binomial co-efficients.,"/** * Write a kotlin function to find sum of product of binomial co-efficients. */ fun sumOfProduct(n: Int): Int {",fun sumOfProduct(n: Int): Int {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'sumOfProduct', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(3, 15)\n println(""TEST-0...${result}"")\n \n result = driver(4, 56)\n println(""TEST-1...${result}"")\n \n result = driver(1, 1)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 593,MBPP/593,Kotlin,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ fun removezeroIp(ip: String): String {",fun removezeroIp(ip: String): String {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'removezeroIp', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:String, expected:String):Boolean{\n return actual.equals(expected)\n}\nfun driver(ip: String, expected:String):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(ip), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(""216.08.094.196"", ""216.8.94.196"")\n println(""TEST-0...${result}"")\n \n result = driver(""12.01.024"", ""12.1.24"")\n println(""TEST-1...${result}"")\n \n result = driver(""216.08.094.0196"", ""216.8.94.196"")\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 594,MBPP/594,Kotlin,Write a function to find the difference of first even and odd number of a given array.,"/** * Write a function to find the difference of first even and odd number of a given array. */ fun diffEvenOdd(list1: ArrayList): Int {",fun diffEvenOdd(list1: ArrayList): Int {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(list1: ArrayList, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(1, 3, 5, 7, 4, 1, 6, 8), 3)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), 1)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(1, 5, 7, 9, 10), 9)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 597,MBPP/597,Kotlin,Write a function to find kth element from the given two sorted arrays.,"/** * Write a function to find kth element from the given two sorted arrays. */ fun findKth(arr1: ArrayList, arr2: ArrayList, m: Int, n: Int, k: Int): Int {","fun findKth(arr1: ArrayList, arr2: ArrayList, m: Int, n: Int, k: Int): Int {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'findKth', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Int, expected:Int):Boolean{\n return actual.equals(expected)\n}\nfun driver(arr1: ArrayList, arr2: ArrayList, m: Int, n: Int, k: Int, expected:Int):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(arrayListOf(2, 3, 6, 7, 9), arrayListOf(1, 4, 8, 10), 5, 4, 5, 6)\n println(""TEST-0...${result}"")\n \n result = driver(arrayListOf(100, 112, 256, 349, 770), arrayListOf(72, 86, 113, 119, 265, 445, 892), 5, 7, 7, 256)\n println(""TEST-1...${result}"")\n \n result = driver(arrayListOf(3, 4, 7, 8, 10), arrayListOf(2, 5, 9, 11), 5, 4, 6, 8)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 598,MBPP/598,Kotlin,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ fun armstrongNumber(number: Int): Boolean {",fun armstrongNumber(number: Int): Boolean {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'armstrongNumber', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(number: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(number), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(153, true)\n println(""TEST-0...${result}"")\n \n result = driver(259, false)\n println(""TEST-1...${result}"")\n \n result = driver(4458, false)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 600,MBPP/600,Kotlin,Write a kotlin function to check whether the given number is even or not using bitwise operator.,"/** * Write a kotlin function to check whether the given number is even or not using bitwise operator. */ fun isEven(n: Int): Boolean {",fun isEven(n: Int): Boolean {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'kts', 'entry_fn_name': 'isEven', 'test_code': 'package main\n\nimport kotlin.text.*\nimport kotlin.math.*\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ===================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE\n// ===================================\nfun validateSolution(actual:Boolean, expected:Boolean):Boolean{\n return actual.equals(expected)\n}\nfun driver(n: Int, expected:Boolean):String {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {\n return ""PASSED""\n }\n return ""FAILED""\n } catch (e: Exception){\n return e::class.simpleName as String\n }\n\n}\n\nfun main() {\n var result: String = """"\n result = driver(1, false)\n println(""TEST-0...${result}"")\n \n result = driver(2, true)\n println(""TEST-1...${result}"")\n \n result = driver(3, false)\n println(""TEST-2...${result}"")\n \n \n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['kotlinc', '-script', '__FILENAME__', '-no-reflect', '-nowarn']], 'timeouts': [30]}" 511,MBPP/511,Lua,Write a lua function to find minimum sum of factors of a given number.,"-- Write a lua function to find minimum sum of factors of a given number. function find_min_sum(num)",function find_min_sum(num),['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_min_sum', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find minimum sum of factors of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(num, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(num) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(12, 7)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(105, 15)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(2, 2)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,Lua,Write a function to find the summation of tuple elements in the given tuple array.,"-- Write a function to find the summation of tuple elements in the given tuple array. function sum_elements(test_tup)",function sum_elements(test_tup),['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'sum_elements', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the summation of tuple elements in the given tuple list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(test_tup, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(test_tup) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({7, 8, 9, 1, 10, 7}, 42)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4, 5, 6}, 21)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({11, 12, 13, 45, 14}, 95)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,Lua,Write a function to check if there is a subset with sum divisible by m.,"-- Write a function to check if there is a subset with sum divisible by m. function modular_sum(arr, n, m)","function modular_sum(arr, n, m)","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'modular_sum', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check if there is a subset with sum divisible by m.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, m, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n, m) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({3, 1, 7, 5}, 4, 6, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 7}, 2, 5, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 6}, 2, 5, false)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,Lua,Write a function to sort array of elements using radix sort.,"-- Write a function to sort array of elements using radix sort. function radix_sort(nums)",function radix_sort(nums),['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'radix_sort', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to sort a list of elements using radix sort.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(nums, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(nums) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({15, 79, 25, 68, 37}, {15, 25, 37, 68, 79})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({9, 11, 8, 7, 3, 2}, {2, 3, 7, 8, 9, 11})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({36, 12, 24, 26, 29}, {12, 24, 26, 29, 36})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,Lua,Write a lua function to find the largest postive number from the given array.,"-- Write a lua function to find the largest postive number from the given array. function largest_pos(list1)",function largest_pos(list1),['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'largest_pos', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the largest postive number from the given list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 4, -1}, 4)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({0, 1, 2, -5, -1, 6}, 6)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({0, 0, 1, 0}, 1)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,Lua,Write a function to find the square root of a perfect number.,"-- Write a function to find the square root of a perfect number. function sqrt_root(num)",function sqrt_root(num),['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'sqrt_root', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the square root of a perfect number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(num, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(num) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(4, 2)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(16, 4)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(400, 20)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,Lua,Write a function to calculate volume of a tetrahedron.,"-- Write a function to calculate volume of a tetrahedron. function volume_tetrahedron(num)",function volume_tetrahedron(num),['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'volume_tetrahedron', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to calculate volume of a tetrahedron.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return math.abs(actual - expected) < 1e-06\nend\n\nfunction driver(num, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(num) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(10, 117.85)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(15, 397.75)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(20, 942.81)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,Lua,Write a function to find the lcm of the given array elements.,"-- Write a function to find the lcm of the given array elements. function get_lcm(l)",function get_lcm(l),['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'get_lcm', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the lcm of the given array elements.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(l, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(l) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({2, 7, 3, 9, 4}, 252)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 8, 3}, 24)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({3, 8, 4, 10, 5}, 120)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,Lua,Write a function to print check if the triangle is scalene or not.,"-- Write a function to print check if the triangle is scalene or not. function check_isosceles(x, y, z)","function check_isosceles(x, y, z)","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'check_isosceles', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to print check if the triangle is scalene or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(x, y, z, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(x, y, z) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(6, 8, 12, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(6, 6, 12, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(6, 15, 20, true)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,Lua,Write a function to find the longest bitonic subsequence for the given array.,"-- Write a function to find the longest bitonic subsequence for the given array. function lbs(arr)",function lbs(arr),['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'lbs', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the longest bitonic subsequence for the given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}, 7)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 11, 2, 10, 4, 5, 2, 1}, 6)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({80, 60, 30, 40, 20, 10}, 5)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,Lua,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","-- Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. function check_string(str1)",function check_string(str1),['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'check_string', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(str1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(str1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""python"", {""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""123python"", {""String must have 1 upper case character.""})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""123Python"", {""Valid string.""})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,Lua,Write a function to find the sum of maximum increasing subsequence of the given array.,"-- Write a function to find the sum of maximum increasing subsequence of the given array. function max_sum_increasing_subsequence(arr, n)","function max_sum_increasing_subsequence(arr, n)","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'max_sum_increasing_subsequence', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the sum of maximum increasing subsequence of the given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 101, 2, 3, 100, 4, 5}, 7, 106)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({3, 4, 5, 10}, 4, 22)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({10, 5, 4, 3}, 4, 10)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,Lua,Write a lua function to check whether two given lines are parallel or not.,"-- Write a lua function to check whether two given lines are parallel or not. function parallel_lines(line1, line2)","function parallel_lines(line1, line2)","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'parallel_lines', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether two given lines are parallel or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(line1, line2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(line1, line2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({2, 3, 4}, {2, 3, 8}, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({2, 3, 4}, {4, -3, 8}, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({3, 3}, {5, 5}, true)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,Lua,Write a lua function to capitalize first and last letters of each word of a given string.,"-- Write a lua function to capitalize first and last letters of each word of a given string. function capitalize_first_last_letters(str1)",function capitalize_first_last_letters(str1),['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'capitalize_first_last_letters', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to capitalize first and last letters of each word of a given string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(str1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(str1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""python"", ""PythoN"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""bigdata"", ""BigdatA"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""Hadoop"", ""HadooP"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,Lua,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"-- Write a function to find all pairs in an integer array whose sum is equal to a given number. function get_pairs_count(arr, n, sum)","function get_pairs_count(arr, n, sum)","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'get_pairs_count', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find all pairs in an integer array whose sum is equal to a given number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, sum, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n, sum) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 5, 7, -1, 5}, 5, 6, 3)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 5, 7, -1}, 4, 6, 2)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 1, 1, 1}, 4, 2, 6)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,Lua,Write a function to find the nth jacobsthal-lucas number.,"-- Write a function to find the nth jacobsthal-lucas number. function jacobsthal_lucas(n)",function jacobsthal_lucas(n),['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'jacobsthal_lucas', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the nth jacobsthal-lucas number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(5, 31)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(2, 5)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(4, 17)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,Lua,Write a function to find the ration of negative numbers in an array of integers.,"-- Write a function to find the ration of negative numbers in an array of integers. function negative_count(nums)",function negative_count(nums),['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'negative_count', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the ration of negative numbers in an array of integers.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return math.abs(actual - expected) < 1e-06\nend\n\nfunction driver(nums, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(nums) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8}, 0.31)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8}, 0.31)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({2, 4, -6, -9, 11, -12, 14, -5, 17}, 0.44)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,Lua,Write a function to find minimum number of coins that make a given value.,"-- Write a function to find minimum number of coins that make a given value. function min_coins(coins, m, v)","function min_coins(coins, m, v)","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'min_coins', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find minimum number of coins that make a given value.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(coins, m, v, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(coins, m, v) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({9, 6, 5, 1}, 4, 11, 2)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({4, 5, 6, 7, 8, 9}, 6, 9, 1)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3}, 3, 4, 2)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,Lua,Write a function to check if the two given strings are permutations of each other.,"-- Write a function to check if the two given strings are permutations of each other. function check_permutation(str1, str2)","function check_permutation(str1, str2)","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'check_permutation', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check if the two given strings are permutations of each other.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(str1, str2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(str1, str2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""abc"", ""cba"", true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""test"", ""ttew"", false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""xxyz"", ""yxzx"", true)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,Lua,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"-- Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. function search_literal(pattern, text)","function search_literal(pattern, text)","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'search_literal', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(pattern, text, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(pattern, text) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""python"", ""python programming language"", {0, 6})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""programming"", ""python programming language"", {7, 18})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""language"", ""python programming language"", {19, 27})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,Lua,Write a function to find the top or bottom surface area of a cylinder.,"-- Write a function to find the top or bottom surface area of a cylinder. function topbottom_surfacearea(r)",function topbottom_surfacearea(r),['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'topbottom_surfacearea', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the top or bottom surface area of a cylinder.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return math.abs(actual - expected) < 1e-09\nend\n\nfunction driver(r, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(r) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(10, 314.15000000000003)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(5, 78.53750000000001)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(4, 50.264)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,Lua,Write a function to select the nth items of array.,"-- Write a function to select the nth items of array. function nth_items(list, n)","function nth_items(list, n)","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'nth_items', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to select the nth items of a list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, {1, 3, 5, 7, 9})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({10, 15, 19, 17, 16, 18}, 3, {10, 17})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({14, 16, 19, 15, 17}, 4, {14, 17})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,Lua,Write a lua function to find the first repeated word in a given string.,"-- Write a lua function to find the first repeated word in a given string. function first_repeated_word(str1)",function first_repeated_word(str1),['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'first_repeated_word', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the first repeated word in a given string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(str1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(str1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""ab ca bc ab"", ""ab"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""ab ca bc"", ""None"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""ab ca bc ca ab bc"", ""ca"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,Lua,Write a lua function to convert a given string array to a tuple.,"-- Write a lua function to convert a given string array to a tuple. function string_list_to_tuple(str1)",function string_list_to_tuple(str1),['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'string_list_to_tuple', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to convert a given string list to a tuple.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(str1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(str1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""python 3.0"", {\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""bigdata"", {\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""language"", {\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,Lua,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using table function.,"-- Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using table function. function basesnum_coresspondingnum(bases_num, index)","function basesnum_coresspondingnum(bases_num, index)","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'basesnum_coresspondingnum', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(bases_num, index, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(bases_num, index) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4, 5, 6, 7}, {10, 20, 30, 40, 50, 60, 70}, {1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({4, 8, 12, 16, 20, 24, 28}, {3, 6, 9, 12, 15, 18, 21}, {64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,Lua,Write a lua function to find the difference between highest and least frequencies in a given array.,"-- Write a lua function to find the difference between highest and least frequencies in a given array. function find_diff(arr, n)","function find_diff(arr, n)","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_diff', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between highest and least frequencies in a given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 1, 2, 2, 7, 8, 4, 5, 1, 4}, 10, 2)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 7, 9, 2, 3, 3, 1, 3, 3}, 9, 3)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 1, 2}, 4, 0)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,Lua,Write a function to find if the given number is abundant or not.,"-- Write a function to find if the given number is abundant or not. function check_abundant(n)",function check_abundant(n),['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'check_abundant', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find if the given number is abundant or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(12, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(15, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(18, true)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,Lua,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","-- Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. function fill_spaces(text)",function fill_spaces(text),['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'fill_spaces', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(text, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(text) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,Lua,Write a function to add two numbers and print number of digits of sum.,"-- Write a function to add two numbers and print number of digits of sum. function count_digits(num1, num2)","function count_digits(num1, num2)","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'count_digits', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to add two numbers and print number of digits of sum.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(num1, num2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(num1, num2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(9875, 10, 4)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(98759853034, 100, 11)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(1234567, 500, 7)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,Lua,Write a lua function to toggle only first and last bits of a given number.,"-- Write a lua function to toggle only first and last bits of a given number. function toggle_f_and_l_bits(n)",function toggle_f_and_l_bits(n),['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'toggle_f_and_l_bits', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to toggle only first and last bits of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(10, 3)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(15, 6)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(20, 5)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,Lua,Write a function to find the last occurrence of a character in a string.,"-- Write a function to find the last occurrence of a character in a string. function last_occurence_char(string_arg0, char_arg1)","function last_occurence_char(string_arg0, char_arg1)","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'last_occurence_char', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the last occurrence of a character in a string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(string_arg0, char_arg1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(string_arg0, char_arg1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""hello world"", \'l\', 10)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""language"", \'g\', 7)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""little"", \'y\', None)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,Lua,Write a lua function to find the sum of hamming distances of all consecutive numbers from o to n.,"-- Write a lua function to find the sum of hamming distances of all consecutive numbers from o to n. function total_hamming_distance(n)",function total_hamming_distance(n),['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'total_hamming_distance', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(4, 7)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(2, 3)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(5, 8)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,Lua,Write a function to find the length of the longest increasing subsequence of the given sequence.,"-- Write a function to find the length of the longest increasing subsequence of the given sequence. function longest_increasing_subsequence(arr)",function longest_increasing_subsequence(arr),['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'longest_increasing_subsequence', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the length of the longest increasing subsequence of the given sequence.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({10, 22, 9, 33, 21, 50, 41, 60}, 5)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({3, 10, 2, 1, 20}, 3)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({50, 3, 10, 7, 40, 80}, 4)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,Lua,Write a lua function to find the sum of fifth power of first n odd natural numbers.,"-- Write a lua function to find the sum of fifth power of first n odd natural numbers. function odd_num_sum(n)",function odd_num_sum(n),['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'odd_num_sum', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the sum of fifth power of first n odd natural numbers.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(1, 1)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(2, 244)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(3, 3369)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,Lua,Write a lua function to find the maximum element in a sorted and rotated array.,"-- Write a lua function to find the maximum element in a sorted and rotated array. function find_max(arr, low, high)","function find_max(arr, low, high)","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_max', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the maximum element in a sorted and rotated array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, low, high, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, low, high) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({2, 3, 5, 6, 9}, 0, 4, 9)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({3, 4, 5, 2, 1}, 0, 4, 5)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3}, 0, 2, 3)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,Lua,Write a function to extract a specified column from a given nested array.,"-- Write a function to extract a specified column from a given nested array. function extract_column(list1, n)","function extract_column(list1, n)","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'extract_column', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to extract a specified column from a given nested list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({{1, 2, 3}, {2, 4, 5}, {1, 1, 1}}, 0, {1, 2, 1})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({{1, 2, 3}, {-2, 4, -5}, {1, -1, 1}}, 2, {3, -5, 1})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({{1, 3}, {5, 7}, {1, 3}, {13, 15, 17}, {5, 7}, {9, 11}}, 0, {1, 5, 1, 13, 5, 9})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,Lua,Write a lua function to check whether a given sequence is linear or not.,"-- Write a lua function to check whether a given sequence is linear or not. function seq_linear(seq_nums)",function seq_linear(seq_nums),['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'seq_linear', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether a given sequence is linear or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(seq_nums, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(seq_nums) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({0, 2, 4, 6, 8, 10}, ""Linear Sequence"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3}, ""Linear Sequence"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 5, 2}, ""Non Linear Sequence"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,Lua,Write a function to convert the given tuple to a floating-point number.,"-- Write a function to convert the given tuple to a floating-point number. function tuple_to_float(test_tup)",function tuple_to_float(test_tup),['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'tuple_to_float', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to convert the given tuple to a floating-point number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return math.abs(actual - expected) < 1e-06\nend\n\nfunction driver(test_tup, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(test_tup) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({4, 56}, 4.56)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({7, 256}, 7.256)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({8, 123}, 8.123)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,Lua,Write a lua function to find odd numbers from a mixed array.,"-- Write a lua function to find odd numbers from a mixed array. function split(list)",function split(list),['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'split', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find odd numbers from a mixed list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 4, 5, 6}, {1, 3, 5})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({10, 11, 12, 13}, {11, 13})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({7, 8, 9, 1}, {7, 9, 1})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,Lua,Write a lua function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"-- Write a lua function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. function difference(n)",function difference(n),['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'difference', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(3, 30)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(5, 210)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(2, 6)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,Lua,Write a lua function to count the pairs with xor as an odd number.,"-- Write a lua function to count the pairs with xor as an odd number. function find_odd_pair(a, n)","function find_odd_pair(a, n)","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_odd_pair', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to count the pairs with xor as an odd number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({5, 4, 7, 2, 1}, 5, 6)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({7, 2, 8, 1, 0, 5, 11}, 7, 12)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3}, 3, 2)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,Lua,Write a function to toggle characters case in a string.,"-- Write a function to toggle characters case in a string. function toggle_string(string_arg0)",function toggle_string(string_arg0),['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'toggle_string', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to toggle characters case in a string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(string_arg0, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(string_arg0) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""Python"", ""pYTHON"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""Pangram"", ""pANGRAM"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""LIttLE"", ""liTTle"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,Lua,Write a lua function to find the digit distance between two integers.,"-- Write a lua function to find the digit distance between two integers. function digit_distance_nums(n1, n2)","function digit_distance_nums(n1, n2)","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'digit_distance_nums', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the digit distance between two integers.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n1, n2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n1, n2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(1, 2, 1)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(23, 56, 6)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(123, 256, 7)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,Lua,Write a function to find the largest sum of contiguous subarray in the given array.,"-- Write a function to find the largest sum of contiguous subarray in the given array. function max_sub_array_sum(a, size)","function max_sub_array_sum(a, size)","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'max_sub_array_sum', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the largest sum of contiguous subarray in the given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, size, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, size) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({-2, -3, 4, -1, -2, 1, 5, -3}, 8, 7)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({-3, -4, 5, -2, -3, 2, 6, -4}, 8, 8)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({-4, -5, 6, -3, -4, 3, 7, -5}, 8, 10)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,Lua,Write a function to find the union of elements of the given tuples.,"-- Write a function to find the union of elements of the given tuples. function union_elements(test_tup1, test_tup2)","function union_elements(test_tup1, test_tup2)","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'union_elements', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the union of elements of the given tuples.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(test_tup1, test_tup2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(test_tup1, test_tup2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({3, 4, 5, 6}, {5, 7, 4, 10}, {3, 4, 5, 6, 7, 10})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4}, {3, 4, 5, 6}, {1, 2, 3, 4, 5, 6})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({11, 12, 13, 14}, {13, 15, 16, 17}, {11, 12, 13, 14, 15, 16, 17})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,Lua,Write a lua function to find the maximum length of sublist.,"-- Write a lua function to find the maximum length of sublist. function find_max_length(lst)",function find_max_length(lst),['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_max_length', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the maximum length of sublist.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(lst, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(lst) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({{1}, {1, 4}, {5, 6, 7, 8}}, 4)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({{0, 1}, {2, 2}, {3, 2, 1}}, 3)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({{7}, {22, 23}, {13, 14, 15}, {10, 20, 30, 40, 50}}, 5)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,Lua,Write a function to extract values between quotation marks of a string.,"-- Write a function to extract values between quotation marks of a string. function extract_values(text)",function extract_values(text),['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'extract_values', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to extract values between quotation marks of a string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(text, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(text) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", {""Python"", ""PHP"", ""Java""})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", {""python"", ""program"", ""language""})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", {""red"", ""blue"", ""green"", ""yellow""})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,Lua,Write a lua function to count unequal element pairs from the given array.,"-- Write a lua function to count unequal element pairs from the given array. function count_pairs(arr, n)","function count_pairs(arr, n)","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'count_pairs', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to count unequal element pairs from the given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 1}, 3, 2)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 1, 1, 1}, 4, 0)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3, 4, 5}, 5, 10)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,Lua,Write a lua function to split a string into characters.,"-- Write a lua function to split a string into characters. function split(word)",function split(word),['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'split', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to split a string into characters.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(word, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(word) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""python"", {\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""Name"", {\'N\', \'a\', \'m\', \'e\'})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""program"", {\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,Lua,Write a function to get the sum of a non-negative integer.,"-- Write a function to get the sum of a non-negative integer. function sum_digits(n)",function sum_digits(n),['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'sum_digits', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to get the sum of a non-negative integer.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(345, 12)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(12, 3)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(97, 16)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,Lua,Write a function to check whether a specified array is sorted or not.,"-- Write a function to check whether a specified array is sorted or not. function issort_list(list1)",function issort_list(list1),['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'issort_list', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether a specified list is sorted or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 4, 6, 8, 10, 12, 14, 16, 17}, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 4, 6, 8, 10, 12, 14, 20, 17}, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 4, 6, 8, 10, 15, 14, 20}, false)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,Lua,Write a function to sort each sublist of strings in a given array of arrays.,"-- Write a function to sort each sublist of strings in a given array of arrays. function sort_sublists(list1)",function sort_sublists(list1),['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'sort_sublists', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to sort each sublist of strings in a given list of lists.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({{""green"", ""orange""}, {""black"", ""white""}, {""white"", ""black"", ""orange""}}, {{""green"", ""orange""}, {""black"", ""white""}, {""black"", ""orange"", ""white""}})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}}, {{""green"", ""orange""}, {""black""}, {""green"", ""orange""}, {""white""}})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({{""a"", ""b""}, {""d"", ""c""}, {""g"", ""h""}, {""f"", ""e""}}, {{""a"", ""b""}, {""c"", ""d""}, {""g"", ""h""}, {""e"", ""f""}})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,Lua,Write a function to remove words from a given array of strings containing a character or string.,"-- Write a function to remove words from a given array of strings containing a character or string. function remove_words(list1, charlist)","function remove_words(list1, charlist)","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'remove_words', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to remove words from a given list of strings containing a character or string.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, charlist, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1, charlist) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""}, {""#"", ""color"", ""@""}, {""Red"", """", ""Green"", ""Orange"", ""White""})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, {""&"", ""+"", ""@""}, {""Red"", """", ""Green"", ""Orange"", ""White""})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""}, {""@""}, {""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,Lua,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"-- Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. function max_sum_pair_diff_lessthan_k(arr, n, k)","function max_sum_pair_diff_lessthan_k(arr, n, k)","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'max_sum_pair_diff_lessthan_k', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr, n, k, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr, n, k) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({3, 5, 10, 15, 17, 12, 9}, 7, 4, 62)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({5, 15, 10, 300}, 4, 12, 25)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3, 4, 5, 6}, 6, 6, 21)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,Lua,Write a lua function to remove two duplicate numbers from a given number of arrays.,"-- Write a lua function to remove two duplicate numbers from a given number of arrays. function two_unique_nums(nums)",function two_unique_nums(nums),['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'two_unique_nums', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to remove two duplicate numbers from a given number of lists.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(nums, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(nums) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 2, 3, 4, 5}, {1, 4, 5})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 2, 4, 5}, {1, 3, 4, 5})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 2, 3, 4, 5}, {1, 2, 3, 4, 5})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,Lua,Write a lua function to calculate the product of the unique numbers of a given array.,"-- Write a lua function to calculate the product of the unique numbers of a given array. function unique_product(list_data)",function unique_product(list_data),['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'unique_product', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to calculate the product of the unique numbers of a given list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list_data, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list_data) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({10, 20, 30, 40, 20, 50, 60, 40}, 720000000)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 1}, 6)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({7, 8, 9, 0, 1, 1}, 0)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,Lua,Write a function to find the surface area of a cylinder.,"-- Write a function to find the surface area of a cylinder. function surfacearea_cylinder(r, h)","function surfacearea_cylinder(r, h)","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'surfacearea_cylinder', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the surface area of a cylinder.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return math.abs(actual - expected) < 1e-09\nend\n\nfunction driver(r, h, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(r, h) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(10, 5, 942.45)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(4, 5, 226.18800000000002)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(4, 10, 351.848)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,Lua,Write a lua function to find nth number in a sequence which is not a multiple of a given number.,"-- Write a lua function to find nth number in a sequence which is not a multiple of a given number. function count_no(a, n, l, r)","function count_no(a, n, l, r)","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'count_no', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find nth number in a sequence which is not a multiple of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, n, l, r, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, n, l, r) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(2, 3, 1, 10, 5)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(3, 6, 4, 20, 11)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(5, 10, 4, 20, 16)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,Lua,Write a lua function to check whether an array is subarray of another or not.,"-- Write a lua function to check whether an array is subarray of another or not. function is_sub_array(a, b, n, m)","function is_sub_array(a, b, n, m)","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'is_sub_array', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether an array is subarray of another or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, b, n, m, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, b, n, m) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 4, 3, 5}, {1, 2}, 4, 2, false)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 1}, {1, 2, 1}, 3, 3, true)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 0, 2, 2}, {2, 2, 0}, 4, 3, false)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,Lua,Write a lua function to find the last digit in factorial of a given number.,"-- Write a lua function to find the last digit in factorial of a given number. function last_digit_factorial(n)",function last_digit_factorial(n),['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'last_digit_factorial', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the last digit in factorial of a given number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(4, 4)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(21, 0)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(30, 0)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,Lua,Write a function to interleave arrays of the same length.,"-- Write a function to interleave arrays of the same length. function interleave_lists(list1, list2, list3)","function interleave_lists(list1, list2, list3)","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'interleave_lists', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to interleave lists of the same length.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, list2, list3, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1, list2, list3) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 4, 5, 6, 7}, {10, 20, 30, 40, 50, 60, 70}, {100, 200, 300, 400, 500, 600, 700}, {1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({10, 20}, {15, 2}, {5, 10}, {10, 15, 5, 20, 2, 10})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({11, 44}, {10, 15}, {20, 5}, {11, 10, 20, 44, 15, 5})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,Lua,Write a function to find the dissimilar elements in the given two tuples.,"-- Write a function to find the dissimilar elements in the given two tuples. function find_dissimilar(test_tup1, test_tup2)","function find_dissimilar(test_tup1, test_tup2)","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_dissimilar', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the dissimilar elements in the given two tuples.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(test_tup1, test_tup2, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(test_tup1, test_tup2) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({3, 4, 5, 6}, {5, 7, 4, 10}, {3, 6, 7, 10})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4}, {7, 2, 3, 9}, {1, 4, 7, 9})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({21, 11, 25, 26}, {26, 34, 21, 36}, {34, 36, 11, 25})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,Lua,Write a lua function to find the surface area of the square pyramid.,"-- Write a lua function to find the surface area of the square pyramid. function surface_area(b, s)","function surface_area(b, s)","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'surface_area', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the surface area of the square pyramid.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(b, s, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(b, s) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(3, 4, 33)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(4, 5, 56)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(1, 2, 5)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,Lua,Write a function for nth catalan number.,"-- Write a function for nth catalan number. function catalan_number(num)",function catalan_number(num),['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'catalan_number', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function for nth catalan number.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(num, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(num) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(10, 16796)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(9, 4862)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(7, 429)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,Lua,Write a function to find all adverbs and their positions in a given sentence by using regex.,"-- Write a function to find all adverbs and their positions in a given sentence by using regex. function find_adverbs(text)",function find_adverbs(text),['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_adverbs', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find all adverbs and their positions in a given sentence by using regex.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(text, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(text) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""Complete the task quickly"", ""18-25: quickly"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,Lua,Write a lua function to split the array and add the first part to the end.,"-- Write a lua function to split the array and add the first part to the end. function split_arr(a, n, k)","function split_arr(a, n, k)","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'split_arr', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to split the array and add the first part to the end.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, n, k, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, n, k) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({12, 10, 5, 6, 52, 36}, 6, 2, {5, 6, 52, 36, 12, 10})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4}, 4, 1, {2, 3, 4, 1})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7}, 8, 3, {3, 4, 5, 6, 7, 0, 1, 2})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,Lua,Write a function to convert array to a tuple.,"-- Write a function to convert array to a tuple. function list_tuple(listx)",function list_tuple(listx),['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'list_tuple', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to convert a list to a tuple.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(listx, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(listx) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({5, 10, 7, 4, 15, 3}, {5, 10, 7, 4, 15, 3})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({2, 4, 5, 6, 2, 3, 4, 4, 7}, {2, 4, 5, 6, 2, 3, 4, 4, 7})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({58, 44, 56}, {58, 44, 56})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,Lua,Write a lua function to find the difference between largest and smallest value in a given array.,"-- Write a lua function to find the difference between largest and smallest value in a given array. function big_diff(nums)",function big_diff(nums),['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'big_diff', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find the difference between largest and smallest value in a given array.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(nums, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(nums) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 2, 3, 4}, 3)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({4, 5, 12}, 8)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({9, 2, 3}, 7)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,Lua,Write a function to find perfect squares between two given numbers.,"-- Write a function to find perfect squares between two given numbers. function perfect_squares(a, b)","function perfect_squares(a, b)","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'perfect_squares', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find perfect squares between two given numbers.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(a, b, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(a, b) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(1, 30, {1, 4, 9, 16, 25})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(50, 100, {64, 81, 100})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(100, 200, {100, 121, 144, 169, 196})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,Lua,Write a lua function to interchange the first and last elements in array.,"-- Write a lua function to interchange the first and last elements in array. function swap_list(newlist)",function swap_list(newlist),['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'swap_list', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to interchange the first and last elements in a list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(newlist, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(newlist) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({12, 35, 9, 56, 24}, {24, 35, 9, 56, 12})\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3}, {3, 2, 1})\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({4, 5, 6}, {6, 5, 4})\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,Lua,Write a lua function to find sum of product of binomial co-efficients.,"-- Write a lua function to find sum of product of binomial co-efficients. function sum_of_product(n)",function sum_of_product(n),['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'sum_of_product', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to find sum of product of binomial co-efficients.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(3, 15)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(4, 56)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(1, 1)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,Lua,Write a function to remove leading zeroes from an ip address.,"-- Write a function to remove leading zeroes from an ip address. function removezero_ip(ip)",function removezero_ip(ip),['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'removezero_ip', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to remove leading zeroes from an ip address.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(ip, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(ip) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(""216.08.094.196"", ""216.8.94.196"")\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(""12.01.024"", ""12.1.24"")\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(""216.08.094.0196"", ""216.8.94.196"")\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,Lua,Write a function to find the difference of first even and odd number of a given array.,"-- Write a function to find the difference of first even and odd number of a given array. function diff_even_odd(list1)",function diff_even_odd(list1),['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'diff_even_odd', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find the difference of first even and odd number of a given list.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(list1, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(list1) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({1, 3, 5, 7, 4, 1, 6, 8}, 3)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 1)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({1, 5, 7, 9, 10}, 9)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,Lua,Write a function to find kth element from the given two sorted arrays.,"-- Write a function to find kth element from the given two sorted arrays. function find_kth(arr1, arr2, m, n, k)","function find_kth(arr1, arr2, m, n, k)","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'find_kth', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to find kth element from the given two sorted arrays.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(arr1, arr2, m, n, k, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver({2, 3, 6, 7, 9}, {1, 4, 8, 10}, 5, 4, 5, 6)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver({100, 112, 256, 349, 770}, {72, 86, 113, 119, 265, 445, 892}, 5, 7, 7, 256)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver({3, 4, 7, 8, 10}, {2, 5, 9, 11}, 5, 4, 6, 8)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,Lua,Write a function to check whether the given number is armstrong or not.,"-- Write a function to check whether the given number is armstrong or not. function armstrong_number(number)",function armstrong_number(number),['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'armstrong_number', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a function to check whether the given number is armstrong or not.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(number, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(number) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(153, true)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(259, false)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(4458, false)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,Lua,Write a lua function to check whether the given number is even or not using bitwise operator.,"-- Write a lua function to check whether the given number is even or not using bitwise operator. function is_even(n)",function is_even(n),['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'lua', 'entry_fn_name': 'is_even', 'test_code': '\n-- Question Prompt (NOT what is passed to the model)\n-- Write a python function to check whether the given number is even or not using bitwise operator.\n--\n-- SOLUTION CODE\n-- ============================================\nPLACEHOLDER_CODE_BODY\n\n-- TESTING CODE \n-- ============================================\nfunction isCorrect(actual, expected)\n if type(expected) ~= type(actual) then\n return false\n end\n \n if type(expected) == \'table\' then\n for k,v_expected in pairs(expected) do\n \n if actual[k] == nil then\n return false\n end\n local v_actual = actual[k]\n if not isCorrect(v_actual, v_expected) then\n return false\n end\n actual[k]=nil\n end\n \n if next(actual) then \n return false\n end\n return true\n else\n return actual == expected\n end\nend\n\nfunction validateSolution(actual, expected)\n return isCorrect(actual,expected)\nend\n\nfunction driver(n, expected)\n local exec_result;\n local status, error_msg = pcall(function () \n exec_result=PLACEHOLDER_FN_NAME(n) \n end)\n if status then\n if validateSolution(exec_result,expected) then\n return ""PASSED""\n end\n return ""FAILED""\n else\n return string.format(""ERROR=%s"",string.gsub(error_msg,"".*:[%d]+: "",""""))\n end\nend\n \nfunction main()\n result = driver(1, false)\n print(string.format(""TEST-0...%s"",result))\n\n result = driver(2, true)\n print(string.format(""TEST-1...%s"",result))\n\n result = driver(3, false)\n print(string.format(""TEST-2...%s"",result))\n\nend\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['lua', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,PHP,Write a php function to find minimum sum of factors of a given number.,"/** * Write a php function to find minimum sum of factors of a given number. */ function findMinSum($num) {",function findMinSum($num) {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findMinSum', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,PHP,Write a function to find the summation of tuple elements in the given tuple list.,"/** * Write a function to find the summation of tuple elements in the given tuple list. */ function sumElements($test_tup) {",function sumElements($test_tup) {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'sumElements', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,PHP,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ function modularSum($arr, $n, $m) {","function modularSum($arr, $n, $m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'modularSum', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,PHP,Write a function to sort a list of elements using radix sort.,"/** * Write a function to sort a list of elements using radix sort. */ function radixSort($nums) {",function radixSort($nums) {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'radixSort', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,PHP,Write a php function to find the largest postive number from the given list.,"/** * Write a php function to find the largest postive number from the given list. */ function largestPos($list1) {",function largestPos($list1) {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'largestPos', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,PHP,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ function sqrtRoot($num) {",function sqrtRoot($num) {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'sqrtRoot', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,PHP,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ function volumeTetrahedron($num) {",function volumeTetrahedron($num) {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'volumeTetrahedron', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,PHP,Write a function to find the lcm of the given array elements.,"/** * Write a function to find the lcm of the given array elements. */ function getLcm($l) {",function getLcm($l) {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'getLcm', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,PHP,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ function checkIsosceles($x, $y, $z) {","function checkIsosceles($x, $y, $z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'checkIsosceles', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,PHP,Write a function to find the longest bitonic subsequence for the given array.,"/** * Write a function to find the longest bitonic subsequence for the given array. */ function lbs($arr) {",function lbs($arr) {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'lbs', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,PHP,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ function checkString($str1) {",function checkString($str1) {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'checkString', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,PHP,Write a function to find the sum of maximum increasing subsequence of the given array.,"/** * Write a function to find the sum of maximum increasing subsequence of the given array. */ function maxSumIncreasingSubsequence($arr, $n) {","function maxSumIncreasingSubsequence($arr, $n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,PHP,Write a php function to check whether two given lines are parallel or not.,"/** * Write a php function to check whether two given lines are parallel or not. */ function parallelLines($line1, $line2) {","function parallelLines($line1, $line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'parallelLines', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,PHP,Write a php function to capitalize first and last letters of each word of a given string.,"/** * Write a php function to capitalize first and last letters of each word of a given string. */ function capitalizeFirstLastLetters($str1) {",function capitalizeFirstLastLetters($str1) {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,PHP,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ function getPairsCount($arr, $n, $sum) {","function getPairsCount($arr, $n, $sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'getPairsCount', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,PHP,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ function jacobsthalLucas($n) {",function jacobsthalLucas($n) {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'jacobsthalLucas', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,PHP,Write a function to find the ration of negative numbers in an array of integers.,"/** * Write a function to find the ration of negative numbers in an array of integers. */ function negativeCount($nums) {",function negativeCount($nums) {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'negativeCount', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,PHP,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ function minCoins($coins, $m, $v) {","function minCoins($coins, $m, $v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'minCoins', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,PHP,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ function checkPermutation($str1, $str2) {","function checkPermutation($str1, $str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'checkPermutation', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,PHP,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ function searchLiteral($pattern, $text) {","function searchLiteral($pattern, $text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'searchLiteral', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,PHP,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ function topbottomSurfacearea($r) {",function topbottomSurfacearea($r) {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,PHP,Write a function to select the nth items of a list.,"/** * Write a function to select the nth items of a list. */ function nthItems($list, $n) {","function nthItems($list, $n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'nthItems', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,PHP,Write a php function to find the first repeated word in a given string.,"/** * Write a php function to find the first repeated word in a given string. */ function firstRepeatedWord($str1) {",function firstRepeatedWord($str1) {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'firstRepeatedWord', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,PHP,Write a php function to convert a given string list to a tuple.,"/** * Write a php function to convert a given string list to a tuple. */ function stringListToTuple($str1) {",function stringListToTuple($str1) {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'stringListToTuple', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,PHP,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using array function.,"/** * Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using array function. */ function basesnumCoresspondingnum($bases_num, $index) {","function basesnumCoresspondingnum($bases_num, $index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,PHP,Write a php function to find the difference between highest and least frequencies in a given array.,"/** * Write a php function to find the difference between highest and least frequencies in a given array. */ function findDiff($arr, $n) {","function findDiff($arr, $n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findDiff', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,PHP,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ function checkAbundant($n) {",function checkAbundant($n) {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'checkAbundant', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,PHP,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ function fillSpaces($text) {",function fillSpaces($text) {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'fillSpaces', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,PHP,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ function countDigits($num1, $num2) {","function countDigits($num1, $num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'countDigits', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,PHP,Write a php function to toggle only first and last bits of a given number.,"/** * Write a php function to toggle only first and last bits of a given number. */ function toggleFAndLBits($n) {",function toggleFAndLBits($n) {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'toggleFAndLBits', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,PHP,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ function lastOccurenceChar($string_arg0, $char_arg1) {","function lastOccurenceChar($string_arg0, $char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'lastOccurenceChar', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,PHP,Write a php function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a php function to find the sum of hamming distances of all consecutive numbers from o to n. */ function totalHammingDistance($n) {",function totalHammingDistance($n) {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'totalHammingDistance', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,PHP,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ function longestIncreasingSubsequence($arr) {",function longestIncreasingSubsequence($arr) {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,PHP,Write a php function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a php function to find the sum of fifth power of first n odd natural numbers. */ function oddNumSum($n) {",function oddNumSum($n) {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'oddNumSum', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,PHP,Write a php function to find the maximum element in a sorted and rotated array.,"/** * Write a php function to find the maximum element in a sorted and rotated array. */ function findMax($arr, $low, $high) {","function findMax($arr, $low, $high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findMax', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,PHP,Write a function to extract a specified column from a given nested list.,"/** * Write a function to extract a specified column from a given nested list. */ function extractColumn($list1, $n) {","function extractColumn($list1, $n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'extractColumn', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,PHP,Write a php function to check whether a given sequence is linear or not.,"/** * Write a php function to check whether a given sequence is linear or not. */ function seqLinear($seq_nums) {",function seqLinear($seq_nums) {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'seqLinear', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,PHP,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ function tupleToFloat($test_tup) {",function tupleToFloat($test_tup) {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'tupleToFloat', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,PHP,Write a php function to find odd numbers from a mixed list.,"/** * Write a php function to find odd numbers from a mixed list. */ function split($list) {",function split($list) {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'split', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,PHP,Write a php function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a php function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ function difference($n) {",function difference($n) {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'difference', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,PHP,Write a php function to count the pairs with xor as an odd number.,"/** * Write a php function to count the pairs with xor as an odd number. */ function findOddPair($a, $n) {","function findOddPair($a, $n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findOddPair', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,PHP,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ function toggleString($string_arg0) {",function toggleString($string_arg0) {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'toggleString', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,PHP,Write a php function to find the digit distance between two integers.,"/** * Write a php function to find the digit distance between two integers. */ function digitDistanceNums($n1, $n2) {","function digitDistanceNums($n1, $n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'digitDistanceNums', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,PHP,Write a function to find the largest sum of contiguous subarray in the given array.,"/** * Write a function to find the largest sum of contiguous subarray in the given array. */ function maxSubArraySum($a, $size) {","function maxSubArraySum($a, $size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'maxSubArraySum', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,PHP,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ function unionElements($test_tup1, $test_tup2) {","function unionElements($test_tup1, $test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'unionElements', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,PHP,Write a php function to find the maximum length of sublist.,"/** * Write a php function to find the maximum length of sublist. */ function findMaxLength($lst) {",function findMaxLength($lst) {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findMaxLength', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,PHP,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ function extractValues($text) {",function extractValues($text) {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'extractValues', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,PHP,Write a php function to count unequal element pairs from the given array.,"/** * Write a php function to count unequal element pairs from the given array. */ function countPairs($arr, $n) {","function countPairs($arr, $n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'countPairs', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,PHP,Write a php function to split a string into characters.,"/** * Write a php function to split a string into characters. */ function split($word) {",function split($word) {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'split', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,PHP,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ function sumDigits($n) {",function sumDigits($n) {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'sumDigits', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,PHP,Write a function to check whether a specified list is sorted or not.,"/** * Write a function to check whether a specified list is sorted or not. */ function issortList($list1) {",function issortList($list1) {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'issortList', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,PHP,Write a function to sort each sublist of strings in a given list of lists.,"/** * Write a function to sort each sublist of strings in a given list of lists. */ function sortSublists($list1) {",function sortSublists($list1) {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'sortSublists', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,PHP,Write a function to remove words from a given list of strings containing a character or string.,"/** * Write a function to remove words from a given list of strings containing a character or string. */ function removeWords($list1, $charlist) {","function removeWords($list1, $charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'removeWords', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,PHP,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ function maxSumPairDiffLessthanK($arr, $n, $k) {","function maxSumPairDiffLessthanK($arr, $n, $k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,PHP,Write a php function to remove two duplicate numbers from a given number of lists.,"/** * Write a php function to remove two duplicate numbers from a given number of lists. */ function twoUniqueNums($nums) {",function twoUniqueNums($nums) {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'twoUniqueNums', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,PHP,Write a php function to calculate the product of the unique numbers of a given list.,"/** * Write a php function to calculate the product of the unique numbers of a given list. */ function uniqueProduct($list_data) {",function uniqueProduct($list_data) {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'uniqueProduct', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,PHP,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ function surfaceareaCylinder($r, $h) {","function surfaceareaCylinder($r, $h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,PHP,Write a php function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a php function to find nth number in a sequence which is not a multiple of a given number. */ function countNo($a, $n, $l, $r) {","function countNo($a, $n, $l, $r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'countNo', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,PHP,Write a php function to check whether an array is subarray of another or not.,"/** * Write a php function to check whether an array is subarray of another or not. */ function isSubArray($a, $b, $n, $m) {","function isSubArray($a, $b, $n, $m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'isSubArray', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,PHP,Write a php function to find the last digit in factorial of a given number.,"/** * Write a php function to find the last digit in factorial of a given number. */ function lastDigitFactorial($n) {",function lastDigitFactorial($n) {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'lastDigitFactorial', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,PHP,Write a function to interleave lists of the same length.,"/** * Write a function to interleave lists of the same length. */ function interleaveLists($list1, $list2, $list3) {","function interleaveLists($list1, $list2, $list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'interleaveLists', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,PHP,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ function findDissimilar($test_tup1, $test_tup2) {","function findDissimilar($test_tup1, $test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findDissimilar', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,PHP,Write a php function to find the surface area of the square pyramid.,"/** * Write a php function to find the surface area of the square pyramid. */ function surfaceArea($b, $s) {","function surfaceArea($b, $s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'surfaceArea', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,PHP,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ function catalanNumber($num) {",function catalanNumber($num) {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'catalanNumber', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,PHP,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ function findAdverbs($text) {",function findAdverbs($text) {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findAdverbs', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,PHP,Write a php function to split the array and add the first part to the end.,"/** * Write a php function to split the array and add the first part to the end. */ function splitArr($a, $n, $k) {","function splitArr($a, $n, $k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'splitArr', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,PHP,Write a function to convert a list to a tuple.,"/** * Write a function to convert a list to a tuple. */ function listTuple($listx) {",function listTuple($listx) {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'listTuple', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,PHP,Write a php function to find the difference between largest and smallest value in a given array.,"/** * Write a php function to find the difference between largest and smallest value in a given array. */ function bigDiff($nums) {",function bigDiff($nums) {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'bigDiff', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,PHP,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ function perfectSquares($a, $b) {","function perfectSquares($a, $b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'perfectSquares', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,PHP,Write a php function to interchange the first and last elements in a list.,"/** * Write a php function to interchange the first and last elements in a list. */ function swapList($newlist) {",function swapList($newlist) {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'swapList', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,PHP,Write a php function to find sum of product of binomial co-efficients.,"/** * Write a php function to find sum of product of binomial co-efficients. */ function sumOfProduct($n) {",function sumOfProduct($n) {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'sumOfProduct', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,PHP,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ function removezeroIp($ip) {",function removezeroIp($ip) {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'removezeroIp', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,PHP,Write a function to find the difference of first even and odd number of a given list.,"/** * Write a function to find the difference of first even and odd number of a given list. */ function diffEvenOdd($list1) {",function diffEvenOdd($list1) {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'diffEvenOdd', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,PHP,Write a function to find kth element from the given two sorted arrays.,"/** * Write a function to find kth element from the given two sorted arrays. */ function findKth($arr1, $arr2, $m, $n, $k) {","function findKth($arr1, $arr2, $m, $n, $k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'findKth', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,PHP,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ function armstrongNumber($number) {",function armstrongNumber($number) {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'armstrongNumber', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,PHP,Write a php function to check whether the given number is even or not using bitwise operator.,"/** * Write a php function to check whether the given number is even or not using bitwise operator. */ function isEven($n) {",function isEven($n) {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'php', 'entry_fn_name': 'isEven', 'test_code': '', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['php', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,Python,Write a python function to find minimum sum of factors of a given number.,"def find_min_sum(num): """"""Write a python function to find minimum sum of factors of a given number. """"""",def find_min_sum(num):,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_min_sum', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find minimum sum of factors of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(num, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n num),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(12, 7)\n print(f""TEST-0...{result}"")\n\n result = driver(105, 15)\n print(f""TEST-1...{result}"")\n\n result = driver(2, 2)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,Python,Write a function to find the summation of tuple elements in the given tuple list.,"def sum_elements(test_tup): """"""Write a function to find the summation of tuple elements in the given tuple list. """"""",def sum_elements(test_tup):,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'sum_elements', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the summation of tuple elements in the given tuple list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(test_tup, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n test_tup),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([7, 8, 9, 1, 10, 7], 42)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4, 5, 6], 21)\n print(f""TEST-1...{result}"")\n\n result = driver([11, 12, 13, 45, 14], 95)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,Python,Write a function to check if there is a subset with sum divisible by m.,"def modular_sum(arr, n, m): """"""Write a function to check if there is a subset with sum divisible by m. """"""","def modular_sum(arr, n, m):","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'modular_sum', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if there is a subset with sum divisible by m.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, m, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n, m),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([3, 1, 7, 5], 4, 6, True)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 7], 2, 5, False)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 6], 2, 5, False)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,Python,Write a function to sort a list of elements using radix sort.,"def radix_sort(nums): """"""Write a function to sort a list of elements using radix sort. """"""",def radix_sort(nums):,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'radix_sort', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort a list of elements using radix sort.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(nums, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n nums),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([15, 79, 25, 68, 37], [15, 25, 37, 68, 79])\n print(f""TEST-0...{result}"")\n\n result = driver([9, 11, 8, 7, 3, 2], [2, 3, 7, 8, 9, 11])\n print(f""TEST-1...{result}"")\n\n result = driver([36, 12, 24, 26, 29], [12, 24, 26, 29, 36])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,Python,Write a python function to find the largest postive number from the given list.,"def largest_pos(list1): """"""Write a python function to find the largest postive number from the given list. """"""",def largest_pos(list1):,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'largest_pos', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the largest postive number from the given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 4, -1], 4)\n print(f""TEST-0...{result}"")\n\n result = driver([0, 1, 2, -5, -1, 6], 6)\n print(f""TEST-1...{result}"")\n\n result = driver([0, 0, 1, 0], 1)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,Python,Write a function to find the square root of a perfect number.,"def sqrt_root(num): """"""Write a function to find the square root of a perfect number. """"""",def sqrt_root(num):,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'sqrt_root', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the square root of a perfect number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(num, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n num),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(4, 2)\n print(f""TEST-0...{result}"")\n\n result = driver(16, 4)\n print(f""TEST-1...{result}"")\n\n result = driver(400, 20)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,Python,Write a function to calculate volume of a tetrahedron.,"def volume_tetrahedron(num): """"""Write a function to calculate volume of a tetrahedron. """"""",def volume_tetrahedron(num):,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'volume_tetrahedron', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to calculate volume of a tetrahedron.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return abs(actual - expected) < 1e-06\n\ndef driver(num, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n num),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(10, 117.85)\n print(f""TEST-0...{result}"")\n\n result = driver(15, 397.75)\n print(f""TEST-1...{result}"")\n\n result = driver(20, 942.81)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,Python,Write a function to find the lcm of the given list elements.,"def get_lcm(l): """"""Write a function to find the lcm of the given list elements. """"""",def get_lcm(l):,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'get_lcm', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the lcm of the given array elements.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(l, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n l),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([2, 7, 3, 9, 4], 252)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 8, 3], 24)\n print(f""TEST-1...{result}"")\n\n result = driver([3, 8, 4, 10, 5], 120)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,Python,Write a function to print check if the triangle is scalene or not.,"def check_isosceles(x, y, z): """"""Write a function to print check if the triangle is scalene or not. """"""","def check_isosceles(x, y, z):","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'check_isosceles', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to print check if the triangle is scalene or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(x, y, z, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n x, y, z),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(6, 8, 12, True)\n print(f""TEST-0...{result}"")\n\n result = driver(6, 6, 12, False)\n print(f""TEST-1...{result}"")\n\n result = driver(6, 15, 20, True)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,Python,Write a function to find the longest bitonic subsequence for the given list.,"def lbs(arr): """"""Write a function to find the longest bitonic subsequence for the given list. """"""",def lbs(arr):,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'lbs', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the longest bitonic subsequence for the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], 7)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 11, 2, 10, 4, 5, 2, 1], 6)\n print(f""TEST-1...{result}"")\n\n result = driver([80, 60, 30, 40, 20, 10], 5)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,Python,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","def check_string(str1): """"""Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. """"""",def check_string(str1):,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'check_string', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(str1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n str1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""python"", [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""])\n print(f""TEST-0...{result}"")\n\n result = driver(""123python"", [""String must have 1 upper case character.""])\n print(f""TEST-1...{result}"")\n\n result = driver(""123Python"", [""Valid string.""])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,Python,Write a function to find the sum of maximum increasing subsequence of the given list.,"def max_sum_increasing_subsequence(arr, n): """"""Write a function to find the sum of maximum increasing subsequence of the given list. """"""","def max_sum_increasing_subsequence(arr, n):","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'max_sum_increasing_subsequence', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the sum of maximum increasing subsequence of the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 101, 2, 3, 100, 4, 5], 7, 106)\n print(f""TEST-0...{result}"")\n\n result = driver([3, 4, 5, 10], 4, 22)\n print(f""TEST-1...{result}"")\n\n result = driver([10, 5, 4, 3], 4, 10)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,Python,Write a python function to check whether two given lines are parallel or not.,"def parallel_lines(line1, line2): """"""Write a python function to check whether two given lines are parallel or not. """"""","def parallel_lines(line1, line2):","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'parallel_lines', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether two given lines are parallel or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(line1, line2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n line1, line2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([2, 3, 4], [2, 3, 8], True)\n print(f""TEST-0...{result}"")\n\n result = driver([2, 3, 4], [4, -3, 8], False)\n print(f""TEST-1...{result}"")\n\n result = driver([3, 3], [5, 5], True)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,Python,Write a python function to capitalize first and last letters of each word of a given string.,"def capitalize_first_last_letters(str1): """"""Write a python function to capitalize first and last letters of each word of a given string. """"""",def capitalize_first_last_letters(str1):,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'capitalize_first_last_letters', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to capitalize first and last letters of each word of a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(str1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n str1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""python"", ""PythoN"")\n print(f""TEST-0...{result}"")\n\n result = driver(""bigdata"", ""BigdatA"")\n print(f""TEST-1...{result}"")\n\n result = driver(""Hadoop"", ""HadooP"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,Python,Write a function to find all pairs in an integer list whose sum is equal to a given number.,"def get_pairs_count(arr, n, sum): """"""Write a function to find all pairs in an integer list whose sum is equal to a given number. """"""","def get_pairs_count(arr, n, sum):","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'get_pairs_count', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all pairs in an integer array whose sum is equal to a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, sum, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n, sum),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 5, 7, -1, 5], 5, 6, 3)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 5, 7, -1], 4, 6, 2)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 1, 1, 1], 4, 2, 6)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,Python,Write a function to find the nth jacobsthal-lucas number.,"def jacobsthal_lucas(n): """"""Write a function to find the nth jacobsthal-lucas number. """"""",def jacobsthal_lucas(n):,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'jacobsthal_lucas', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the nth jacobsthal-lucas number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(5, 31)\n print(f""TEST-0...{result}"")\n\n result = driver(2, 5)\n print(f""TEST-1...{result}"")\n\n result = driver(4, 17)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,Python,Write a function to find the ration of negative numbers in list of integers.,"def negative_count(nums): """"""Write a function to find the ration of negative numbers in list of integers. """"""",def negative_count(nums):,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'negative_count', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the ration of negative numbers in an array of integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return abs(actual - expected) < 1e-06\n\ndef driver(nums, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n nums),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], 0.31)\n print(f""TEST-0...{result}"")\n\n result = driver([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8], 0.31)\n print(f""TEST-1...{result}"")\n\n result = driver([2, 4, -6, -9, 11, -12, 14, -5, 17], 0.44)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,Python,Write a function to find minimum number of coins that make a given value.,"def min_coins(coins, m, v): """"""Write a function to find minimum number of coins that make a given value. """"""","def min_coins(coins, m, v):","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'min_coins', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find minimum number of coins that make a given value.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(coins, m, v, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n coins, m, v),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([9, 6, 5, 1], 4, 11, 2)\n print(f""TEST-0...{result}"")\n\n result = driver([4, 5, 6, 7, 8, 9], 6, 9, 1)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3], 3, 4, 2)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,Python,Write a function to check if the two given strings are permutations of each other.,"def check_permutation(str1, str2): """"""Write a function to check if the two given strings are permutations of each other. """"""","def check_permutation(str1, str2):","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'check_permutation', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if the two given strings are permutations of each other.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(str1, str2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n str1, str2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""abc"", ""cba"", True)\n print(f""TEST-0...{result}"")\n\n result = driver(""test"", ""ttew"", False)\n print(f""TEST-1...{result}"")\n\n result = driver(""xxyz"", ""yxzx"", True)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,Python,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"def search_literal(pattern, text): """"""Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. """"""","def search_literal(pattern, text):","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'search_literal', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(pattern, text, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n pattern, text),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""python"", ""python programming language"", [0, 6])\n print(f""TEST-0...{result}"")\n\n result = driver(""programming"", ""python programming language"", [7, 18])\n print(f""TEST-1...{result}"")\n\n result = driver(""language"", ""python programming language"", [19, 27])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,Python,Write a function to find the top or bottom surface area of a cylinder.,"def topbottom_surfacearea(r): """"""Write a function to find the top or bottom surface area of a cylinder. """"""",def topbottom_surfacearea(r):,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'topbottom_surfacearea', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the top or bottom surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return abs(actual - expected) < 1e-09\n\ndef driver(r, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n r),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(10, 314.15000000000003)\n print(f""TEST-0...{result}"")\n\n result = driver(5, 78.53750000000001)\n print(f""TEST-1...{result}"")\n\n result = driver(4, 50.264)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,Python,Write a function to select the nth items of a list.,"def nth_items(list, n): """"""Write a function to select the nth items of a list. """"""","def nth_items(list, n):","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'nth_items', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to select the nth items of a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, [1, 3, 5, 7, 9])\n print(f""TEST-0...{result}"")\n\n result = driver([10, 15, 19, 17, 16, 18], 3, [10, 17])\n print(f""TEST-1...{result}"")\n\n result = driver([14, 16, 19, 15, 17], 4, [14, 17])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,Python,Write a python function to find the first repeated word in a given string.,"def first_repeated_word(str1): """"""Write a python function to find the first repeated word in a given string. """"""",def first_repeated_word(str1):,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'first_repeated_word', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the first repeated word in a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(str1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n str1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""ab ca bc ab"", ""ab"")\n print(f""TEST-0...{result}"")\n\n result = driver(""ab ca bc"", ""None"")\n print(f""TEST-1...{result}"")\n\n result = driver(""ab ca bc ca ab bc"", ""ca"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,Python,Write a python function to convert a given string list to a tuple.,"def string_list_to_tuple(str1): """"""Write a python function to convert a given string list to a tuple. """"""",def string_list_to_tuple(str1):,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'string_list_to_tuple', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to convert a given string list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(str1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n str1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""python 3.0"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'])\n print(f""TEST-0...{result}"")\n\n result = driver(""bigdata"", [\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'])\n print(f""TEST-1...{result}"")\n\n result = driver(""language"", [\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,Python,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using dictionary function.,"def basesnum_coresspondingnum(bases_num, index): """"""Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using dictionary function. """"""","def basesnum_coresspondingnum(bases_num, index):","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'basesnum_coresspondingnum', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(bases_num, index, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n bases_num, index),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249])\n print(f""TEST-1...{result}"")\n\n result = driver([4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21], [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,Python,Write a python function to find the difference between highest and least frequencies in a given list.,"def find_diff(arr, n): """"""Write a python function to find the difference between highest and least frequencies in a given list. """"""","def find_diff(arr, n):","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_diff', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between highest and least frequencies in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10, 2)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 7, 9, 2, 3, 3, 1, 3, 3], 9, 3)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 1, 2], 4, 0)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,Python,Write a function to find if the given number is abundant or not.,"def check_abundant(n): """"""Write a function to find if the given number is abundant or not. """"""",def check_abundant(n):,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'check_abundant', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find if the given number is abundant or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(12, True)\n print(f""TEST-0...{result}"")\n\n result = driver(15, False)\n print(f""TEST-1...{result}"")\n\n result = driver(18, True)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,Python,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","def fill_spaces(text): """"""Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. """"""",def fill_spaces(text):,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'fill_spaces', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(text, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n text),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"")\n print(f""TEST-0...{result}"")\n\n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"")\n print(f""TEST-1...{result}"")\n\n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,Python,Write a function to add two numbers and print number of digits of sum.,"def count_digits(num1, num2): """"""Write a function to add two numbers and print number of digits of sum. """"""","def count_digits(num1, num2):","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'count_digits', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to add two numbers and print number of digits of sum.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(num1, num2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n num1, num2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(9875, 10, 4)\n print(f""TEST-0...{result}"")\n\n result = driver(98759853034, 100, 11)\n print(f""TEST-1...{result}"")\n\n result = driver(1234567, 500, 7)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,Python,Write a python function to toggle only first and last bits of a given number.,"def toggle_f_and_l_bits(n): """"""Write a python function to toggle only first and last bits of a given number. """"""",def toggle_f_and_l_bits(n):,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'toggle_f_and_l_bits', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to toggle only first and last bits of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(10, 3)\n print(f""TEST-0...{result}"")\n\n result = driver(15, 6)\n print(f""TEST-1...{result}"")\n\n result = driver(20, 5)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,Python,Write a function to find the last occurrence of a character in a string.,"def last_occurence_char(string_arg0, char_arg1): """"""Write a function to find the last occurrence of a character in a string. """"""","def last_occurence_char(string_arg0, char_arg1):","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'last_occurence_char', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the last occurrence of a character in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(string_arg0, char_arg1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n string_arg0, char_arg1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""hello world"", \'l\', 10)\n print(f""TEST-0...{result}"")\n\n result = driver(""language"", \'g\', 7)\n print(f""TEST-1...{result}"")\n\n result = driver(""little"", \'y\', None)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,Python,Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.,"def total_hamming_distance(n): """"""Write a python function to find the sum of hamming distances of all consecutive numbers from o to n. """"""",def total_hamming_distance(n):,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'total_hamming_distance', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(4, 7)\n print(f""TEST-0...{result}"")\n\n result = driver(2, 3)\n print(f""TEST-1...{result}"")\n\n result = driver(5, 8)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,Python,Write a function to find the length of the longest increasing subsequence of the given sequence.,"def longest_increasing_subsequence(arr): """"""Write a function to find the length of the longest increasing subsequence of the given sequence. """"""",def longest_increasing_subsequence(arr):,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'longest_increasing_subsequence', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the length of the longest increasing subsequence of the given sequence.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([10, 22, 9, 33, 21, 50, 41, 60], 5)\n print(f""TEST-0...{result}"")\n\n result = driver([3, 10, 2, 1, 20], 3)\n print(f""TEST-1...{result}"")\n\n result = driver([50, 3, 10, 7, 40, 80], 4)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,Python,Write a python function to find the sum of fifth power of first n odd natural numbers.,"def odd_num_sum(n): """"""Write a python function to find the sum of fifth power of first n odd natural numbers. """"""",def odd_num_sum(n):,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'odd_num_sum', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of fifth power of first n odd natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(1, 1)\n print(f""TEST-0...{result}"")\n\n result = driver(2, 244)\n print(f""TEST-1...{result}"")\n\n result = driver(3, 3369)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,Python,Write a python function to find the maximum element in a sorted and rotated list.,"def find_max(arr, low, high): """"""Write a python function to find the maximum element in a sorted and rotated list. """"""","def find_max(arr, low, high):","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_max', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum element in a sorted and rotated array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, low, high, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, low, high),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([2, 3, 5, 6, 9], 0, 4, 9)\n print(f""TEST-0...{result}"")\n\n result = driver([3, 4, 5, 2, 1], 0, 4, 5)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3], 0, 2, 3)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,Python,Write a function to extract a specified column from a given nested list.,"def extract_column(list1, n): """"""Write a function to extract a specified column from a given nested list. """"""","def extract_column(list1, n):","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'extract_column', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract a specified column from a given nested list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0, [1, 2, 1])\n print(f""TEST-0...{result}"")\n\n result = driver([[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2, [3, -5, 1])\n print(f""TEST-1...{result}"")\n\n result = driver([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0, [1, 5, 1, 13, 5, 9])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,Python,Write a python function to check whether a given sequence is linear or not.,"def seq_linear(seq_nums): """"""Write a python function to check whether a given sequence is linear or not. """"""",def seq_linear(seq_nums):,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'seq_linear', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether a given sequence is linear or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(seq_nums, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n seq_nums),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([0, 2, 4, 6, 8, 10], ""Linear Sequence"")\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3], ""Linear Sequence"")\n print(f""TEST-1...{result}"")\n\n result = driver([1, 5, 2], ""Non Linear Sequence"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,Python,Write a function to convert the given tuple to a floating-point number.,"def tuple_to_float(test_tup): """"""Write a function to convert the given tuple to a floating-point number. """"""",def tuple_to_float(test_tup):,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'tuple_to_float', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert the given tuple to a floating-point number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return abs(actual - expected) < 1e-06\n\ndef driver(test_tup, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n test_tup),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([4, 56], 4.56)\n print(f""TEST-0...{result}"")\n\n result = driver([7, 256], 7.256)\n print(f""TEST-1...{result}"")\n\n result = driver([8, 123], 8.123)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,Python,Write a python function to find odd numbers from a mixed list.,"def split(list): """"""Write a python function to find odd numbers from a mixed list. """"""",def split(list):,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'split', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find odd numbers from a mixed list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 4, 5, 6], [1, 3, 5])\n print(f""TEST-0...{result}"")\n\n result = driver([10, 11, 12, 13], [11, 13])\n print(f""TEST-1...{result}"")\n\n result = driver([7, 8, 9, 1], [7, 9, 1])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,Python,Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"def difference(n): """"""Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. """"""",def difference(n):,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'difference', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(3, 30)\n print(f""TEST-0...{result}"")\n\n result = driver(5, 210)\n print(f""TEST-1...{result}"")\n\n result = driver(2, 6)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,Python,Write a python function to count the pairs with xor as an odd number.,"def find_odd_pair(a, n): """"""Write a python function to count the pairs with xor as an odd number. """"""","def find_odd_pair(a, n):","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_odd_pair', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count the pairs with xor as an odd number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([5, 4, 7, 2, 1], 5, 6)\n print(f""TEST-0...{result}"")\n\n result = driver([7, 2, 8, 1, 0, 5, 11], 7, 12)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3], 3, 2)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,Python,Write a function to toggle characters case in a string.,"def toggle_string(string_arg0): """"""Write a function to toggle characters case in a string. """"""",def toggle_string(string_arg0):,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'toggle_string', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to toggle characters case in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(string_arg0, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n string_arg0),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""Python"", ""pYTHON"")\n print(f""TEST-0...{result}"")\n\n result = driver(""Pangram"", ""pANGRAM"")\n print(f""TEST-1...{result}"")\n\n result = driver(""LIttLE"", ""liTTle"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,Python,Write a python function to find the digit distance between two integers.,"def digit_distance_nums(n1, n2): """"""Write a python function to find the digit distance between two integers. """"""","def digit_distance_nums(n1, n2):","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'digit_distance_nums', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the digit distance between two integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n1, n2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n1, n2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(1, 2, 1)\n print(f""TEST-0...{result}"")\n\n result = driver(23, 56, 6)\n print(f""TEST-1...{result}"")\n\n result = driver(123, 256, 7)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,Python,Write a function to find the largest sum of contiguous subarray in the given list.,"def max_sub_array_sum(a, size): """"""Write a function to find the largest sum of contiguous subarray in the given list. """"""","def max_sub_array_sum(a, size):","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'max_sub_array_sum', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the largest sum of contiguous subarray in the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, size, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, size),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([-2, -3, 4, -1, -2, 1, 5, -3], 8, 7)\n print(f""TEST-0...{result}"")\n\n result = driver([-3, -4, 5, -2, -3, 2, 6, -4], 8, 8)\n print(f""TEST-1...{result}"")\n\n result = driver([-4, -5, 6, -3, -4, 3, 7, -5], 8, 10)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,Python,Write a function to find the union of elements of the given tuples.,"def union_elements(test_tup1, test_tup2): """"""Write a function to find the union of elements of the given tuples. """"""","def union_elements(test_tup1, test_tup2):","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'union_elements', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the union of elements of the given tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(test_tup1, test_tup2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n test_tup1, test_tup2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 4, 5, 6, 7, 10])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4], [3, 4, 5, 6], [1, 2, 3, 4, 5, 6])\n print(f""TEST-1...{result}"")\n\n result = driver([11, 12, 13, 14], [13, 15, 16, 17], [11, 12, 13, 14, 15, 16, 17])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,Python,Write a python function to find the maximum length of sublist.,"def find_max_length(lst): """"""Write a python function to find the maximum length of sublist. """"""",def find_max_length(lst):,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_max_length', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum length of sublist.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(lst, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n lst),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([[1], [1, 4], [5, 6, 7, 8]], 4)\n print(f""TEST-0...{result}"")\n\n result = driver([[0, 1], [2, 2], [3, 2, 1]], 3)\n print(f""TEST-1...{result}"")\n\n result = driver([[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]], 5)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,Python,Write a function to extract values between quotation marks of a string.,"def extract_values(text): """"""Write a function to extract values between quotation marks of a string. """"""",def extract_values(text):,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'extract_values', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract values between quotation marks of a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(text, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n text),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", [""Python"", ""PHP"", ""Java""])\n print(f""TEST-0...{result}"")\n\n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", [""python"", ""program"", ""language""])\n print(f""TEST-1...{result}"")\n\n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", [""red"", ""blue"", ""green"", ""yellow""])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,Python,Write a python function to count unequal element pairs from the given list.,"def count_pairs(arr, n): """"""Write a python function to count unequal element pairs from the given list. """"""","def count_pairs(arr, n):","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'count_pairs', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count unequal element pairs from the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 1], 3, 2)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 1, 1, 1], 4, 0)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3, 4, 5], 5, 10)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,Python,Write a python function to split a string into characters.,"def split(word): """"""Write a python function to split a string into characters. """"""",def split(word):,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'split', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split a string into characters.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(word, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n word),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""python"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'])\n print(f""TEST-0...{result}"")\n\n result = driver(""Name"", [\'N\', \'a\', \'m\', \'e\'])\n print(f""TEST-1...{result}"")\n\n result = driver(""program"", [\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,Python,Write a function to get the sum of a non-negative integer.,"def sum_digits(n): """"""Write a function to get the sum of a non-negative integer. """"""",def sum_digits(n):,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'sum_digits', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to get the sum of a non-negative integer.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(345, 12)\n print(f""TEST-0...{result}"")\n\n result = driver(12, 3)\n print(f""TEST-1...{result}"")\n\n result = driver(97, 16)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,Python,Write a function to check whether a specified list is sorted or not.,"def issort_list(list1): """"""Write a function to check whether a specified list is sorted or not. """"""",def issort_list(list1):,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'issort_list', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a specified list is sorted or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 16, 17], True)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 20, 17], False)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 4, 6, 8, 10, 15, 14, 20], False)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,Python,Write a function to sort each sublist of strings in a given list of lists.,"def sort_sublists(list1): """"""Write a function to sort each sublist of strings in a given list of lists. """"""",def sort_sublists(list1):,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'sort_sublists', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort each sublist of strings in a given list of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]], [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]])\n print(f""TEST-0...{result}"")\n\n result = driver([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]])\n print(f""TEST-1...{result}"")\n\n result = driver([[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]], [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,Python,Write a function to remove words from a given list of strings containing a character or string.,"def remove_words(list1, charlist): """"""Write a function to remove words from a given list of strings containing a character or string. """"""","def remove_words(list1, charlist):","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'remove_words', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove words from a given list of strings containing a character or string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, charlist, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1, charlist),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], [""#"", ""color"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""])\n print(f""TEST-0...{result}"")\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""&"", ""+"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""])\n print(f""TEST-1...{result}"")\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""@""], [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,Python,Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k.,"def max_sum_pair_diff_lessthan_k(arr, n, k): """"""Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k. """"""","def max_sum_pair_diff_lessthan_k(arr, n, k):","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'max_sum_pair_diff_lessthan_k', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr, n, k, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr, n, k),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([3, 5, 10, 15, 17, 12, 9], 7, 4, 62)\n print(f""TEST-0...{result}"")\n\n result = driver([5, 15, 10, 300], 4, 12, 25)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3, 4, 5, 6], 6, 6, 21)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,Python,Write a python function to remove two duplicate numbers from a given number of lists.,"def two_unique_nums(nums): """"""Write a python function to remove two duplicate numbers from a given number of lists. """"""",def two_unique_nums(nums):,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'two_unique_nums', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to remove two duplicate numbers from a given number of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(nums, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n nums),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 2, 3, 4, 5], [1, 4, 5])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 2, 4, 5], [1, 3, 4, 5])\n print(f""TEST-1...{result}"")\n\n result = driver([1, 2, 3, 4, 5], [1, 2, 3, 4, 5])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,Python,Write a python function to calculate the product of the unique numbers of a given list.,"def unique_product(list_data): """"""Write a python function to calculate the product of the unique numbers of a given list. """"""",def unique_product(list_data):,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'unique_product', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to calculate the product of the unique numbers of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list_data, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list_data),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([10, 20, 30, 40, 20, 50, 60, 40], 720000000)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 1], 6)\n print(f""TEST-1...{result}"")\n\n result = driver([7, 8, 9, 0, 1, 1], 0)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,Python,Write a function to find the surface area of a cylinder.,"def surfacearea_cylinder(r, h): """"""Write a function to find the surface area of a cylinder. """"""","def surfacearea_cylinder(r, h):","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'surfacearea_cylinder', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return abs(actual - expected) < 1e-09\n\ndef driver(r, h, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n r, h),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(10, 5, 942.45)\n print(f""TEST-0...{result}"")\n\n result = driver(4, 5, 226.18800000000002)\n print(f""TEST-1...{result}"")\n\n result = driver(4, 10, 351.848)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,Python,Write a python function to find nth number in a sequence which is not a multiple of a given number.,"def count_no(a, n, l, r): """"""Write a python function to find nth number in a sequence which is not a multiple of a given number. """"""","def count_no(a, n, l, r):","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'count_no', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find nth number in a sequence which is not a multiple of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, n, l, r, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, n, l, r),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(2, 3, 1, 10, 5)\n print(f""TEST-0...{result}"")\n\n result = driver(3, 6, 4, 20, 11)\n print(f""TEST-1...{result}"")\n\n result = driver(5, 10, 4, 20, 16)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,Python,Write a python function to check whether list is subarray of another or not.,"def is_sub_array(a, b, n, m): """"""Write a python function to check whether list is subarray of another or not. """"""","def is_sub_array(a, b, n, m):","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'is_sub_array', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether an array is subarray of another or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, b, n, m, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, b, n, m),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 4, 3, 5], [1, 2], 4, 2, False)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 1], [1, 2, 1], 3, 3, True)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 0, 2, 2], [2, 2, 0], 4, 3, False)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,Python,Write a python function to find the last digit in factorial of a given number.,"def last_digit_factorial(n): """"""Write a python function to find the last digit in factorial of a given number. """"""",def last_digit_factorial(n):,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'last_digit_factorial', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the last digit in factorial of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(4, 4)\n print(f""TEST-0...{result}"")\n\n result = driver(21, 0)\n print(f""TEST-1...{result}"")\n\n result = driver(30, 0)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,Python,Write a function to interleave lists of the same length.,"def interleave_lists(list1, list2, list3): """"""Write a function to interleave lists of the same length. """"""","def interleave_lists(list1, list2, list3):","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'interleave_lists', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to interleave lists of the same length.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, list2, list3, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1, list2, list3),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700], [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700])\n print(f""TEST-0...{result}"")\n\n result = driver([10, 20], [15, 2], [5, 10], [10, 15, 5, 20, 2, 10])\n print(f""TEST-1...{result}"")\n\n result = driver([11, 44], [10, 15], [20, 5], [11, 10, 20, 44, 15, 5])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,Python,Write a function to find the dissimilar elements in the given two tuples.,"def find_dissimilar(test_tup1, test_tup2): """"""Write a function to find the dissimilar elements in the given two tuples. """"""","def find_dissimilar(test_tup1, test_tup2):","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_dissimilar', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the dissimilar elements in the given two tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(test_tup1, test_tup2, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n test_tup1, test_tup2),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 6, 7, 10])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4], [7, 2, 3, 9], [1, 4, 7, 9])\n print(f""TEST-1...{result}"")\n\n result = driver([21, 11, 25, 26], [26, 34, 21, 36], [34, 36, 11, 25])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,Python,Write a python function to find the surface area of the square pyramid.,"def surface_area(b, s): """"""Write a python function to find the surface area of the square pyramid. """"""","def surface_area(b, s):","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'surface_area', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the surface area of the square pyramid.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(b, s, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n b, s),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(3, 4, 33)\n print(f""TEST-0...{result}"")\n\n result = driver(4, 5, 56)\n print(f""TEST-1...{result}"")\n\n result = driver(1, 2, 5)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,Python,Write a function for nth catalan number.,"def catalan_number(num): """"""Write a function for nth catalan number. """"""",def catalan_number(num):,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'catalan_number', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function for nth catalan number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(num, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n num),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(10, 16796)\n print(f""TEST-0...{result}"")\n\n result = driver(9, 4862)\n print(f""TEST-1...{result}"")\n\n result = driver(7, 429)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,Python,Write a function to find all adverbs and their positions in a given sentence by using regex.,"def find_adverbs(text): """"""Write a function to find all adverbs and their positions in a given sentence by using regex. """"""",def find_adverbs(text):,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_adverbs', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all adverbs and their positions in a given sentence by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(text, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n text),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"")\n print(f""TEST-0...{result}"")\n\n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"")\n print(f""TEST-1...{result}"")\n\n result = driver(""Complete the task quickly"", ""18-25: quickly"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,Python,Write a python function to split the list and add the first part to the end.,"def split_arr(a, n, k): """"""Write a python function to split the list and add the first part to the end. """"""","def split_arr(a, n, k):","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'split_arr', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split the array and add the first part to the end.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, n, k, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, n, k),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([12, 10, 5, 6, 52, 36], 6, 2, [5, 6, 52, 36, 12, 10])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4], 4, 1, [2, 3, 4, 1])\n print(f""TEST-1...{result}"")\n\n result = driver([0, 1, 2, 3, 4, 5, 6, 7], 8, 3, [3, 4, 5, 6, 7, 0, 1, 2])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,Python,Write a function to convert a list to a tuple.,"def list_tuple(listx): """"""Write a function to convert a list to a tuple. """"""",def list_tuple(listx):,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'list_tuple', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert a list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(listx, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n listx),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([5, 10, 7, 4, 15, 3], [5, 10, 7, 4, 15, 3])\n print(f""TEST-0...{result}"")\n\n result = driver([2, 4, 5, 6, 2, 3, 4, 4, 7], [2, 4, 5, 6, 2, 3, 4, 4, 7])\n print(f""TEST-1...{result}"")\n\n result = driver([58, 44, 56], [58, 44, 56])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,Python,Write a python function to find the difference between largest and smallest value in a given list.,"def big_diff(nums): """"""Write a python function to find the difference between largest and smallest value in a given list. """"""",def big_diff(nums):,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'big_diff', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between largest and smallest value in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(nums, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n nums),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 2, 3, 4], 3)\n print(f""TEST-0...{result}"")\n\n result = driver([4, 5, 12], 8)\n print(f""TEST-1...{result}"")\n\n result = driver([9, 2, 3], 7)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,Python,Write a function to find perfect squares between two given numbers.,"def perfect_squares(a, b): """"""Write a function to find perfect squares between two given numbers. """"""","def perfect_squares(a, b):","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'perfect_squares', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find perfect squares between two given numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(a, b, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n a, b),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(1, 30, [1, 4, 9, 16, 25])\n print(f""TEST-0...{result}"")\n\n result = driver(50, 100, [64, 81, 100])\n print(f""TEST-1...{result}"")\n\n result = driver(100, 200, [100, 121, 144, 169, 196])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,Python,Write a python function to interchange the first and last elements in a list.,"def swap_list(newlist): """"""Write a python function to interchange the first and last elements in a list. """"""",def swap_list(newlist):,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'swap_list', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to interchange the first and last elements in a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(newlist, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n newlist),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([12, 35, 9, 56, 24], [24, 35, 9, 56, 12])\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3], [3, 2, 1])\n print(f""TEST-1...{result}"")\n\n result = driver([4, 5, 6], [6, 5, 4])\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,Python,Write a python function to find sum of product of binomial co-efficients.,"def sum_of_product(n): """"""Write a python function to find sum of product of binomial co-efficients. """"""",def sum_of_product(n):,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'sum_of_product', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find sum of product of binomial co-efficients.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(3, 15)\n print(f""TEST-0...{result}"")\n\n result = driver(4, 56)\n print(f""TEST-1...{result}"")\n\n result = driver(1, 1)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,Python,Write a function to remove leading zeroes from an ip address.,"def removezero_ip(ip): """"""Write a function to remove leading zeroes from an ip address. """"""",def removezero_ip(ip):,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'removezero_ip', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove leading zeroes from an ip address.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(ip, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n ip),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(""216.08.094.196"", ""216.8.94.196"")\n print(f""TEST-0...{result}"")\n\n result = driver(""12.01.024"", ""12.1.24"")\n print(f""TEST-1...{result}"")\n\n result = driver(""216.08.094.0196"", ""216.8.94.196"")\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,Python,Write a function to find the difference of first even and odd number of a given list.,"def diff_even_odd(list1): """"""Write a function to find the difference of first even and odd number of a given list. """"""",def diff_even_odd(list1):,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'diff_even_odd', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the difference of first even and odd number of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(list1, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n list1),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([1, 3, 5, 7, 4, 1, 6, 8], 3)\n print(f""TEST-0...{result}"")\n\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1)\n print(f""TEST-1...{result}"")\n\n result = driver([1, 5, 7, 9, 10], 9)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,Python,Write a function to find kth element from the given two sorted lists.,"def find_kth(arr1, arr2, m, n, k): """"""Write a function to find kth element from the given two sorted lists. """"""","def find_kth(arr1, arr2, m, n, k):","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'find_kth', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find kth element from the given two sorted arrays.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(arr1, arr2, m, n, k, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n arr1, arr2, m, n, k),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver([2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5, 6)\n print(f""TEST-0...{result}"")\n\n result = driver([100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7, 256)\n print(f""TEST-1...{result}"")\n\n result = driver([3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6, 8)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,Python,Write a function to check whether the given number is armstrong or not.,"def armstrong_number(number): """"""Write a function to check whether the given number is armstrong or not. """"""",def armstrong_number(number):,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'armstrong_number', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether the given number is armstrong or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(number, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n number),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(153, True)\n print(f""TEST-0...{result}"")\n\n result = driver(259, False)\n print(f""TEST-1...{result}"")\n\n result = driver(4458, False)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,Python,Write a python function to check whether the given number is even or not using bitwise operator.,"def is_even(n): """"""Write a python function to check whether the given number is even or not using bitwise operator. """"""",def is_even(n):,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'py', 'entry_fn_name': 'is_even', 'test_code': 'import array\nimport bisect\nimport collections\nimport datetime\nimport functools\nimport heapq\nimport itertools\nimport math\nimport queue\nimport re\nimport string\nimport sys\nfrom typing import Any, Dict, List, Optional, Set\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether the given number is even or not using bitwise operator.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\ndef validate_solution(actual, expected):\n return actual == expected\n\ndef driver(n, expected):\n try:\n if validate_solution(PLACEHOLDER_FN_NAME(\n n),\n expected\n ):\n return ""PASSED""\n return ""FAILED""\n except Exception as exception_obj:\n return type(exception_obj).__name__\n \nif __name__ == ""__main__"":\n result = driver(1, False)\n print(f""TEST-0...{result}"")\n\n result = driver(2, True)\n print(f""TEST-1...{result}"")\n\n result = driver(3, False)\n print(f""TEST-2...{result}"")\n\n sys.exit(0)', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['python', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,R,Write a r function to find minimum sum of factors of a given number.,"# Write a r function to find minimum sum of factors of a given number. find_min_sum <- function(num) {",find_min_sum <- function(num) {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_min_sum', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find minimum sum of factors of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(num, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(num), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 12L, \n 7L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 105L, \n 15L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 2L, \n 2L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 514,MBPP/514,R,Write a function to find the summation of tuple elements in the given tuple list.,"# Write a function to find the summation of tuple elements in the given tuple list. sum_elements <- function(test_tup) {",sum_elements <- function(test_tup) {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'sum_elements', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the summation of tuple elements in the given tuple list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(test_tup, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(7L, 8L, 9L, 1L, 10L, 7L), \n 42L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L), \n 21L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(11L, 12L, 13L, 45L, 14L), \n 95L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 515,MBPP/515,R,Write a function to check if there is a subset with sum divisible by m.,"# Write a function to check if there is a subset with sum divisible by m. modular_sum <- function(arr, n, m) {","modular_sum <- function(arr, n, m) {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'modular_sum', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if there is a subset with sum divisible by m.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, m, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n, m), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(3L, 1L, 7L, 5L), 4L, 6L, \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 7L), 2L, 5L, \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 6L), 2L, 5L, \n FALSE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 516,MBPP/516,R,Write a function to sort a list of elements using radix sort.,"# Write a function to sort a list of elements using radix sort. radix_sort <- function(nums) {",radix_sort <- function(nums) {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'radix_sort', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort a list of elements using radix sort.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(nums, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(nums), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(15L, 79L, 25L, 68L, 37L), \n list(15L, 25L, 37L, 68L, 79L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(9L, 11L, 8L, 7L, 3L, 2L), \n list(2L, 3L, 7L, 8L, 9L, 11L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(36L, 12L, 24L, 26L, 29L), \n list(12L, 24L, 26L, 29L, 36L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 517,MBPP/517,R,Write a r function to find the largest postive number from the given list.,"# Write a r function to find the largest postive number from the given list. largest_pos <- function(list1) {",largest_pos <- function(list1) {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'largest_pos', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the largest postive number from the given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, -1L), \n 4L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(0L, 1L, 2L, -5L, -1L, 6L), \n 6L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(0L, 0L, 1L, 0L), \n 1L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 518,MBPP/518,R,Write a function to find the square root of a perfect number.,"# Write a function to find the square root of a perfect number. sqrt_root <- function(num) {",sqrt_root <- function(num) {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'sqrt_root', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the square root of a perfect number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(num, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(num), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 4L, \n 2L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 16L, \n 4L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 400L, \n 20L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 519,MBPP/519,R,Write a function to calculate volume of a tetrahedron.,"# Write a function to calculate volume of a tetrahedron. volume_tetrahedron <- function(num) {",volume_tetrahedron <- function(num) {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'volume_tetrahedron', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to calculate volume of a tetrahedron.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n abs(actual - expected) < 1e-06\n}\n\ndriver <- function(num, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(num), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 10L, \n 117.85\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 15L, \n 397.75\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 20L, \n 942.81\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 520,MBPP/520,R,Write a function to find the lcm of the given list elements.,"# Write a function to find the lcm of the given list elements. get_lcm <- function(l) {",get_lcm <- function(l) {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'get_lcm', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the lcm of the given array elements.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(l, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(l), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(2L, 7L, 3L, 9L, 4L), \n 252L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 8L, 3L), \n 24L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(3L, 8L, 4L, 10L, 5L), \n 120L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 521,MBPP/521,R,Write a function to print check if the triangle is scalene or not.,"# Write a function to print check if the triangle is scalene or not. check_isosceles <- function(x, y, z) {","check_isosceles <- function(x, y, z) {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'check_isosceles', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to print check if the triangle is scalene or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(x, y, z, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(x, y, z), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 6L, 8L, 12L, \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 6L, 6L, 12L, \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 6L, 15L, 20L, \n TRUE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 522,MBPP/522,R,Write a function to find the longest bitonic subsequence for the given list.,"# Write a function to find the longest bitonic subsequence for the given list. lbs <- function(arr) {",lbs <- function(arr) {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'lbs', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the longest bitonic subsequence for the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(0L, 8L, 4L, 12L, 2L, 10L, 6L, 14L, 1L, 9L, 5L, 13L, 3L, 11L, 7L, 15L), \n 7L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 11L, 2L, 10L, 4L, 5L, 2L, 1L), \n 6L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(80L, 60L, 30L, 40L, 20L, 10L), \n 5L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 523,MBPP/523,R,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","# Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. check_string <- function(str1) {",check_string <- function(str1) {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'check_string', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(str1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(str1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""python"", \n list(""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8."")\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""123python"", \n list(""String must have 1 upper case character."")\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""123Python"", \n list(""Valid string."")\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 524,MBPP/524,R,Write a function to find the sum of maximum increasing subsequence of the given list.,"# Write a function to find the sum of maximum increasing subsequence of the given list. max_sum_increasing_subsequence <- function(arr, n) {","max_sum_increasing_subsequence <- function(arr, n) {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'max_sum_increasing_subsequence', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the sum of maximum increasing subsequence of the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 101L, 2L, 3L, 100L, 4L, 5L), 7L, \n 106L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(3L, 4L, 5L, 10L), 4L, \n 22L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(10L, 5L, 4L, 3L), 4L, \n 10L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 525,MBPP/525,R,Write a r function to check whether two given lines are parallel or not.,"# Write a r function to check whether two given lines are parallel or not. parallel_lines <- function(line1, line2) {","parallel_lines <- function(line1, line2) {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'parallel_lines', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether two given lines are parallel or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(line1, line2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(line1, line2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(2L, 3L, 4L), list(2L, 3L, 8L), \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(2L, 3L, 4L), list(4L, -3L, 8L), \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(3L, 3L), list(5L, 5L), \n TRUE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 526,MBPP/526,R,Write a r function to capitalize first and last letters of each word of a given string.,"# Write a r function to capitalize first and last letters of each word of a given string. capitalize_first_last_letters <- function(str1) {",capitalize_first_last_letters <- function(str1) {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'capitalize_first_last_letters', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to capitalize first and last letters of each word of a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(str1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(str1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""python"", \n ""PythoN""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""bigdata"", \n ""BigdatA""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""Hadoop"", \n ""HadooP""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 527,MBPP/527,R,Write a function to find all pairs in an integer list whose sum is equal to a given number.,"# Write a function to find all pairs in an integer list whose sum is equal to a given number. get_pairs_count <- function(arr, n, sum) {","get_pairs_count <- function(arr, n, sum) {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'get_pairs_count', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all pairs in an integer array whose sum is equal to a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, sum, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n, sum), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 5L, 7L, -1L, 5L), 5L, 6L, \n 3L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 5L, 7L, -1L), 4L, 6L, \n 2L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 1L, 1L, 1L), 4L, 2L, \n 6L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 529,MBPP/529,R,Write a function to find the nth jacobsthal-lucas number.,"# Write a function to find the nth jacobsthal-lucas number. jacobsthal_lucas <- function(n) {",jacobsthal_lucas <- function(n) {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'jacobsthal_lucas', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the nth jacobsthal-lucas number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 5L, \n 31L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 2L, \n 5L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 4L, \n 17L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 530,MBPP/530,R,Write a function to find the ration of negative numbers in list of integers.,"# Write a function to find the ration of negative numbers in list of integers. negative_count <- function(nums) {",negative_count <- function(nums) {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'negative_count', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the ration of negative numbers in an array of integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n abs(actual - expected) < 1e-06\n}\n\ndriver <- function(nums, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(nums), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(0L, 1L, 2L, -1L, -5L, 6L, 0L, -3L, -2L, 3L, 4L, 6L, 8L), \n 0.31\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(2L, 1L, 2L, -1L, -5L, 6L, 4L, -3L, -2L, 3L, 4L, 6L, 8L), \n 0.31\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(2L, 4L, -6L, -9L, 11L, -12L, 14L, -5L, 17L), \n 0.44\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 531,MBPP/531,R,Write a function to find minimum number of coins that make a given value.,"# Write a function to find minimum number of coins that make a given value. min_coins <- function(coins, m, v) {","min_coins <- function(coins, m, v) {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'min_coins', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find minimum number of coins that make a given value.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(coins, m, v, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(coins, m, v), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(9L, 6L, 5L, 1L), 4L, 11L, \n 2L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(4L, 5L, 6L, 7L, 8L, 9L), 6L, 9L, \n 1L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L), 3L, 4L, \n 2L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 532,MBPP/532,R,Write a function to check if the two given strings are permutations of each other.,"# Write a function to check if the two given strings are permutations of each other. check_permutation <- function(str1, str2) {","check_permutation <- function(str1, str2) {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'check_permutation', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check if the two given strings are permutations of each other.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(str1, str2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(str1, str2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""abc"", ""cba"", \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""test"", ""ttew"", \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""xxyz"", ""yxzx"", \n TRUE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 534,MBPP/534,R,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"# Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. search_literal <- function(pattern, text) {","search_literal <- function(pattern, text) {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'search_literal', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(pattern, text, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(pattern, text), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""python"", ""python programming language"", \n list(0L, 6L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""programming"", ""python programming language"", \n list(7L, 18L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""language"", ""python programming language"", \n list(19L, 27L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 535,MBPP/535,R,Write a function to find the top or bottom surface area of a cylinder.,"# Write a function to find the top or bottom surface area of a cylinder. topbottom_surfacearea <- function(r) {",topbottom_surfacearea <- function(r) {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'topbottom_surfacearea', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the top or bottom surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n abs(actual - expected) < 1e-09\n}\n\ndriver <- function(r, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(r), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 10L, \n 314.15000000000003\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 5L, \n 78.53750000000001\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 4L, \n 50.264\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 536,MBPP/536,R,Write a function to select the nth items of a list.,"# Write a function to select the nth items of a list. nth_items <- function(list, n) {","nth_items <- function(list, n) {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'nth_items', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to select the nth items of a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L), 2L, \n list(1L, 3L, 5L, 7L, 9L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(10L, 15L, 19L, 17L, 16L, 18L), 3L, \n list(10L, 17L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(14L, 16L, 19L, 15L, 17L), 4L, \n list(14L, 17L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 537,MBPP/537,R,Write a r function to find the first repeated word in a given string.,"# Write a r function to find the first repeated word in a given string. first_repeated_word <- function(str1) {",first_repeated_word <- function(str1) {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'first_repeated_word', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the first repeated word in a given string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(str1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(str1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""ab ca bc ab"", \n ""ab""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""ab ca bc"", \n ""None""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""ab ca bc ca ab bc"", \n ""ca""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 538,MBPP/538,R,Write a r function to convert a given string list to a tuple.,"# Write a r function to convert a given string list to a tuple. string_list_to_tuple <- function(str1) {",string_list_to_tuple <- function(str1) {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'string_list_to_tuple', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to convert a given string list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(str1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(str1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""python 3.0"", \n list(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\')\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""bigdata"", \n list(\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\')\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""language"", \n list(\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\')\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 539,MBPP/539,R,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.,"# Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function. basesnum_coresspondingnum <- function(bases_num, index) {","basesnum_coresspondingnum <- function(bases_num, index) {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'basesnum_coresspondingnum', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(bases_num, index, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(bases_num, index), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(10L, 20L, 30L, 40L, 50L, 60L, 70L, 80L, 90L, 100L), list(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), \n list(10L, 400L, 27000L, 2560000L, 312500000L, 46656000000L, 8235430000000L, 1677721600000000L, 387420489000000000L, 100000000000000000000L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L, 7L), list(10L, 20L, 30L, 40L, 50L, 60L, 70L), \n list(1L, 1048576L, 205891132094649L, 1208925819614629174706176L, 88817841970012523233890533447265625L, 48873677980689257489322752273774603865660850176L, 143503601609868434285603076356671071740077383739246066639249L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(4L, 8L, 12L, 16L, 20L, 24L, 28L), list(3L, 6L, 9L, 12L, 15L, 18L, 21L), \n list(64L, 262144L, 5159780352L, 281474976710656L, 32768000000000000000L, 6979147079584381377970176L, 2456510688823056210273111113728L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 540,MBPP/540,R,Write a r function to find the difference between highest and least frequencies in a given list.,"# Write a r function to find the difference between highest and least frequencies in a given list. find_diff <- function(arr, n) {","find_diff <- function(arr, n) {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_diff', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between highest and least frequencies in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 1L, 2L, 2L, 7L, 8L, 4L, 5L, 1L, 4L), 10L, \n 2L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 7L, 9L, 2L, 3L, 3L, 1L, 3L, 3L), 9L, \n 3L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 1L, 2L), 4L, \n 0L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 541,MBPP/541,R,Write a function to find if the given number is abundant or not.,"# Write a function to find if the given number is abundant or not. check_abundant <- function(n) {",check_abundant <- function(n) {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'check_abundant', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find if the given number is abundant or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 12L, \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 15L, \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 18L, \n TRUE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 542,MBPP/542,R,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","# Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. fill_spaces <- function(text) {",fill_spaces <- function(text) {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'fill_spaces', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(text, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(text), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""Boult Curve Wireless Neckband"", \n ""Boult:Curve:Wireless:Neckband""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""Stereo Sound Sweatproof"", \n ""Stereo:Sound:Sweatproof""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""Probass Curve Audio"", \n ""Probass:Curve:Audio""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 543,MBPP/543,R,Write a function to add two numbers and print number of digits of sum.,"# Write a function to add two numbers and print number of digits of sum. count_digits <- function(num1, num2) {","count_digits <- function(num1, num2) {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'count_digits', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to add two numbers and print number of digits of sum.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(num1, num2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(num1, num2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 9875L, 10L, \n 4L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 98759853034L, 100L, \n 11L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 1234567L, 500L, \n 7L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 545,MBPP/545,R,Write a r function to toggle only first and last bits of a given number.,"# Write a r function to toggle only first and last bits of a given number. toggle_f_and_l_bits <- function(n) {",toggle_f_and_l_bits <- function(n) {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'toggle_f_and_l_bits', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to toggle only first and last bits of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 10L, \n 3L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 15L, \n 6L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 20L, \n 5L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 546,MBPP/546,R,Write a function to find the last occurrence of a character in a string.,"# Write a function to find the last occurrence of a character in a string. last_occurence_char <- function(string_arg0, char_arg1) {","last_occurence_char <- function(string_arg0, char_arg1) {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'last_occurence_char', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the last occurrence of a character in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(string_arg0, char_arg1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""hello world"", \'l\', \n 10L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""language"", \'g\', \n 7L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""little"", \'y\', \n NoneL\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 547,MBPP/547,R,Write a r function to find the sum of hamming distances of all consecutive numbers from o to n.,"# Write a r function to find the sum of hamming distances of all consecutive numbers from o to n. total_hamming_distance <- function(n) {",total_hamming_distance <- function(n) {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'total_hamming_distance', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 4L, \n 7L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 2L, \n 3L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 5L, \n 8L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 548,MBPP/548,R,Write a function to find the length of the longest increasing subsequence of the given sequence.,"# Write a function to find the length of the longest increasing subsequence of the given sequence. longest_increasing_subsequence <- function(arr) {",longest_increasing_subsequence <- function(arr) {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'longest_increasing_subsequence', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the length of the longest increasing subsequence of the given sequence.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(10L, 22L, 9L, 33L, 21L, 50L, 41L, 60L), \n 5L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(3L, 10L, 2L, 1L, 20L), \n 3L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(50L, 3L, 10L, 7L, 40L, 80L), \n 4L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 549,MBPP/549,R,Write a r function to find the sum of fifth power of first n odd natural numbers.,"# Write a r function to find the sum of fifth power of first n odd natural numbers. odd_num_sum <- function(n) {",odd_num_sum <- function(n) {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'odd_num_sum', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the sum of fifth power of first n odd natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 1L, \n 1L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 2L, \n 244L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 3L, \n 3369L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 550,MBPP/550,R,Write a r function to find the maximum element in a sorted and rotated list.,"# Write a r function to find the maximum element in a sorted and rotated list. find_max <- function(arr, low, high) {","find_max <- function(arr, low, high) {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_max', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum element in a sorted and rotated array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, low, high, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, low, high), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(2L, 3L, 5L, 6L, 9L), 0L, 4L, \n 9L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(3L, 4L, 5L, 2L, 1L), 0L, 4L, \n 5L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L), 0L, 2L, \n 3L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 551,MBPP/551,R,Write a function to extract a specified column from a given nested list.,"# Write a function to extract a specified column from a given nested list. extract_column <- function(list1, n) {","extract_column <- function(list1, n) {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'extract_column', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract a specified column from a given nested list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(list(1L, 2L, 3L), list(2L, 4L, 5L), list(1L, 1L, 1L)), 0L, \n list(1L, 2L, 1L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(list(1L, 2L, 3L), list(-2L, 4L, -5L), list(1L, -1L, 1L)), 2L, \n list(3L, -5L, 1L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(list(1L, 3L), list(5L, 7L), list(1L, 3L), list(13L, 15L, 17L), list(5L, 7L), list(9L, 11L)), 0L, \n list(1L, 5L, 1L, 13L, 5L, 9L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 552,MBPP/552,R,Write a r function to check whether a given sequence is linear or not.,"# Write a r function to check whether a given sequence is linear or not. seq_linear <- function(seq_nums) {",seq_linear <- function(seq_nums) {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'seq_linear', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether a given sequence is linear or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(seq_nums, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(seq_nums), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(0L, 2L, 4L, 6L, 8L, 10L), \n ""Linear Sequence""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L), \n ""Linear Sequence""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 5L, 2L), \n ""Non Linear Sequence""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 553,MBPP/553,R,Write a function to convert the given tuple to a floating-point number.,"# Write a function to convert the given tuple to a floating-point number. tuple_to_float <- function(test_tup) {",tuple_to_float <- function(test_tup) {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'tuple_to_float', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert the given tuple to a floating-point number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n abs(actual - expected) < 1e-06\n}\n\ndriver <- function(test_tup, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(4L, 56L), \n 4.56\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(7L, 256L), \n 7.256\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(8L, 123L), \n 8.123\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 554,MBPP/554,R,Write a r function to find odd numbers from a mixed list.,"# Write a r function to find odd numbers from a mixed list. split <- function(list) {",split <- function(list) {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'split', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find odd numbers from a mixed list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L), \n list(1L, 3L, 5L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(10L, 11L, 12L, 13L), \n list(11L, 13L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(7L, 8L, 9L, 1L), \n list(7L, 9L, 1L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 555,MBPP/555,R,Write a r function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"# Write a r function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. difference <- function(n) {",difference <- function(n) {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'difference', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 3L, \n 30L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 5L, \n 210L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 2L, \n 6L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 556,MBPP/556,R,Write a r function to count the pairs with xor as an odd number.,"# Write a r function to count the pairs with xor as an odd number. find_odd_pair <- function(a, n) {","find_odd_pair <- function(a, n) {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_odd_pair', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count the pairs with xor as an odd number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(5L, 4L, 7L, 2L, 1L), 5L, \n 6L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(7L, 2L, 8L, 1L, 0L, 5L, 11L), 7L, \n 12L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L), 3L, \n 2L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 557,MBPP/557,R,Write a function to toggle characters case in a string.,"# Write a function to toggle characters case in a string. toggle_string <- function(string_arg0) {",toggle_string <- function(string_arg0) {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'toggle_string', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to toggle characters case in a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(string_arg0, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(string_arg0), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""Python"", \n ""pYTHON""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""Pangram"", \n ""pANGRAM""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""LIttLE"", \n ""liTTle""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 558,MBPP/558,R,Write a r function to find the digit distance between two integers.,"# Write a r function to find the digit distance between two integers. digit_distance_nums <- function(n1, n2) {","digit_distance_nums <- function(n1, n2) {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'digit_distance_nums', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the digit distance between two integers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n1, n2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n1, n2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 1L, 2L, \n 1L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 23L, 56L, \n 6L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 123L, 256L, \n 7L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 559,MBPP/559,R,Write a function to find the largest sum of contiguous subarray in the given list.,"# Write a function to find the largest sum of contiguous subarray in the given list. max_sub_array_sum <- function(a, size) {","max_sub_array_sum <- function(a, size) {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'max_sub_array_sum', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the largest sum of contiguous subarray in the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, size, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, size), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(-2L, -3L, 4L, -1L, -2L, 1L, 5L, -3L), 8L, \n 7L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(-3L, -4L, 5L, -2L, -3L, 2L, 6L, -4L), 8L, \n 8L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(-4L, -5L, 6L, -3L, -4L, 3L, 7L, -5L), 8L, \n 10L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 560,MBPP/560,R,Write a function to find the union of elements of the given tuples.,"# Write a function to find the union of elements of the given tuples. union_elements <- function(test_tup1, test_tup2) {","union_elements <- function(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'union_elements', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the union of elements of the given tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(test_tup1, test_tup2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(3L, 4L, 5L, 6L), list(5L, 7L, 4L, 10L), \n list(3L, 4L, 5L, 6L, 7L, 10L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L), list(3L, 4L, 5L, 6L), \n list(1L, 2L, 3L, 4L, 5L, 6L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(11L, 12L, 13L, 14L), list(13L, 15L, 16L, 17L), \n list(11L, 12L, 13L, 14L, 15L, 16L, 17L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 562,MBPP/562,R,Write a r function to find the maximum length of sublist.,"# Write a r function to find the maximum length of sublist. find_max_length <- function(lst) {",find_max_length <- function(lst) {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_max_length', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the maximum length of sublist.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(lst, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(lst), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(list(1L), list(1L, 4L), list(5L, 6L, 7L, 8L)), \n 4L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(list(0L, 1L), list(2L, 2L), list(3L, 2L, 1L)), \n 3L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(list(7L), list(22L, 23L), list(13L, 14L, 15L), list(10L, 20L, 30L, 40L, 50L)), \n 5L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 563,MBPP/563,R,Write a function to extract values between quotation marks of a string.,"# Write a function to extract values between quotation marks of a string. extract_values <- function(text) {",extract_values <- function(text) {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'extract_values', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to extract values between quotation marks of a string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(text, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(text), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", \n list(""Python"", ""PHP"", ""Java"")\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""\\""python\\"",\\""program\\"",\\""language\\"""", \n list(""python"", ""program"", ""language"")\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", \n list(""red"", ""blue"", ""green"", ""yellow"")\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 564,MBPP/564,R,Write a r function to count unequal element pairs from the given list.,"# Write a r function to count unequal element pairs from the given list. count_pairs <- function(arr, n) {","count_pairs <- function(arr, n) {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'count_pairs', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to count unequal element pairs from the given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 1L), 3L, \n 2L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 1L, 1L, 1L), 4L, \n 0L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L), 5L, \n 10L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 565,MBPP/565,R,Write a r function to split a string into characters.,"# Write a r function to split a string into characters. split <- function(word) {",split <- function(word) {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'split', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split a string into characters.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(word, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(word), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""python"", \n list(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\')\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""Name"", \n list(\'N\', \'a\', \'m\', \'e\')\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""program"", \n list(\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\')\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 566,MBPP/566,R,Write a function to get the sum of a non-negative integer.,"# Write a function to get the sum of a non-negative integer. sum_digits <- function(n) {",sum_digits <- function(n) {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'sum_digits', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to get the sum of a non-negative integer.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 345L, \n 12L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 12L, \n 3L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 97L, \n 16L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 567,MBPP/567,R,Write a function to check whether a specified list is sorted or not.,"# Write a function to check whether a specified list is sorted or not. issort_list <- function(list1) {",issort_list <- function(list1) {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'issort_list', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether a specified list is sorted or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 4L, 6L, 8L, 10L, 12L, 14L, 16L, 17L), \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 4L, 6L, 8L, 10L, 12L, 14L, 20L, 17L), \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 4L, 6L, 8L, 10L, 15L, 14L, 20L), \n FALSE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 569,MBPP/569,R,Write a function to sort each sublist of strings in a given list of lists.,"# Write a function to sort each sublist of strings in a given list of lists. sort_sublists <- function(list1) {",sort_sublists <- function(list1) {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'sort_sublists', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to sort each sublist of strings in a given list of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(list(""green"", ""orange""), list(""black"", ""white""), list(""white"", ""black"", ""orange"")), \n list(list(""green"", ""orange""), list(""black"", ""white""), list(""black"", ""orange"", ""white""))\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(list(""green"", ""orange""), list(""black""), list(""green"", ""orange""), list(""white"")), \n list(list(""green"", ""orange""), list(""black""), list(""green"", ""orange""), list(""white""))\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(list(""a"", ""b""), list(""d"", ""c""), list(""g"", ""h""), list(""f"", ""e"")), \n list(list(""a"", ""b""), list(""c"", ""d""), list(""g"", ""h""), list(""e"", ""f""))\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 570,MBPP/570,R,Write a function to remove words from a given list of strings containing a character or string.,"# Write a function to remove words from a given list of strings containing a character or string. remove_words <- function(list1, charlist) {","remove_words <- function(list1, charlist) {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'remove_words', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove words from a given list of strings containing a character or string.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, charlist, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1, charlist), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""), list(""#"", ""color"", ""@""), \n list(""Red"", """", ""Green"", ""Orange"", ""White"")\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), list(""&"", ""+"", ""@""), \n list(""Red"", """", ""Green"", ""Orange"", ""White"")\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), list(""@""), \n list(""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White"")\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 571,MBPP/571,R,Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k.,"# Write a function to find maximum possible sum of disjoint pairs for the given list of integers and a number k. max_sum_pair_diff_lessthan_k <- function(arr, n, k) {","max_sum_pair_diff_lessthan_k <- function(arr, n, k) {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'max_sum_pair_diff_lessthan_k', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr, n, k, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr, n, k), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(3L, 5L, 10L, 15L, 17L, 12L, 9L), 7L, 4L, \n 62L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(5L, 15L, 10L, 300L), 4L, 12L, \n 25L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L), 6L, 6L, \n 21L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 572,MBPP/572,R,Write a r function to remove two duplicate numbers from a given number of lists.,"# Write a r function to remove two duplicate numbers from a given number of lists. two_unique_nums <- function(nums) {",two_unique_nums <- function(nums) {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'two_unique_nums', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to remove two duplicate numbers from a given number of lists.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(nums, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(nums), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 2L, 3L, 4L, 5L), \n list(1L, 4L, 5L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 2L, 4L, 5L), \n list(1L, 3L, 4L, 5L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L), \n list(1L, 2L, 3L, 4L, 5L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 573,MBPP/573,R,Write a r function to calculate the product of the unique numbers of a given list.,"# Write a r function to calculate the product of the unique numbers of a given list. unique_product <- function(list_data) {",unique_product <- function(list_data) {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'unique_product', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to calculate the product of the unique numbers of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list_data, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list_data), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(10L, 20L, 30L, 40L, 20L, 50L, 60L, 40L), \n 720000000L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 1L), \n 6L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(7L, 8L, 9L, 0L, 1L, 1L), \n 0L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 574,MBPP/574,R,Write a function to find the surface area of a cylinder.,"# Write a function to find the surface area of a cylinder. surfacearea_cylinder <- function(r, h) {","surfacearea_cylinder <- function(r, h) {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'surfacearea_cylinder', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the surface area of a cylinder.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n abs(actual - expected) < 1e-09\n}\n\ndriver <- function(r, h, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(r, h), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 10L, 5L, \n 942.45\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 4L, 5L, \n 226.18800000000002\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 4L, 10L, \n 351.848\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 575,MBPP/575,R,Write a r function to find nth number in a sequence which is not a multiple of a given number.,"# Write a r function to find nth number in a sequence which is not a multiple of a given number. count_no <- function(a, n, l, r) {","count_no <- function(a, n, l, r) {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'count_no', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find nth number in a sequence which is not a multiple of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, n, l, r, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, n, l, r), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 2L, 3L, 1L, 10L, \n 5L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 3L, 6L, 4L, 20L, \n 11L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 5L, 10L, 4L, 20L, \n 16L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 576,MBPP/576,R,Write a r function to check whether list is subarray of another or not.,"# Write a r function to check whether list is subarray of another or not. is_sub_array <- function(a, b, n, m) {","is_sub_array <- function(a, b, n, m) {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'is_sub_array', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether an array is subarray of another or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, b, n, m, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, b, n, m), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 4L, 3L, 5L), list(1L, 2L), 4L, 2L, \n FALSE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 1L), list(1L, 2L, 1L), 3L, 3L, \n TRUE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 0L, 2L, 2L), list(2L, 2L, 0L), 4L, 3L, \n FALSE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 577,MBPP/577,R,Write a r function to find the last digit in factorial of a given number.,"# Write a r function to find the last digit in factorial of a given number. last_digit_factorial <- function(n) {",last_digit_factorial <- function(n) {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'last_digit_factorial', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the last digit in factorial of a given number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 4L, \n 4L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 21L, \n 0L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 30L, \n 0L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 578,MBPP/578,R,Write a function to interleave lists of the same length.,"# Write a function to interleave lists of the same length. interleave_lists <- function(list1, list2, list3) {","interleave_lists <- function(list1, list2, list3) {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'interleave_lists', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to interleave lists of the same length.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, list2, list3, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L, 7L), list(10L, 20L, 30L, 40L, 50L, 60L, 70L), list(100L, 200L, 300L, 400L, 500L, 600L, 700L), \n list(1L, 10L, 100L, 2L, 20L, 200L, 3L, 30L, 300L, 4L, 40L, 400L, 5L, 50L, 500L, 6L, 60L, 600L, 7L, 70L, 700L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(10L, 20L), list(15L, 2L), list(5L, 10L), \n list(10L, 15L, 5L, 20L, 2L, 10L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(11L, 44L), list(10L, 15L), list(20L, 5L), \n list(11L, 10L, 20L, 44L, 15L, 5L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 579,MBPP/579,R,Write a function to find the dissimilar elements in the given two tuples.,"# Write a function to find the dissimilar elements in the given two tuples. find_dissimilar <- function(test_tup1, test_tup2) {","find_dissimilar <- function(test_tup1, test_tup2) {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_dissimilar', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the dissimilar elements in the given two tuples.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(test_tup1, test_tup2, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(3L, 4L, 5L, 6L), list(5L, 7L, 4L, 10L), \n list(3L, 6L, 7L, 10L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L), list(7L, 2L, 3L, 9L), \n list(1L, 4L, 7L, 9L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(21L, 11L, 25L, 26L), list(26L, 34L, 21L, 36L), \n list(34L, 36L, 11L, 25L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 581,MBPP/581,R,Write a r function to find the surface area of the square pyramid.,"# Write a r function to find the surface area of the square pyramid. surface_area <- function(b, s) {","surface_area <- function(b, s) {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'surface_area', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the surface area of the square pyramid.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(b, s, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(b, s), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 3L, 4L, \n 33L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 4L, 5L, \n 56L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 1L, 2L, \n 5L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 583,MBPP/583,R,Write a function for nth catalan number.,"# Write a function for nth catalan number. catalan_number <- function(num) {",catalan_number <- function(num) {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'catalan_number', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function for nth catalan number.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(num, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(num), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 10L, \n 16796L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 9L, \n 4862L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 7L, \n 429L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 584,MBPP/584,R,Write a function to find all adverbs and their positions in a given sentence by using regex.,"# Write a function to find all adverbs and their positions in a given sentence by using regex. find_adverbs <- function(text) {",find_adverbs <- function(text) {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_adverbs', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find all adverbs and their positions in a given sentence by using regex.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(text, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(text), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""Clearly, he has no excuse for such behavior."", \n ""0-7: Clearly""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""Please handle the situation carefuly"", \n ""28-36: carefuly""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""Complete the task quickly"", \n ""18-25: quickly""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 586,MBPP/586,R,Write a r function to split the list and add the first part to the end.,"# Write a r function to split the list and add the first part to the end. split_arr <- function(a, n, k) {","split_arr <- function(a, n, k) {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'split_arr', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to split the array and add the first part to the end.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, n, k, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, n, k), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(12L, 10L, 5L, 6L, 52L, 36L), 6L, 2L, \n list(5L, 6L, 52L, 36L, 12L, 10L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L), 4L, 1L, \n list(2L, 3L, 4L, 1L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L), 8L, 3L, \n list(3L, 4L, 5L, 6L, 7L, 0L, 1L, 2L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 587,MBPP/587,R,Write a function to convert a list to a tuple.,"# Write a function to convert a list to a tuple. list_tuple <- function(listx) {",list_tuple <- function(listx) {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'list_tuple', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to convert a list to a tuple.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(listx, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(listx), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(5L, 10L, 7L, 4L, 15L, 3L), \n list(5L, 10L, 7L, 4L, 15L, 3L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(2L, 4L, 5L, 6L, 2L, 3L, 4L, 4L, 7L), \n list(2L, 4L, 5L, 6L, 2L, 3L, 4L, 4L, 7L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(58L, 44L, 56L), \n list(58L, 44L, 56L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 588,MBPP/588,R,Write a r function to find the difference between largest and smallest value in a given list.,"# Write a r function to find the difference between largest and smallest value in a given list. big_diff <- function(nums) {",big_diff <- function(nums) {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'big_diff', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find the difference between largest and smallest value in a given array.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(nums, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(nums), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 2L, 3L, 4L), \n 3L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(4L, 5L, 12L), \n 8L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(9L, 2L, 3L), \n 7L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 589,MBPP/589,R,Write a function to find perfect squares between two given numbers.,"# Write a function to find perfect squares between two given numbers. perfect_squares <- function(a, b) {","perfect_squares <- function(a, b) {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'perfect_squares', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find perfect squares between two given numbers.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(a, b, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 1L, 30L, \n list(1L, 4L, 9L, 16L, 25L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 50L, 100L, \n list(64L, 81L, 100L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 100L, 200L, \n list(100L, 121L, 144L, 169L, 196L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 591,MBPP/591,R,Write a r function to interchange the first and last elements in a list.,"# Write a r function to interchange the first and last elements in a list. swap_list <- function(newlist) {",swap_list <- function(newlist) {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'swap_list', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to interchange the first and last elements in a list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(newlist, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(newlist), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(12L, 35L, 9L, 56L, 24L), \n list(24L, 35L, 9L, 56L, 12L)\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L), \n list(3L, 2L, 1L)\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(4L, 5L, 6L), \n list(6L, 5L, 4L)\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 592,MBPP/592,R,Write a r function to find sum of product of binomial co-efficients.,"# Write a r function to find sum of product of binomial co-efficients. sum_of_product <- function(n) {",sum_of_product <- function(n) {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'sum_of_product', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to find sum of product of binomial co-efficients.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 3L, \n 15L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 4L, \n 56L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 1L, \n 1L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 593,MBPP/593,R,Write a function to remove leading zeroes from an ip address.,"# Write a function to remove leading zeroes from an ip address. removezero_ip <- function(ip) {",removezero_ip <- function(ip) {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'removezero_ip', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to remove leading zeroes from an ip address.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(ip, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(ip), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n ""216.08.094.196"", \n ""216.8.94.196""\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n ""12.01.024"", \n ""12.1.24""\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n ""216.08.094.0196"", \n ""216.8.94.196""\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 594,MBPP/594,R,Write a function to find the difference of first even and odd number of a given list.,"# Write a function to find the difference of first even and odd number of a given list. diff_even_odd <- function(list1) {",diff_even_odd <- function(list1) {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'diff_even_odd', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find the difference of first even and odd number of a given list.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(list1, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(list1), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(1L, 3L, 5L, 7L, 4L, 1L, 6L, 8L), \n 3L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), \n 1L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(1L, 5L, 7L, 9L, 10L), \n 9L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 597,MBPP/597,R,Write a function to find kth element from the given two sorted lists.,"# Write a function to find kth element from the given two sorted lists. find_kth <- function(arr1, arr2, m, n, k) {","find_kth <- function(arr1, arr2, m, n, k) {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'find_kth', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to find kth element from the given two sorted arrays.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(arr1, arr2, m, n, k, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n list(2L, 3L, 6L, 7L, 9L), list(1L, 4L, 8L, 10L), 5L, 4L, 5L, \n 6L\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n list(100L, 112L, 256L, 349L, 770L), list(72L, 86L, 113L, 119L, 265L, 445L, 892L), 5L, 7L, 7L, \n 256L\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n list(3L, 4L, 7L, 8L, 10L), list(2L, 5L, 9L, 11L), 5L, 4L, 6L, \n 8L\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 598,MBPP/598,R,Write a function to check whether the given number is armstrong or not.,"# Write a function to check whether the given number is armstrong or not. armstrong_number <- function(number) {",armstrong_number <- function(number) {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'armstrong_number', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a function to check whether the given number is armstrong or not.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(number, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(number), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 153L, \n TRUE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 259L, \n FALSE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 4458L, \n FALSE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 600,MBPP/600,R,Write a r function to check whether the given number is even or not using bitwise operator.,"# Write a r function to check whether the given number is even or not using bitwise operator. is_even <- function(n) {",is_even <- function(n) {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'r', 'entry_fn_name': 'is_even', 'test_code': '\n\n# Question Prompt (NOT what is passed to the model)\n# Write a python function to check whether the given number is even or not using bitwise operator.\n#\n# SOLUTION CODE\n# ============================================\nPLACEHOLDER_CODE_BODY\n\n# TESTING CODE \n# ============================================\nvalidate_solution <- function(actual, expected) {\n toString(actual)==toString(expected)\n}\n\ndriver <- function(n, expected){\n if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){\n ""PASSED""\n } else{\n ""FAILED""\n }\n}\n\nmain <- function() {\n cat(sprintf(""TEST-0...%s\\n"",driver(\n 1L, \n FALSE\n )))\n\n cat(sprintf(""TEST-1...%s\\n"",driver(\n 2L, \n TRUE\n )))\n\n cat(sprintf(""TEST-2...%s\\n"",driver(\n 3L, \n FALSE\n )))\n\n}\n\nmain()', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['Rscript', '__FILENAME__']], 'timeouts': [10]}" 511,MBPP/511,Rust,Write a rust function to find minimum sum of factors of a given number.,"/// Write a rust function to find minimum sum of factors of a given number. pub fn find_min_sum(num: i32) -> i32 {",pub fn find_min_sum(num: i32) -> i32 {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_min_sum', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(num: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 12, \n 7\n ));\n \n println!(""TEST-1...{}"", driver(\n 105, \n 15\n ));\n \n println!(""TEST-2...{}"", driver(\n 2, \n 2\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 514,MBPP/514,Rust,Write a function to find the summation of tuple elements in the given tuple vector.,"/// Write a function to find the summation of tuple elements in the given tuple vector. pub fn sum_elements(test_tup: Vec) -> i32 {",pub fn sum_elements(test_tup: Vec) -> i32 {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'sum_elements', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(test_tup: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([7, 8, 9, 1, 10, 7]), \n 42\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6]), \n 21\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([11, 12, 13, 45, 14]), \n 95\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 515,MBPP/515,Rust,Write a function to check if there is a subset with sum divisible by m.,"/// Write a function to check if there is a subset with sum divisible by m. pub fn modular_sum(arr: Vec, n: i32, m: i32) -> bool {","pub fn modular_sum(arr: Vec, n: i32, m: i32) -> bool {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'modular_sum', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, m: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, m), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([3, 1, 7, 5]), 4, 6, \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 7]), 2, 5, \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 6]), 2, 5, \n false\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 516,MBPP/516,Rust,Write a function to sort vector of elements using radix sort.,"/// Write a function to sort vector of elements using radix sort. pub fn radix_sort(nums: Vec) -> Vec {",pub fn radix_sort(nums: Vec) -> Vec {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'radix_sort', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(nums: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([15, 79, 25, 68, 37]), \n Vec::from([15, 25, 37, 68, 79])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([9, 11, 8, 7, 3, 2]), \n Vec::from([2, 3, 7, 8, 9, 11])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([36, 12, 24, 26, 29]), \n Vec::from([12, 24, 26, 29, 36])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 517,MBPP/517,Rust,Write a rust function to find the largest postive number from the given vector.,"/// Write a rust function to find the largest postive number from the given vector. pub fn largest_pos(list1: Vec) -> i32 {",pub fn largest_pos(list1: Vec) -> i32 {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'largest_pos', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 4, -1]), \n 4\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([0, 1, 2, -5, -1, 6]), \n 6\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([0, 0, 1, 0]), \n 1\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 518,MBPP/518,Rust,Write a function to find the square root of a perfect number.,"/// Write a function to find the square root of a perfect number. pub fn sqrt_root(num: i32) -> i32 {",pub fn sqrt_root(num: i32) -> i32 {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'sqrt_root', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(num: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 4, \n 2\n ));\n \n println!(""TEST-1...{}"", driver(\n 16, \n 4\n ));\n \n println!(""TEST-2...{}"", driver(\n 400, \n 20\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 519,MBPP/519,Rust,Write a function to calculate volume of a tetrahedron.,"/// Write a function to calculate volume of a tetrahedron. pub fn volume_tetrahedron(num: i32) -> f32 {",pub fn volume_tetrahedron(num: i32) -> f32 {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'volume_tetrahedron', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: f32, expected: f32)->bool{\nreturn (actual - expected).abs() < 1e-06\n}\npub fn driver(num: i32, expected: f32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 10, \n 117.85\n ));\n \n println!(""TEST-1...{}"", driver(\n 15, \n 397.75\n ));\n \n println!(""TEST-2...{}"", driver(\n 20, \n 942.81\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 520,MBPP/520,Rust,Write a function to find the lcm of the given array elements.,"/// Write a function to find the lcm of the given array elements. pub fn get_lcm(l: Vec) -> i32 {",pub fn get_lcm(l: Vec) -> i32 {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'get_lcm', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(l: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(l), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([2, 7, 3, 9, 4]), \n 252\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 8, 3]), \n 24\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([3, 8, 4, 10, 5]), \n 120\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 521,MBPP/521,Rust,Write a function to print check if the triangle is scalene or not.,"/// Write a function to print check if the triangle is scalene or not. pub fn check_isosceles(x: i32, y: i32, z: i32) -> bool {","pub fn check_isosceles(x: i32, y: i32, z: i32) -> bool {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'check_isosceles', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(x: i32, y: i32, z: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(x, y, z), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 6, 8, 12, \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n 6, 6, 12, \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n 6, 15, 20, \n true\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 522,MBPP/522,Rust,Write a function to find the longest bitonic subsequence for the given array.,"/// Write a function to find the longest bitonic subsequence for the given array. pub fn lbs(arr: Vec) -> i32 {",pub fn lbs(arr: Vec) -> i32 {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'lbs', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]), \n 7\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 11, 2, 10, 4, 5, 2, 1]), \n 6\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([80, 60, 30, 40, 20, 10]), \n 5\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 523,MBPP/523,Rust,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. pub fn check_string(str1: String) -> Vec {",pub fn check_string(str1: String) -> Vec {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'check_string', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(str1: String, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""python"".to_string(), \n Vec::from([""String must have 1 upper case character."".to_string(), ""String must have 1 number."".to_string(), ""String length should be atleast 8."".to_string()])\n ));\n \n println!(""TEST-1...{}"", driver(\n ""123python"".to_string(), \n Vec::from([""String must have 1 upper case character."".to_string()])\n ));\n \n println!(""TEST-2...{}"", driver(\n ""123Python"".to_string(), \n Vec::from([""Valid string."".to_string()])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 524,MBPP/524,Rust,Write a function to find the sum of maximum increasing subsequence of the given array.,"/// Write a function to find the sum of maximum increasing subsequence of the given array. pub fn max_sum_increasing_subsequence(arr: Vec, n: i32) -> i32 {","pub fn max_sum_increasing_subsequence(arr: Vec, n: i32) -> i32 {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'max_sum_increasing_subsequence', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 101, 2, 3, 100, 4, 5]), 7, \n 106\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([3, 4, 5, 10]), 4, \n 22\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([10, 5, 4, 3]), 4, \n 10\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 525,MBPP/525,Rust,Write a rust function to check whether two given lines are parallel or not.,"/// Write a rust function to check whether two given lines are parallel or not. pub fn parallel_lines(line1: Vec, line2: Vec) -> bool {","pub fn parallel_lines(line1: Vec, line2: Vec) -> bool {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'parallel_lines', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(line1: Vec, line2: Vec, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(line1, line2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([2, 3, 4]), Vec::from([2, 3, 8]), \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([2, 3, 4]), Vec::from([4, -3, 8]), \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([3, 3]), Vec::from([5, 5]), \n true\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 526,MBPP/526,Rust,Write a rust function to capitalize first and last letters of each word of a given string.,"/// Write a rust function to capitalize first and last letters of each word of a given string. pub fn capitalize_first_last_letters(str1: String) -> String {",pub fn capitalize_first_last_letters(str1: String) -> String {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'capitalize_first_last_letters', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(str1: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""python"".to_string(), \n ""PythoN"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""bigdata"".to_string(), \n ""BigdatA"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""Hadoop"".to_string(), \n ""HadooP"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 527,MBPP/527,Rust,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/// Write a function to find all pairs in an integer array whose sum is equal to a given number. pub fn get_pairs_count(arr: Vec, n: i32, sum: i32) -> i32 {","pub fn get_pairs_count(arr: Vec, n: i32, sum: i32) -> i32 {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'get_pairs_count', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, sum: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, sum), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 5, 7, -1, 5]), 5, 6, \n 3\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 5, 7, -1]), 4, 6, \n 2\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 1, 1, 1]), 4, 2, \n 6\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 529,MBPP/529,Rust,Write a function to find the nth jacobsthal-lucas number.,"/// Write a function to find the nth jacobsthal-lucas number. pub fn jacobsthal_lucas(n: i32) -> i32 {",pub fn jacobsthal_lucas(n: i32) -> i32 {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'jacobsthal_lucas', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 5, \n 31\n ));\n \n println!(""TEST-1...{}"", driver(\n 2, \n 5\n ));\n \n println!(""TEST-2...{}"", driver(\n 4, \n 17\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 530,MBPP/530,Rust,Write a function to find the ration of negative numbers in an array of integers.,"/// Write a function to find the ration of negative numbers in an array of integers. pub fn negative_count(nums: Vec) -> f32 {",pub fn negative_count(nums: Vec) -> f32 {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'negative_count', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: f32, expected: f32)->bool{\nreturn (actual - expected).abs() < 1e-06\n}\npub fn driver(nums: Vec, expected: f32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]), \n 0.31\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]), \n 0.31\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([2, 4, -6, -9, 11, -12, 14, -5, 17]), \n 0.44\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 531,MBPP/531,Rust,Write a function to find minimum number of coins that make a given value.,"/// Write a function to find minimum number of coins that make a given value. pub fn min_coins(coins: Vec, m: i32, v: i32) -> i32 {","pub fn min_coins(coins: Vec, m: i32, v: i32) -> i32 {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'min_coins', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(coins: Vec, m: i32, v: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(coins, m, v), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([9, 6, 5, 1]), 4, 11, \n 2\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([4, 5, 6, 7, 8, 9]), 6, 9, \n 1\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3]), 3, 4, \n 2\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 532,MBPP/532,Rust,Write a function to check if the two given strings are permutations of each other.,"/// Write a function to check if the two given strings are permutations of each other. pub fn check_permutation(str1: String, str2: String) -> bool {","pub fn check_permutation(str1: String, str2: String) -> bool {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'check_permutation', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(str1: String, str2: String, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(str1, str2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""abc"".to_string(), ""cba"".to_string(), \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n ""test"".to_string(), ""ttew"".to_string(), \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n ""xxyz"".to_string(), ""yxzx"".to_string(), \n true\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 534,MBPP/534,Rust,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. pub fn search_literal(pattern: String, text: String) -> Vec {","pub fn search_literal(pattern: String, text: String) -> Vec {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'search_literal', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(pattern: String, text: String, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(pattern, text), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""python"".to_string(), ""python programming language"".to_string(), \n Vec::from([0, 6])\n ));\n \n println!(""TEST-1...{}"", driver(\n ""programming"".to_string(), ""python programming language"".to_string(), \n Vec::from([7, 18])\n ));\n \n println!(""TEST-2...{}"", driver(\n ""language"".to_string(), ""python programming language"".to_string(), \n Vec::from([19, 27])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 535,MBPP/535,Rust,Write a function to find the top or bottom surface area of a cylinder.,"/// Write a function to find the top or bottom surface area of a cylinder. pub fn topbottom_surfacearea(r: i32) -> f64 {",pub fn topbottom_surfacearea(r: i32) -> f64 {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'topbottom_surfacearea', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: f64, expected: f64)->bool{\nreturn (actual - expected).abs() < 1e-09\n}\npub fn driver(r: i32, expected: f64)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(r), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 10, \n 314.15000000000003\n ));\n \n println!(""TEST-1...{}"", driver(\n 5, \n 78.53750000000001\n ));\n \n println!(""TEST-2...{}"", driver(\n 4, \n 50.264\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 536,MBPP/536,Rust,Write a function to select the nth items of vector.,"/// Write a function to select the nth items of vector. pub fn nth_items(list: Vec, n: i32) -> Vec {","pub fn nth_items(list: Vec, n: i32) -> Vec {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'nth_items', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(list: Vec, n: i32, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6, 7, 8, 9]), 2, \n Vec::from([1, 3, 5, 7, 9])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([10, 15, 19, 17, 16, 18]), 3, \n Vec::from([10, 17])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([14, 16, 19, 15, 17]), 4, \n Vec::from([14, 17])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 537,MBPP/537,Rust,Write a rust function to find the first repeated word in a given string.,"/// Write a rust function to find the first repeated word in a given string. pub fn first_repeated_word(str1: String) -> String {",pub fn first_repeated_word(str1: String) -> String {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'first_repeated_word', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(str1: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""ab ca bc ab"".to_string(), \n ""ab"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""ab ca bc"".to_string(), \n ""None"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""ab ca bc ca ab bc"".to_string(), \n ""ca"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 538,MBPP/538,Rust,Write a rust function to convert a given string vector to a tuple.,"/// Write a rust function to convert a given string vector to a tuple. pub fn string_list_to_tuple(str1: String) -> Vec {",pub fn string_list_to_tuple(str1: String) -> Vec {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'string_list_to_tuple', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(str1: String, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(str1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""python 3.0"".to_string(), \n Vec::from([\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\'])\n ));\n \n println!(""TEST-1...{}"", driver(\n ""bigdata"".to_string(), \n Vec::from([\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\'])\n ));\n \n println!(""TEST-2...{}"", driver(\n ""language"".to_string(), \n Vec::from([\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\'])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 539,MBPP/539,Rust,Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function.,"/// Write a function to create vector containing the power of said number in bases raised to the corresponding number in the index using map function. pub fn basesnum_coresspondingnum(bases_num: Vec, index: Vec) -> Vec {","pub fn basesnum_coresspondingnum(bases_num: Vec, index: Vec) -> Vec {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'basesnum_coresspondingnum', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(bases_num: Vec, index: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(bases_num, index), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]), Vec::from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), \n Vec::from([10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6, 7]), Vec::from([10, 20, 30, 40, 50, 60, 70]), \n Vec::from([1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([4, 8, 12, 16, 20, 24, 28]), Vec::from([3, 6, 9, 12, 15, 18, 21]), \n Vec::from([64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 540,MBPP/540,Rust,Write a rust function to find the difference between highest and least frequencies in a given array.,"/// Write a rust function to find the difference between highest and least frequencies in a given array. pub fn find_diff(arr: Vec, n: i32) -> i32 {","pub fn find_diff(arr: Vec, n: i32) -> i32 {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_diff', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 1, 2, 2, 7, 8, 4, 5, 1, 4]), 10, \n 2\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 7, 9, 2, 3, 3, 1, 3, 3]), 9, \n 3\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 1, 2]), 4, \n 0\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 541,MBPP/541,Rust,Write a function to find if the given number is abundant or not.,"/// Write a function to find if the given number is abundant or not. pub fn check_abundant(n: i32) -> bool {",pub fn check_abundant(n: i32) -> bool {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'check_abundant', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 12, \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n 15, \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n 18, \n true\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 542,MBPP/542,Rust,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. pub fn fill_spaces(text: String) -> String {",pub fn fill_spaces(text: String) -> String {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'fill_spaces', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(text: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""Boult Curve Wireless Neckband"".to_string(), \n ""Boult:Curve:Wireless:Neckband"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""Stereo Sound Sweatproof"".to_string(), \n ""Stereo:Sound:Sweatproof"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""Probass Curve Audio"".to_string(), \n ""Probass:Curve:Audio"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 543,MBPP/543,Rust,Write a function to add two numbers and print number of digits of sum.,"/// Write a function to add two numbers and print number of digits of sum. pub fn count_digits(num1: i64, num2: i32) -> i32 {","pub fn count_digits(num1: i64, num2: i32) -> i32 {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'count_digits', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(num1: i64, num2: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(num1, num2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 9875, 10, \n 4\n ));\n \n println!(""TEST-1...{}"", driver(\n 98759853034, 100, \n 11\n ));\n \n println!(""TEST-2...{}"", driver(\n 1234567, 500, \n 7\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 545,MBPP/545,Rust,Write a rust function to toggle only first and last bits of a given number.,"/// Write a rust function to toggle only first and last bits of a given number. pub fn toggle_f_and_l_bits(n: i32) -> i32 {",pub fn toggle_f_and_l_bits(n: i32) -> i32 {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'toggle_f_and_l_bits', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 10, \n 3\n ));\n \n println!(""TEST-1...{}"", driver(\n 15, \n 6\n ));\n \n println!(""TEST-2...{}"", driver(\n 20, \n 5\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 546,MBPP/546,Rust,Write a function to find the last occurrence of a character in a string.,"/// Write a function to find the last occurrence of a character in a string. pub fn last_occurence_char(string_arg0: String, char_arg1: char) -> i32 {","pub fn last_occurence_char(string_arg0: String, char_arg1: char) -> i32 {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'last_occurence_char', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(string_arg0: String, char_arg1: char, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""hello world"".to_string(), \'l\', \n 10\n ));\n \n println!(""TEST-1...{}"", driver(\n ""language"".to_string(), \'g\', \n 7\n ));\n \n println!(""TEST-2...{}"", driver(\n ""little"".to_string(), \'y\', \n None\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 547,MBPP/547,Rust,Write a rust function to find the sum of hamming distances of all consecutive numbers from o to n.,"/// Write a rust function to find the sum of hamming distances of all consecutive numbers from o to n. pub fn total_hamming_distance(n: i32) -> i32 {",pub fn total_hamming_distance(n: i32) -> i32 {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'total_hamming_distance', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 4, \n 7\n ));\n \n println!(""TEST-1...{}"", driver(\n 2, \n 3\n ));\n \n println!(""TEST-2...{}"", driver(\n 5, \n 8\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 548,MBPP/548,Rust,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/// Write a function to find the length of the longest increasing subsequence of the given sequence. pub fn longest_increasing_subsequence(arr: Vec) -> i32 {",pub fn longest_increasing_subsequence(arr: Vec) -> i32 {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'longest_increasing_subsequence', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([10, 22, 9, 33, 21, 50, 41, 60]), \n 5\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([3, 10, 2, 1, 20]), \n 3\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([50, 3, 10, 7, 40, 80]), \n 4\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 549,MBPP/549,Rust,Write a rust function to find the sum of fifth power of first n odd natural numbers.,"/// Write a rust function to find the sum of fifth power of first n odd natural numbers. pub fn odd_num_sum(n: i32) -> i32 {",pub fn odd_num_sum(n: i32) -> i32 {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'odd_num_sum', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 1, \n 1\n ));\n \n println!(""TEST-1...{}"", driver(\n 2, \n 244\n ));\n \n println!(""TEST-2...{}"", driver(\n 3, \n 3369\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 550,MBPP/550,Rust,Write a rust function to find the maximum element in a sorted and rotated array.,"/// Write a rust function to find the maximum element in a sorted and rotated array. pub fn find_max(arr: Vec, low: i32, high: i32) -> i32 {","pub fn find_max(arr: Vec, low: i32, high: i32) -> i32 {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_max', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, low: i32, high: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, low, high), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([2, 3, 5, 6, 9]), 0, 4, \n 9\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([3, 4, 5, 2, 1]), 0, 4, \n 5\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3]), 0, 2, \n 3\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 551,MBPP/551,Rust,Write a function to extract a specified column from a given nested vector.,"/// Write a function to extract a specified column from a given nested vector. pub fn extract_column(list1: Vec>, n: i32) -> Vec {","pub fn extract_column(list1: Vec>, n: i32) -> Vec {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'extract_column', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec>, n: i32, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([Vec::from([1, 2, 3]), Vec::from([2, 4, 5]), Vec::from([1, 1, 1])]), 0, \n Vec::from([1, 2, 1])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([Vec::from([1, 2, 3]), Vec::from([-2, 4, -5]), Vec::from([1, -1, 1])]), 2, \n Vec::from([3, -5, 1])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([Vec::from([1, 3]), Vec::from([5, 7]), Vec::from([1, 3]), Vec::from([13, 15, 17]), Vec::from([5, 7]), Vec::from([9, 11])]), 0, \n Vec::from([1, 5, 1, 13, 5, 9])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 552,MBPP/552,Rust,Write a rust function to check whether a given sequence is linear or not.,"/// Write a rust function to check whether a given sequence is linear or not. pub fn seq_linear(seq_nums: Vec) -> String {",pub fn seq_linear(seq_nums: Vec) -> String {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'seq_linear', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(seq_nums: Vec, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(seq_nums), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([0, 2, 4, 6, 8, 10]), \n ""Linear Sequence"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3]), \n ""Linear Sequence"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 5, 2]), \n ""Non Linear Sequence"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 553,MBPP/553,Rust,Write a function to convert the given tuple to a floating-point number.,"/// Write a function to convert the given tuple to a floating-point number. pub fn tuple_to_float(test_tup: Vec) -> f32 {",pub fn tuple_to_float(test_tup: Vec) -> f32 {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'tuple_to_float', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: f32, expected: f32)->bool{\nreturn (actual - expected).abs() < 1e-06\n}\npub fn driver(test_tup: Vec, expected: f32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([4, 56]), \n 4.56\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([7, 256]), \n 7.256\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([8, 123]), \n 8.123\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 554,MBPP/554,Rust,Write a rust function to find odd numbers from a mixed vector.,"/// Write a rust function to find odd numbers from a mixed vector. pub fn split(list: Vec) -> Vec {",pub fn split(list: Vec) -> Vec {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'split', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(list: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6]), \n Vec::from([1, 3, 5])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([10, 11, 12, 13]), \n Vec::from([11, 13])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([7, 8, 9, 1]), \n Vec::from([7, 9, 1])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 555,MBPP/555,Rust,Write a rust function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/// Write a rust function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. pub fn difference(n: i32) -> i32 {",pub fn difference(n: i32) -> i32 {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'difference', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 3, \n 30\n ));\n \n println!(""TEST-1...{}"", driver(\n 5, \n 210\n ));\n \n println!(""TEST-2...{}"", driver(\n 2, \n 6\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 556,MBPP/556,Rust,Write a rust function to count the pairs with xor as an odd number.,"/// Write a rust function to count the pairs with xor as an odd number. pub fn find_odd_pair(a: Vec, n: i32) -> i32 {","pub fn find_odd_pair(a: Vec, n: i32) -> i32 {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_odd_pair', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(a: Vec, n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([5, 4, 7, 2, 1]), 5, \n 6\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([7, 2, 8, 1, 0, 5, 11]), 7, \n 12\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3]), 3, \n 2\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 557,MBPP/557,Rust,Write a function to toggle characters case in a string.,"/// Write a function to toggle characters case in a string. pub fn toggle_string(string_arg0: String) -> String {",pub fn toggle_string(string_arg0: String) -> String {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'toggle_string', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(string_arg0: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(string_arg0), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""Python"".to_string(), \n ""pYTHON"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""Pangram"".to_string(), \n ""pANGRAM"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""LIttLE"".to_string(), \n ""liTTle"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 558,MBPP/558,Rust,Write a rust function to find the digit distance between two integers.,"/// Write a rust function to find the digit distance between two integers. pub fn digit_distance_nums(n1: i32, n2: i32) -> i32 {","pub fn digit_distance_nums(n1: i32, n2: i32) -> i32 {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'digit_distance_nums', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n1: i32, n2: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n1, n2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 1, 2, \n 1\n ));\n \n println!(""TEST-1...{}"", driver(\n 23, 56, \n 6\n ));\n \n println!(""TEST-2...{}"", driver(\n 123, 256, \n 7\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 559,MBPP/559,Rust,Write a function to find the largest sum of contiguous subarray in the given array.,"/// Write a function to find the largest sum of contiguous subarray in the given array. pub fn max_sub_array_sum(a: Vec, size: i32) -> i32 {","pub fn max_sub_array_sum(a: Vec, size: i32) -> i32 {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'max_sub_array_sum', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(a: Vec, size: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, size), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([-2, -3, 4, -1, -2, 1, 5, -3]), 8, \n 7\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([-3, -4, 5, -2, -3, 2, 6, -4]), 8, \n 8\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([-4, -5, 6, -3, -4, 3, 7, -5]), 8, \n 10\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 560,MBPP/560,Rust,Write a function to find the union of elements of the given tuples.,"/// Write a function to find the union of elements of the given tuples. pub fn union_elements(test_tup1: Vec, test_tup2: Vec) -> Vec {","pub fn union_elements(test_tup1: Vec, test_tup2: Vec) -> Vec {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'union_elements', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(test_tup1: Vec, test_tup2: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([3, 4, 5, 6]), Vec::from([5, 7, 4, 10]), \n Vec::from([3, 4, 5, 6, 7, 10])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4]), Vec::from([3, 4, 5, 6]), \n Vec::from([1, 2, 3, 4, 5, 6])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([11, 12, 13, 14]), Vec::from([13, 15, 16, 17]), \n Vec::from([11, 12, 13, 14, 15, 16, 17])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 562,MBPP/562,Rust,Write a rust function to find the maximum length of sublist.,"/// Write a rust function to find the maximum length of sublist. pub fn find_max_length(lst: Vec>) -> i32 {",pub fn find_max_length(lst: Vec>) -> i32 {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_max_length', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(lst: Vec>, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(lst), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([Vec::from([1]), Vec::from([1, 4]), Vec::from([5, 6, 7, 8])]), \n 4\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([Vec::from([0, 1]), Vec::from([2, 2]), Vec::from([3, 2, 1])]), \n 3\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([Vec::from([7]), Vec::from([22, 23]), Vec::from([13, 14, 15]), Vec::from([10, 20, 30, 40, 50])]), \n 5\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 563,MBPP/563,Rust,Write a function to extract values between quotation marks of a string.,"/// Write a function to extract values between quotation marks of a string. pub fn extract_values(text: String) -> Vec {",pub fn extract_values(text: String) -> Vec {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'extract_values', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(text: String, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""\\""Python\\"", \\""PHP\\"", \\""Java\\"""".to_string(), \n Vec::from([""Python"".to_string(), ""PHP"".to_string(), ""Java"".to_string()])\n ));\n \n println!(""TEST-1...{}"", driver(\n ""\\""python\\"",\\""program\\"",\\""language\\"""".to_string(), \n Vec::from([""python"".to_string(), ""program"".to_string(), ""language"".to_string()])\n ));\n \n println!(""TEST-2...{}"", driver(\n ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""".to_string(), \n Vec::from([""red"".to_string(), ""blue"".to_string(), ""green"".to_string(), ""yellow"".to_string()])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 564,MBPP/564,Rust,Write a rust function to count unequal element pairs from the given array.,"/// Write a rust function to count unequal element pairs from the given array. pub fn count_pairs(arr: Vec, n: i32) -> i32 {","pub fn count_pairs(arr: Vec, n: i32) -> i32 {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'count_pairs', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 1]), 3, \n 2\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 1, 1, 1]), 4, \n 0\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3, 4, 5]), 5, \n 10\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 565,MBPP/565,Rust,Write a rust function to split a string into characters.,"/// Write a rust function to split a string into characters. pub fn split(word: String) -> Vec {",pub fn split(word: String) -> Vec {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'split', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(word: String, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(word), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""python"".to_string(), \n Vec::from([\'p\', \'y\', \'t\', \'h\', \'o\', \'n\'])\n ));\n \n println!(""TEST-1...{}"", driver(\n ""Name"".to_string(), \n Vec::from([\'N\', \'a\', \'m\', \'e\'])\n ));\n \n println!(""TEST-2...{}"", driver(\n ""program"".to_string(), \n Vec::from([\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\'])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 566,MBPP/566,Rust,Write a function to get the sum of a non-negative integer.,"/// Write a function to get the sum of a non-negative integer. pub fn sum_digits(n: i32) -> i32 {",pub fn sum_digits(n: i32) -> i32 {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'sum_digits', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 345, \n 12\n ));\n \n println!(""TEST-1...{}"", driver(\n 12, \n 3\n ));\n \n println!(""TEST-2...{}"", driver(\n 97, \n 16\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 567,MBPP/567,Rust,Write a function to check whether a specified vector is sorted or not.,"/// Write a function to check whether a specified vector is sorted or not. pub fn issort_list(list1: Vec) -> bool {",pub fn issort_list(list1: Vec) -> bool {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'issort_list', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 4, 6, 8, 10, 12, 14, 16, 17]), \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 4, 6, 8, 10, 12, 14, 20, 17]), \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 4, 6, 8, 10, 15, 14, 20]), \n false\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 569,MBPP/569,Rust,Write a function to sort each sublist of strings in a given vector of vectors.,"/// Write a function to sort each sublist of strings in a given vector of vectors. pub fn sort_sublists(list1: Vec>) -> Vec> {",pub fn sort_sublists(list1: Vec>) -> Vec> {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'sort_sublists', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec>, expected: Vec>)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec>, expected: Vec>)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""black"".to_string(), ""white"".to_string()]), Vec::from([""white"".to_string(), ""black"".to_string(), ""orange"".to_string()])]), \n Vec::from([Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""black"".to_string(), ""white"".to_string()]), Vec::from([""black"".to_string(), ""orange"".to_string(), ""white"".to_string()])])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""black"".to_string()]), Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""white"".to_string()])]), \n Vec::from([Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""black"".to_string()]), Vec::from([""green"".to_string(), ""orange"".to_string()]), Vec::from([""white"".to_string()])])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([Vec::from([""a"".to_string(), ""b"".to_string()]), Vec::from([""d"".to_string(), ""c"".to_string()]), Vec::from([""g"".to_string(), ""h"".to_string()]), Vec::from([""f"".to_string(), ""e"".to_string()])]), \n Vec::from([Vec::from([""a"".to_string(), ""b"".to_string()]), Vec::from([""c"".to_string(), ""d"".to_string()]), Vec::from([""g"".to_string(), ""h"".to_string()]), Vec::from([""e"".to_string(), ""f"".to_string()])])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 570,MBPP/570,Rust,Write a function to remove words from a given vector of strings containing a character or string.,"/// Write a function to remove words from a given vector of strings containing a character or string. pub fn remove_words(list1: Vec, charlist: Vec) -> Vec {","pub fn remove_words(list1: Vec, charlist: Vec) -> Vec {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'remove_words', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec, charlist: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1, charlist), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([""Red color"".to_string(), ""Orange#"".to_string(), ""Green"".to_string(), ""Orange @"".to_string(), ""White"".to_string()]), Vec::from([""#"".to_string(), ""color"".to_string(), ""@"".to_string()]), \n Vec::from([""Red"".to_string(), """".to_string(), ""Green"".to_string(), ""Orange"".to_string(), ""White"".to_string()])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([""Red &"".to_string(), ""Orange+"".to_string(), ""Green"".to_string(), ""Orange @"".to_string(), ""White"".to_string()]), Vec::from([""&"".to_string(), ""+"".to_string(), ""@"".to_string()]), \n Vec::from([""Red"".to_string(), """".to_string(), ""Green"".to_string(), ""Orange"".to_string(), ""White"".to_string()])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([""Red &"".to_string(), ""Orange+"".to_string(), ""Green"".to_string(), ""Orange @"".to_string(), ""White"".to_string()]), Vec::from([""@"".to_string()]), \n Vec::from([""Red &"".to_string(), ""Orange+"".to_string(), ""Green"".to_string(), ""Orange"".to_string(), ""White"".to_string()])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 571,MBPP/571,Rust,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. pub fn max_sum_pair_diff_lessthan_k(arr: Vec, n: i32, k: i32) -> i32 {","pub fn max_sum_pair_diff_lessthan_k(arr: Vec, n: i32, k: i32) -> i32 {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'max_sum_pair_diff_lessthan_k', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr: Vec, n: i32, k: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr, n, k), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([3, 5, 10, 15, 17, 12, 9]), 7, 4, \n 62\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([5, 15, 10, 300]), 4, 12, \n 25\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6]), 6, 6, \n 21\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 572,MBPP/572,Rust,Write a rust function to remove two duplicate numbers from a given number of vectors.,"/// Write a rust function to remove two duplicate numbers from a given number of vectors. pub fn two_unique_nums(nums: Vec) -> Vec {",pub fn two_unique_nums(nums: Vec) -> Vec {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'two_unique_nums', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(nums: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 2, 3, 4, 5]), \n Vec::from([1, 4, 5])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 2, 4, 5]), \n Vec::from([1, 3, 4, 5])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 2, 3, 4, 5]), \n Vec::from([1, 2, 3, 4, 5])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 573,MBPP/573,Rust,Write a rust function to calculate the product of the unique numbers of a given vector.,"/// Write a rust function to calculate the product of the unique numbers of a given vector. pub fn unique_product(list_data: Vec) -> i32 {",pub fn unique_product(list_data: Vec) -> i32 {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'unique_product', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(list_data: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list_data), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([10, 20, 30, 40, 20, 50, 60, 40]), \n 720000000\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 1]), \n 6\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([7, 8, 9, 0, 1, 1]), \n 0\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 574,MBPP/574,Rust,Write a function to find the surface area of a cylinder.,"/// Write a function to find the surface area of a cylinder. pub fn surfacearea_cylinder(r: i32, h: i32) -> f64 {","pub fn surfacearea_cylinder(r: i32, h: i32) -> f64 {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'surfacearea_cylinder', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: f64, expected: f64)->bool{\nreturn (actual - expected).abs() < 1e-09\n}\npub fn driver(r: i32, h: i32, expected: f64)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(r, h), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 10, 5, \n 942.45\n ));\n \n println!(""TEST-1...{}"", driver(\n 4, 5, \n 226.18800000000002\n ));\n \n println!(""TEST-2...{}"", driver(\n 4, 10, \n 351.848\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 575,MBPP/575,Rust,Write a rust function to find nth number in a sequence which is not a multiple of a given number.,"/// Write a rust function to find nth number in a sequence which is not a multiple of a given number. pub fn count_no(a: i32, n: i32, l: i32, r: i32) -> i32 {","pub fn count_no(a: i32, n: i32, l: i32, r: i32) -> i32 {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'count_no', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(a: i32, n: i32, l: i32, r: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, n, l, r), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 2, 3, 1, 10, \n 5\n ));\n \n println!(""TEST-1...{}"", driver(\n 3, 6, 4, 20, \n 11\n ));\n \n println!(""TEST-2...{}"", driver(\n 5, 10, 4, 20, \n 16\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 576,MBPP/576,Rust,Write a rust function to check whether an array is subarray of another or not.,"/// Write a rust function to check whether an array is subarray of another or not. pub fn is_sub_array(a: Vec, b: Vec, n: i32, m: i32) -> bool {","pub fn is_sub_array(a: Vec, b: Vec, n: i32, m: i32) -> bool {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'is_sub_array', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(a: Vec, b: Vec, n: i32, m: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, b, n, m), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 4, 3, 5]), Vec::from([1, 2]), 4, 2, \n false\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 1]), Vec::from([1, 2, 1]), 3, 3, \n true\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 0, 2, 2]), Vec::from([2, 2, 0]), 4, 3, \n false\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 577,MBPP/577,Rust,Write a rust function to find the last digit in factorial of a given number.,"/// Write a rust function to find the last digit in factorial of a given number. pub fn last_digit_factorial(n: i32) -> i32 {",pub fn last_digit_factorial(n: i32) -> i32 {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'last_digit_factorial', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 4, \n 4\n ));\n \n println!(""TEST-1...{}"", driver(\n 21, \n 0\n ));\n \n println!(""TEST-2...{}"", driver(\n 30, \n 0\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 578,MBPP/578,Rust,Write a function to interleave vectors of the same length.,"/// Write a function to interleave vectors of the same length. pub fn interleave_lists(list1: Vec, list2: Vec, list3: Vec) -> Vec {","pub fn interleave_lists(list1: Vec, list2: Vec, list3: Vec) -> Vec {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'interleave_lists', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec, list2: Vec, list3: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1, list2, list3), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6, 7]), Vec::from([10, 20, 30, 40, 50, 60, 70]), Vec::from([100, 200, 300, 400, 500, 600, 700]), \n Vec::from([1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([10, 20]), Vec::from([15, 2]), Vec::from([5, 10]), \n Vec::from([10, 15, 5, 20, 2, 10])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([11, 44]), Vec::from([10, 15]), Vec::from([20, 5]), \n Vec::from([11, 10, 20, 44, 15, 5])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 579,MBPP/579,Rust,Write a function to find the dissimilar elements in the given two tuples.,"/// Write a function to find the dissimilar elements in the given two tuples. pub fn find_dissimilar(test_tup1: Vec, test_tup2: Vec) -> Vec {","pub fn find_dissimilar(test_tup1: Vec, test_tup2: Vec) -> Vec {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_dissimilar', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(test_tup1: Vec, test_tup2: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([3, 4, 5, 6]), Vec::from([5, 7, 4, 10]), \n Vec::from([3, 6, 7, 10])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4]), Vec::from([7, 2, 3, 9]), \n Vec::from([1, 4, 7, 9])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([21, 11, 25, 26]), Vec::from([26, 34, 21, 36]), \n Vec::from([34, 36, 11, 25])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 581,MBPP/581,Rust,Write a rust function to find the surface area of the square pyramid.,"/// Write a rust function to find the surface area of the square pyramid. pub fn surface_area(b: i32, s: i32) -> i32 {","pub fn surface_area(b: i32, s: i32) -> i32 {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'surface_area', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(b: i32, s: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(b, s), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 3, 4, \n 33\n ));\n \n println!(""TEST-1...{}"", driver(\n 4, 5, \n 56\n ));\n \n println!(""TEST-2...{}"", driver(\n 1, 2, \n 5\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 583,MBPP/583,Rust,Write a function for nth catalan number.,"/// Write a function for nth catalan number. pub fn catalan_number(num: i32) -> i32 {",pub fn catalan_number(num: i32) -> i32 {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'catalan_number', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(num: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(num), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 10, \n 16796\n ));\n \n println!(""TEST-1...{}"", driver(\n 9, \n 4862\n ));\n \n println!(""TEST-2...{}"", driver(\n 7, \n 429\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 584,MBPP/584,Rust,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/// Write a function to find all adverbs and their positions in a given sentence by using regex. pub fn find_adverbs(text: String) -> String {",pub fn find_adverbs(text: String) -> String {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_adverbs', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(text: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(text), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""Clearly, he has no excuse for such behavior."".to_string(), \n ""0-7: Clearly"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""Please handle the situation carefuly"".to_string(), \n ""28-36: carefuly"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""Complete the task quickly"".to_string(), \n ""18-25: quickly"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 586,MBPP/586,Rust,Write a rust function to split the array and add the first part to the end.,"/// Write a rust function to split the array and add the first part to the end. pub fn split_arr(a: Vec, n: i32, k: i32) -> Vec {","pub fn split_arr(a: Vec, n: i32, k: i32) -> Vec {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'split_arr', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(a: Vec, n: i32, k: i32, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, n, k), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([12, 10, 5, 6, 52, 36]), 6, 2, \n Vec::from([5, 6, 52, 36, 12, 10])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4]), 4, 1, \n Vec::from([2, 3, 4, 1])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([0, 1, 2, 3, 4, 5, 6, 7]), 8, 3, \n Vec::from([3, 4, 5, 6, 7, 0, 1, 2])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 587,MBPP/587,Rust,Write a function to convert vector to a tuple.,"/// Write a function to convert vector to a tuple. pub fn list_tuple(listx: Vec) -> Vec {",pub fn list_tuple(listx: Vec) -> Vec {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'list_tuple', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(listx: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(listx), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([5, 10, 7, 4, 15, 3]), \n Vec::from([5, 10, 7, 4, 15, 3])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([2, 4, 5, 6, 2, 3, 4, 4, 7]), \n Vec::from([2, 4, 5, 6, 2, 3, 4, 4, 7])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([58, 44, 56]), \n Vec::from([58, 44, 56])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 588,MBPP/588,Rust,Write a rust function to find the difference between largest and smallest value in a given array.,"/// Write a rust function to find the difference between largest and smallest value in a given array. pub fn big_diff(nums: Vec) -> i32 {",pub fn big_diff(nums: Vec) -> i32 {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'big_diff', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(nums: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(nums), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 2, 3, 4]), \n 3\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([4, 5, 12]), \n 8\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([9, 2, 3]), \n 7\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 589,MBPP/589,Rust,Write a function to find perfect squares between two given numbers.,"/// Write a function to find perfect squares between two given numbers. pub fn perfect_squares(a: i32, b: i32) -> Vec {","pub fn perfect_squares(a: i32, b: i32) -> Vec {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'perfect_squares', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(a: i32, b: i32, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 1, 30, \n Vec::from([1, 4, 9, 16, 25])\n ));\n \n println!(""TEST-1...{}"", driver(\n 50, 100, \n Vec::from([64, 81, 100])\n ));\n \n println!(""TEST-2...{}"", driver(\n 100, 200, \n Vec::from([100, 121, 144, 169, 196])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 591,MBPP/591,Rust,Write a rust function to interchange the first and last elements in vector.,"/// Write a rust function to interchange the first and last elements in vector. pub fn swap_list(newlist: Vec) -> Vec {",pub fn swap_list(newlist: Vec) -> Vec {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'swap_list', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: Vec, expected: Vec)->bool{\nreturn actual==expected\n}\npub fn driver(newlist: Vec, expected: Vec)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(newlist), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([12, 35, 9, 56, 24]), \n Vec::from([24, 35, 9, 56, 12])\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3]), \n Vec::from([3, 2, 1])\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([4, 5, 6]), \n Vec::from([6, 5, 4])\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 592,MBPP/592,Rust,Write a rust function to find sum of product of binomial co-efficients.,"/// Write a rust function to find sum of product of binomial co-efficients. pub fn sum_of_product(n: i32) -> i32 {",pub fn sum_of_product(n: i32) -> i32 {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'sum_of_product', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 3, \n 15\n ));\n \n println!(""TEST-1...{}"", driver(\n 4, \n 56\n ));\n \n println!(""TEST-2...{}"", driver(\n 1, \n 1\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 593,MBPP/593,Rust,Write a function to remove leading zeroes from an ip address.,"/// Write a function to remove leading zeroes from an ip address. pub fn removezero_ip(ip: String) -> String {",pub fn removezero_ip(ip: String) -> String {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'removezero_ip', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: String, expected: String)->bool{\nreturn actual==expected\n}\npub fn driver(ip: String, expected: String)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(ip), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n ""216.08.094.196"".to_string(), \n ""216.8.94.196"".to_string()\n ));\n \n println!(""TEST-1...{}"", driver(\n ""12.01.024"".to_string(), \n ""12.1.24"".to_string()\n ));\n \n println!(""TEST-2...{}"", driver(\n ""216.08.094.0196"".to_string(), \n ""216.8.94.196"".to_string()\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 594,MBPP/594,Rust,Write a function to find the difference of first even and odd number of a given vector.,"/// Write a function to find the difference of first even and odd number of a given vector. pub fn diff_even_odd(list1: Vec) -> i32 {",pub fn diff_even_odd(list1: Vec) -> i32 {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'diff_even_odd', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(list1: Vec, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(list1), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([1, 3, 5, 7, 4, 1, 6, 8]), \n 3\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), \n 1\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([1, 5, 7, 9, 10]), \n 9\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 597,MBPP/597,Rust,Write a function to find kth element from the given two sorted arrays.,"/// Write a function to find kth element from the given two sorted arrays. pub fn find_kth(arr1: Vec, arr2: Vec, m: i32, n: i32, k: i32) -> i32 {","pub fn find_kth(arr1: Vec, arr2: Vec, m: i32, n: i32, k: i32) -> i32 {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'find_kth', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: i32, expected: i32)->bool{\nreturn actual==expected\n}\npub fn driver(arr1: Vec, arr2: Vec, m: i32, n: i32, k: i32, expected: i32)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n Vec::from([2, 3, 6, 7, 9]), Vec::from([1, 4, 8, 10]), 5, 4, 5, \n 6\n ));\n \n println!(""TEST-1...{}"", driver(\n Vec::from([100, 112, 256, 349, 770]), Vec::from([72, 86, 113, 119, 265, 445, 892]), 5, 7, 7, \n 256\n ));\n \n println!(""TEST-2...{}"", driver(\n Vec::from([3, 4, 7, 8, 10]), Vec::from([2, 5, 9, 11]), 5, 4, 6, \n 8\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 598,MBPP/598,Rust,Write a function to check whether the given number is armstrong or not.,"/// Write a function to check whether the given number is armstrong or not. pub fn armstrong_number(number: i32) -> bool {",pub fn armstrong_number(number: i32) -> bool {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'armstrong_number', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(number: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(number), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 153, \n true\n ));\n \n println!(""TEST-1...{}"", driver(\n 259, \n false\n ));\n \n println!(""TEST-2...{}"", driver(\n 4458, \n false\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 600,MBPP/600,Rust,Write a rust function to check whether the given number is even or not using bitwise operator.,"/// Write a rust function to check whether the given number is even or not using bitwise operator. pub fn is_even(n: i32) -> bool {",pub fn is_even(n: i32) -> bool {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'rs', 'entry_fn_name': 'is_even', 'test_code': 'use std::collections::HashMap;\nuse std::collections::HashSet;\nuse std::cmp::*;\nuse std::collections::*;\nuse std::fmt::*; \n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\npub fn validate_solution(actual: bool, expected: bool)->bool{\nreturn actual==expected\n}\npub fn driver(n: i32, expected: bool)->String{\n if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {\n return ""PASSED"".to_string();\n };\n return ""FAILED"".to_string();\n\n}\n\nfn main() {\n println!(""TEST-0...{}"", driver(\n 1, \n false\n ));\n \n println!(""TEST-1...{}"", driver(\n 2, \n true\n ));\n \n println!(""TEST-2...{}"", driver(\n 3, \n false\n ));\n \n}', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['rustc', '__FILENAME__', '-o', './__FILENAME__.exe'], ['./__FILENAME__.exe']], 'timeouts': [10, 10]}" 511,MBPP/511,Scala,Write a scala function to find minimum sum of factors of a given number.,"/** * Write a scala function to find minimum sum of factors of a given number. */ def findMinSum(num: Int) = {",def findMinSum(num: Int) = {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findMinSum', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(num: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 12, \n 7 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 105, \n 15 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 2, \n 2 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 514,MBPP/514,Scala,Write a function to find the summation of tuple elements in the given tuple list.,"/** * Write a function to find the summation of tuple elements in the given tuple list. */ def sumElements(test_tup: List[Int]) = {",def sumElements(test_tup: List[Int]) = {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'sumElements', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(test_tup: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(7, 8, 9, 1, 10, 7), \n 42 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4, 5, 6), \n 21 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(11, 12, 13, 45, 14), \n 95 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 515,MBPP/515,Scala,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ def modularSum(arr: List[Int], n: Int, m: Int) = {","def modularSum(arr: List[Int], n: Int, m: Int) = {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'modularSum', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, m: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(3, 1, 7, 5), 4, 6, \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 7), 2, 5, \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 6), 2, 5, \n false \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 516,MBPP/516,Scala,Write a function to sort a list of elements using radix sort.,"/** * Write a function to sort a list of elements using radix sort. */ def radixSort(nums: List[Int]) = {",def radixSort(nums: List[Int]) = {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'radixSort', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(nums: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(15, 79, 25, 68, 37), \n List(15, 25, 37, 68, 79) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(9, 11, 8, 7, 3, 2), \n List(2, 3, 7, 8, 9, 11) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(36, 12, 24, 26, 29), \n List(12, 24, 26, 29, 36) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 517,MBPP/517,Scala,Write a scala function to find the largest postive number from the given list.,"/** * Write a scala function to find the largest postive number from the given list. */ def largestPos(list1: List[Int]) = {",def largestPos(list1: List[Int]) = {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'largestPos', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 4, -1), \n 4 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(0, 1, 2, -5, -1, 6), \n 6 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(0, 0, 1, 0), \n 1 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 518,MBPP/518,Scala,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ def sqrtRoot(num: Int) = {",def sqrtRoot(num: Int) = {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'sqrtRoot', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(num: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 4, \n 2 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 16, \n 4 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 400, \n 20 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 519,MBPP/519,Scala,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ def volumeTetrahedron(num: Int) = {",def volumeTetrahedron(num: Int) = {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'volumeTetrahedron', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Float , expected: Float): Boolean = {\n (actual - expected).abs < 1e-06F\n}\n\ndef driver(num: Int, expected: Float): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 10, \n 117.85F \n )}"") \n\n\n println(s""TEST-1...${driver(\n 15, \n 397.75F \n )}"") \n\n\n println(s""TEST-2...${driver(\n 20, \n 942.81F \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 520,MBPP/520,Scala,Write a function to find the lcm of the given array elements.,"/** * Write a function to find the lcm of the given array elements. */ def getLcm(l: List[Int]) = {",def getLcm(l: List[Int]) = {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'getLcm', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(l: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(l),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(2, 7, 3, 9, 4), \n 252 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 8, 3), \n 24 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(3, 8, 4, 10, 5), \n 120 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 521,MBPP/521,Scala,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ def checkIsosceles(x: Int, y: Int, z: Int) = {","def checkIsosceles(x: Int, y: Int, z: Int) = {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'checkIsosceles', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(x: Int, y: Int, z: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 6, 8, 12, \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n 6, 6, 12, \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n 6, 15, 20, \n true \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 522,MBPP/522,Scala,Write a function to find the longest bitonic subsequence for the given array.,"/** * Write a function to find the longest bitonic subsequence for the given array. */ def lbs(arr: List[Int]) = {",def lbs(arr: List[Int]) = {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'lbs', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15), \n 7 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 11, 2, 10, 4, 5, 2, 1), \n 6 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(80, 60, 30, 40, 20, 10), \n 5 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 523,MBPP/523,Scala,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ def checkString(str1: String) = {",def checkString(str1: String) = {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'checkString', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[String] , expected: List[String]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(str1: String, expected: List[String]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""python"", \n List(""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8."") \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""123python"", \n List(""String must have 1 upper case character."") \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""123Python"", \n List(""Valid string."") \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 524,MBPP/524,Scala,Write a function to find the sum of maximum increasing subsequence of the given array.,"/** * Write a function to find the sum of maximum increasing subsequence of the given array. */ def maxSumIncreasingSubsequence(arr: List[Int], n: Int) = {","def maxSumIncreasingSubsequence(arr: List[Int], n: Int) = {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 101, 2, 3, 100, 4, 5), 7, \n 106 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(3, 4, 5, 10), 4, \n 22 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(10, 5, 4, 3), 4, \n 10 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 525,MBPP/525,Scala,Write a scala function to check whether two given lines are parallel or not.,"/** * Write a scala function to check whether two given lines are parallel or not. */ def parallelLines(line1: List[Int], line2: List[Int]) = {","def parallelLines(line1: List[Int], line2: List[Int]) = {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'parallelLines', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(line1: List[Int], line2: List[Int], expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(2, 3, 4), List(2, 3, 8), \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(2, 3, 4), List(4, -3, 8), \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(3, 3), List(5, 5), \n true \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 526,MBPP/526,Scala,Write a scala function to capitalize first and last letters of each word of a given string.,"/** * Write a scala function to capitalize first and last letters of each word of a given string. */ def capitalizeFirstLastLetters(str1: String) = {",def capitalizeFirstLastLetters(str1: String) = {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(str1: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""python"", \n ""PythoN"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""bigdata"", \n ""BigdatA"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""Hadoop"", \n ""HadooP"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 527,MBPP/527,Scala,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ def getPairsCount(arr: List[Int], n: Int, sum: Int) = {","def getPairsCount(arr: List[Int], n: Int, sum: Int) = {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'getPairsCount', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, sum: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 5, 7, -1, 5), 5, 6, \n 3 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 5, 7, -1), 4, 6, \n 2 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 1, 1, 1), 4, 2, \n 6 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 529,MBPP/529,Scala,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ def jacobsthalLucas(n: Int) = {",def jacobsthalLucas(n: Int) = {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'jacobsthalLucas', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 5, \n 31 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 2, \n 5 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 4, \n 17 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 530,MBPP/530,Scala,Write a function to find the ration of negative numbers in an array of integers.,"/** * Write a function to find the ration of negative numbers in an array of integers. */ def negativeCount(nums: List[Int]) = {",def negativeCount(nums: List[Int]) = {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'negativeCount', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Float , expected: Float): Boolean = {\n (actual - expected).abs < 1e-06F\n}\n\ndef driver(nums: List[Int], expected: Float): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8), \n 0.31F \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8), \n 0.31F \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(2, 4, -6, -9, 11, -12, 14, -5, 17), \n 0.44F \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 531,MBPP/531,Scala,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ def minCoins(coins: List[Int], m: Int, v: Int) = {","def minCoins(coins: List[Int], m: Int, v: Int) = {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'minCoins', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(coins: List[Int], m: Int, v: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(9, 6, 5, 1), 4, 11, \n 2 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(4, 5, 6, 7, 8, 9), 6, 9, \n 1 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3), 3, 4, \n 2 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 532,MBPP/532,Scala,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ def checkPermutation(str1: String, str2: String) = {","def checkPermutation(str1: String, str2: String) = {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'checkPermutation', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(str1: String, str2: String, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""abc"", ""cba"", \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""test"", ""ttew"", \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""xxyz"", ""yxzx"", \n true \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 534,MBPP/534,Scala,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ def searchLiteral(pattern: String, text: String) = {","def searchLiteral(pattern: String, text: String) = {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'searchLiteral', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(pattern: String, text: String, expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""python"", ""python programming language"", \n List(0, 6) \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""programming"", ""python programming language"", \n List(7, 18) \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""language"", ""python programming language"", \n List(19, 27) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 535,MBPP/535,Scala,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ def topbottomSurfacearea(r: Int) = {",def topbottomSurfacearea(r: Int) = {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Double , expected: Double): Boolean = {\n (actual - expected).abs < 1e-09\n}\n\ndef driver(r: Int, expected: Double): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(r),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 10, \n 314.15000000000003 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 5, \n 78.53750000000001 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 4, \n 50.264 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 536,MBPP/536,Scala,Write a function to select the nth items of a list.,"/** * Write a function to select the nth items of a list. */ def nthItems(list: List[Int], n: Int) = {","def nthItems(list: List[Int], n: Int) = {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'nthItems', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list: List[Int], n: Int, expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 4, 5, 6, 7, 8, 9), 2, \n List(1, 3, 5, 7, 9) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(10, 15, 19, 17, 16, 18), 3, \n List(10, 17) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(14, 16, 19, 15, 17), 4, \n List(14, 17) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 537,MBPP/537,Scala,Write a scala function to find the first repeated word in a given string.,"/** * Write a scala function to find the first repeated word in a given string. */ def firstRepeatedWord(str1: String) = {",def firstRepeatedWord(str1: String) = {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'firstRepeatedWord', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(str1: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""ab ca bc ab"", \n ""ab"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""ab ca bc"", \n ""None"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""ab ca bc ca ab bc"", \n ""ca"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 538,MBPP/538,Scala,Write a scala function to convert a given string list to a tuple.,"/** * Write a scala function to convert a given string list to a tuple. */ def stringListToTuple(str1: String) = {",def stringListToTuple(str1: String) = {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'stringListToTuple', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Char] , expected: List[Char]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(str1: String, expected: List[Char]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""python 3.0"", \n List(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\') \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""bigdata"", \n List(\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\') \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""language"", \n List(\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\') \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 539,MBPP/539,Scala,Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.,"/** * Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function. */ def basesnumCoresspondingnum(bases_num: List[Int], index: List[Int]) = {","def basesnumCoresspondingnum(bases_num: List[Int], index: List[Int]) = {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Long] , expected: List[Long]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(bases_num: List[Int], index: List[Int], expected: List[Long]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(10, 20, 30, 40, 50, 60, 70, 80, 90, 100), List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), \n List(10L, 400L, 27000L, 2560000L, 312500000L, 46656000000L, 8235430000000L, 1677721600000000L, 387420489000000000L, 100000000000000000000L) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4, 5, 6, 7), List(10, 20, 30, 40, 50, 60, 70), \n List(1L, 1048576L, 205891132094649L, 1208925819614629174706176L, 88817841970012523233890533447265625L, 48873677980689257489322752273774603865660850176L, 143503601609868434285603076356671071740077383739246066639249L) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(4, 8, 12, 16, 20, 24, 28), List(3, 6, 9, 12, 15, 18, 21), \n List(64L, 262144L, 5159780352L, 281474976710656L, 32768000000000000000L, 6979147079584381377970176L, 2456510688823056210273111113728L) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 540,MBPP/540,Scala,Write a scala function to find the difference between highest and least frequencies in a given array.,"/** * Write a scala function to find the difference between highest and least frequencies in a given array. */ def findDiff(arr: List[Int], n: Int) = {","def findDiff(arr: List[Int], n: Int) = {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findDiff', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 1, 2, 2, 7, 8, 4, 5, 1, 4), 10, \n 2 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 7, 9, 2, 3, 3, 1, 3, 3), 9, \n 3 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 1, 2), 4, \n 0 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 541,MBPP/541,Scala,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ def checkAbundant(n: Int) = {",def checkAbundant(n: Int) = {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'checkAbundant', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 12, \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n 15, \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n 18, \n true \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 542,MBPP/542,Scala,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ def fillSpaces(text: String) = {",def fillSpaces(text: String) = {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'fillSpaces', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(text: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""Boult Curve Wireless Neckband"", \n ""Boult:Curve:Wireless:Neckband"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""Stereo Sound Sweatproof"", \n ""Stereo:Sound:Sweatproof"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""Probass Curve Audio"", \n ""Probass:Curve:Audio"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 543,MBPP/543,Scala,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ def countDigits(num1: Long, num2: Int) = {","def countDigits(num1: Long, num2: Int) = {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'countDigits', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(num1: Long, num2: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 9875L, 10, \n 4 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 98759853034L, 100, \n 11 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 1234567L, 500, \n 7 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 545,MBPP/545,Scala,Write a scala function to toggle only first and last bits of a given number.,"/** * Write a scala function to toggle only first and last bits of a given number. */ def toggleFAndLBits(n: Int) = {",def toggleFAndLBits(n: Int) = {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'toggleFAndLBits', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 10, \n 3 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 15, \n 6 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 20, \n 5 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 546,MBPP/546,Scala,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ def lastOccurenceChar(string_arg0: String, char_arg1: Char) = {","def lastOccurenceChar(string_arg0: String, char_arg1: Char) = {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'lastOccurenceChar', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(string_arg0: String, char_arg1: Char, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""hello world"", \'l\', \n 10 \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""language"", \'g\', \n 7 \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""little"", \'y\', \n None \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 547,MBPP/547,Scala,Write a scala function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a scala function to find the sum of hamming distances of all consecutive numbers from o to n. */ def totalHammingDistance(n: Int) = {",def totalHammingDistance(n: Int) = {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'totalHammingDistance', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 4, \n 7 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 2, \n 3 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 5, \n 8 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 548,MBPP/548,Scala,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ def longestIncreasingSubsequence(arr: List[Int]) = {",def longestIncreasingSubsequence(arr: List[Int]) = {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(10, 22, 9, 33, 21, 50, 41, 60), \n 5 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(3, 10, 2, 1, 20), \n 3 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(50, 3, 10, 7, 40, 80), \n 4 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 549,MBPP/549,Scala,Write a scala function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a scala function to find the sum of fifth power of first n odd natural numbers. */ def oddNumSum(n: Int) = {",def oddNumSum(n: Int) = {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'oddNumSum', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 1, \n 1 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 2, \n 244 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 3, \n 3369 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 550,MBPP/550,Scala,Write a scala function to find the maximum element in a sorted and rotated array.,"/** * Write a scala function to find the maximum element in a sorted and rotated array. */ def findMax(arr: List[Int], low: Int, high: Int) = {","def findMax(arr: List[Int], low: Int, high: Int) = {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findMax', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], low: Int, high: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(2, 3, 5, 6, 9), 0, 4, \n 9 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(3, 4, 5, 2, 1), 0, 4, \n 5 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3), 0, 2, \n 3 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 551,MBPP/551,Scala,Write a function to extract a specified column from a given nested list.,"/** * Write a function to extract a specified column from a given nested list. */ def extractColumn(list1: List[List[Int]], n: Int) = {","def extractColumn(list1: List[List[Int]], n: Int) = {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'extractColumn', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[List[Int]], n: Int, expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(List(1, 2, 3), List(2, 4, 5), List(1, 1, 1)), 0, \n List(1, 2, 1) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(List(1, 2, 3), List(-2, 4, -5), List(1, -1, 1)), 2, \n List(3, -5, 1) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(List(1, 3), List(5, 7), List(1, 3), List(13, 15, 17), List(5, 7), List(9, 11)), 0, \n List(1, 5, 1, 13, 5, 9) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 552,MBPP/552,Scala,Write a scala function to check whether a given sequence is linear or not.,"/** * Write a scala function to check whether a given sequence is linear or not. */ def seqLinear(seq_nums: List[Int]) = {",def seqLinear(seq_nums: List[Int]) = {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'seqLinear', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(seq_nums: List[Int], expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(0, 2, 4, 6, 8, 10), \n ""Linear Sequence"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3), \n ""Linear Sequence"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 5, 2), \n ""Non Linear Sequence"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 553,MBPP/553,Scala,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ def tupleToFloat(test_tup: List[Int]) = {",def tupleToFloat(test_tup: List[Int]) = {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'tupleToFloat', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Float , expected: Float): Boolean = {\n (actual - expected).abs < 1e-06F\n}\n\ndef driver(test_tup: List[Int], expected: Float): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(4, 56), \n 4.56F \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(7, 256), \n 7.256F \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(8, 123), \n 8.123F \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 554,MBPP/554,Scala,Write a scala function to find odd numbers from a mixed list.,"/** * Write a scala function to find odd numbers from a mixed list. */ def split(list: List[Int]) = {",def split(list: List[Int]) = {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'split', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 4, 5, 6), \n List(1, 3, 5) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(10, 11, 12, 13), \n List(11, 13) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(7, 8, 9, 1), \n List(7, 9, 1) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 555,MBPP/555,Scala,Write a scala function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a scala function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ def difference(n: Int) = {",def difference(n: Int) = {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'difference', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 3, \n 30 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 5, \n 210 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 2, \n 6 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 556,MBPP/556,Scala,Write a scala function to count the pairs with xor as an odd number.,"/** * Write a scala function to count the pairs with xor as an odd number. */ def findOddPair(a: List[Int], n: Int) = {","def findOddPair(a: List[Int], n: Int) = {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findOddPair', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: List[Int], n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(5, 4, 7, 2, 1), 5, \n 6 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(7, 2, 8, 1, 0, 5, 11), 7, \n 12 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3), 3, \n 2 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 557,MBPP/557,Scala,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ def toggleString(string_arg0: String) = {",def toggleString(string_arg0: String) = {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'toggleString', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(string_arg0: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""Python"", \n ""pYTHON"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""Pangram"", \n ""pANGRAM"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""LIttLE"", \n ""liTTle"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 558,MBPP/558,Scala,Write a scala function to find the digit distance between two integers.,"/** * Write a scala function to find the digit distance between two integers. */ def digitDistanceNums(n1: Int, n2: Int) = {","def digitDistanceNums(n1: Int, n2: Int) = {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'digitDistanceNums', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n1: Int, n2: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 1, 2, \n 1 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 23, 56, \n 6 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 123, 256, \n 7 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 559,MBPP/559,Scala,Write a function to find the largest sum of contiguous subarray in the given array.,"/** * Write a function to find the largest sum of contiguous subarray in the given array. */ def maxSubArraySum(a: List[Int], size: Int) = {","def maxSubArraySum(a: List[Int], size: Int) = {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'maxSubArraySum', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: List[Int], size: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(-2, -3, 4, -1, -2, 1, 5, -3), 8, \n 7 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(-3, -4, 5, -2, -3, 2, 6, -4), 8, \n 8 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(-4, -5, 6, -3, -4, 3, 7, -5), 8, \n 10 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 560,MBPP/560,Scala,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ def unionElements(test_tup1: List[Int], test_tup2: List[Int]) = {","def unionElements(test_tup1: List[Int], test_tup2: List[Int]) = {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'unionElements', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(test_tup1: List[Int], test_tup2: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(3, 4, 5, 6), List(5, 7, 4, 10), \n List(3, 4, 5, 6, 7, 10) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4), List(3, 4, 5, 6), \n List(1, 2, 3, 4, 5, 6) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(11, 12, 13, 14), List(13, 15, 16, 17), \n List(11, 12, 13, 14, 15, 16, 17) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 562,MBPP/562,Scala,Write a scala function to find the maximum length of sublist.,"/** * Write a scala function to find the maximum length of sublist. */ def findMaxLength(lst: List[List[Int]]) = {",def findMaxLength(lst: List[List[Int]]) = {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findMaxLength', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(lst: List[List[Int]], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(lst),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(List(1), List(1, 4), List(5, 6, 7, 8)), \n 4 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(List(0, 1), List(2, 2), List(3, 2, 1)), \n 3 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(List(7), List(22, 23), List(13, 14, 15), List(10, 20, 30, 40, 50)), \n 5 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 563,MBPP/563,Scala,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ def extractValues(text: String) = {",def extractValues(text: String) = {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'extractValues', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[String] , expected: List[String]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(text: String, expected: List[String]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", \n List(""Python"", ""PHP"", ""Java"") \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""\\""python\\"",\\""program\\"",\\""language\\"""", \n List(""python"", ""program"", ""language"") \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", \n List(""red"", ""blue"", ""green"", ""yellow"") \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 564,MBPP/564,Scala,Write a scala function to count unequal element pairs from the given array.,"/** * Write a scala function to count unequal element pairs from the given array. */ def countPairs(arr: List[Int], n: Int) = {","def countPairs(arr: List[Int], n: Int) = {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'countPairs', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 1), 3, \n 2 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 1, 1, 1), 4, \n 0 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3, 4, 5), 5, \n 10 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 565,MBPP/565,Scala,Write a scala function to split a string into characters.,"/** * Write a scala function to split a string into characters. */ def split(word: String) = {",def split(word: String) = {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'split', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Char] , expected: List[Char]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(word: String, expected: List[Char]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(word),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""python"", \n List(\'p\', \'y\', \'t\', \'h\', \'o\', \'n\') \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""Name"", \n List(\'N\', \'a\', \'m\', \'e\') \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""program"", \n List(\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\') \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 566,MBPP/566,Scala,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ def sumDigits(n: Int) = {",def sumDigits(n: Int) = {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'sumDigits', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 345, \n 12 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 12, \n 3 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 97, \n 16 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 567,MBPP/567,Scala,Write a function to check whether a specified list is sorted or not.,"/** * Write a function to check whether a specified list is sorted or not. */ def issortList(list1: List[Int]) = {",def issortList(list1: List[Int]) = {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'issortList', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[Int], expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 4, 6, 8, 10, 12, 14, 16, 17), \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 4, 6, 8, 10, 12, 14, 20, 17), \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 4, 6, 8, 10, 15, 14, 20), \n false \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 569,MBPP/569,Scala,Write a function to sort each sublist of strings in a given list of lists.,"/** * Write a function to sort each sublist of strings in a given list of lists. */ def sortSublists(list1: List[List[String]]) = {",def sortSublists(list1: List[List[String]]) = {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'sortSublists', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[List[String]] , expected: List[List[String]]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[List[String]], expected: List[List[String]]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(List(""green"", ""orange""), List(""black"", ""white""), List(""white"", ""black"", ""orange"")), \n List(List(""green"", ""orange""), List(""black"", ""white""), List(""black"", ""orange"", ""white"")) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(List(""green"", ""orange""), List(""black""), List(""green"", ""orange""), List(""white"")), \n List(List(""green"", ""orange""), List(""black""), List(""green"", ""orange""), List(""white"")) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(List(""a"", ""b""), List(""d"", ""c""), List(""g"", ""h""), List(""f"", ""e"")), \n List(List(""a"", ""b""), List(""c"", ""d""), List(""g"", ""h""), List(""e"", ""f"")) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 570,MBPP/570,Scala,Write a function to remove words from a given list of strings containing a character or string.,"/** * Write a function to remove words from a given list of strings containing a character or string. */ def removeWords(list1: List[String], charlist: List[String]) = {","def removeWords(list1: List[String], charlist: List[String]) = {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'removeWords', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[String] , expected: List[String]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[String], charlist: List[String], expected: List[String]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""), List(""#"", ""color"", ""@""), \n List(""Red"", """", ""Green"", ""Orange"", ""White"") \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), List(""&"", ""+"", ""@""), \n List(""Red"", """", ""Green"", ""Orange"", ""White"") \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""), List(""@""), \n List(""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White"") \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 571,MBPP/571,Scala,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ def maxSumPairDiffLessthanK(arr: List[Int], n: Int, k: Int) = {","def maxSumPairDiffLessthanK(arr: List[Int], n: Int, k: Int) = {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr: List[Int], n: Int, k: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(3, 5, 10, 15, 17, 12, 9), 7, 4, \n 62 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(5, 15, 10, 300), 4, 12, \n 25 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3, 4, 5, 6), 6, 6, \n 21 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 572,MBPP/572,Scala,Write a scala function to remove two duplicate numbers from a given number of lists.,"/** * Write a scala function to remove two duplicate numbers from a given number of lists. */ def twoUniqueNums(nums: List[Int]) = {",def twoUniqueNums(nums: List[Int]) = {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'twoUniqueNums', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(nums: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 2, 3, 4, 5), \n List(1, 4, 5) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 2, 4, 5), \n List(1, 3, 4, 5) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 2, 3, 4, 5), \n List(1, 2, 3, 4, 5) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 573,MBPP/573,Scala,Write a scala function to calculate the product of the unique numbers of a given list.,"/** * Write a scala function to calculate the product of the unique numbers of a given list. */ def uniqueProduct(list_data: List[Int]) = {",def uniqueProduct(list_data: List[Int]) = {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'uniqueProduct', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list_data: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(10, 20, 30, 40, 20, 50, 60, 40), \n 720000000 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 1), \n 6 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(7, 8, 9, 0, 1, 1), \n 0 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 574,MBPP/574,Scala,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ def surfaceareaCylinder(r: Int, h: Int) = {","def surfaceareaCylinder(r: Int, h: Int) = {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Double , expected: Double): Boolean = {\n (actual - expected).abs < 1e-09\n}\n\ndef driver(r: Int, h: Int, expected: Double): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 10, 5, \n 942.45 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 4, 5, \n 226.18800000000002 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 4, 10, \n 351.848 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 575,MBPP/575,Scala,Write a scala function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a scala function to find nth number in a sequence which is not a multiple of a given number. */ def countNo(a: Int, n: Int, l: Int, r: Int) = {","def countNo(a: Int, n: Int, l: Int, r: Int) = {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'countNo', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: Int, n: Int, l: Int, r: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 2, 3, 1, 10, \n 5 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 3, 6, 4, 20, \n 11 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 5, 10, 4, 20, \n 16 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 576,MBPP/576,Scala,Write a scala function to check whether an array is subarray of another or not.,"/** * Write a scala function to check whether an array is subarray of another or not. */ def isSubArray(a: List[Int], b: List[Int], n: Int, m: Int) = {","def isSubArray(a: List[Int], b: List[Int], n: Int, m: Int) = {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'isSubArray', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: List[Int], b: List[Int], n: Int, m: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 4, 3, 5), List(1, 2), 4, 2, \n false \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 1), List(1, 2, 1), 3, 3, \n true \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 0, 2, 2), List(2, 2, 0), 4, 3, \n false \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 577,MBPP/577,Scala,Write a scala function to find the last digit in factorial of a given number.,"/** * Write a scala function to find the last digit in factorial of a given number. */ def lastDigitFactorial(n: Int) = {",def lastDigitFactorial(n: Int) = {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'lastDigitFactorial', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 4, \n 4 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 21, \n 0 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 30, \n 0 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 578,MBPP/578,Scala,Write a function to interleave lists of the same length.,"/** * Write a function to interleave lists of the same length. */ def interleaveLists(list1: List[Int], list2: List[Int], list3: List[Int]) = {","def interleaveLists(list1: List[Int], list2: List[Int], list3: List[Int]) = {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'interleaveLists', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[Int], list2: List[Int], list3: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 4, 5, 6, 7), List(10, 20, 30, 40, 50, 60, 70), List(100, 200, 300, 400, 500, 600, 700), \n List(1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(10, 20), List(15, 2), List(5, 10), \n List(10, 15, 5, 20, 2, 10) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(11, 44), List(10, 15), List(20, 5), \n List(11, 10, 20, 44, 15, 5) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 579,MBPP/579,Scala,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ def findDissimilar(test_tup1: List[Int], test_tup2: List[Int]) = {","def findDissimilar(test_tup1: List[Int], test_tup2: List[Int]) = {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findDissimilar', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(test_tup1: List[Int], test_tup2: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(3, 4, 5, 6), List(5, 7, 4, 10), \n List(3, 6, 7, 10) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4), List(7, 2, 3, 9), \n List(1, 4, 7, 9) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(21, 11, 25, 26), List(26, 34, 21, 36), \n List(34, 36, 11, 25) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 581,MBPP/581,Scala,Write a scala function to find the surface area of the square pyramid.,"/** * Write a scala function to find the surface area of the square pyramid. */ def surfaceArea(b: Int, s: Int) = {","def surfaceArea(b: Int, s: Int) = {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'surfaceArea', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(b: Int, s: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 3, 4, \n 33 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 4, 5, \n 56 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 1, 2, \n 5 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 583,MBPP/583,Scala,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ def catalanNumber(num: Int) = {",def catalanNumber(num: Int) = {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'catalanNumber', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(num: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 10, \n 16796 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 9, \n 4862 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 7, \n 429 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 584,MBPP/584,Scala,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ def findAdverbs(text: String) = {",def findAdverbs(text: String) = {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findAdverbs', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(text: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""Clearly, he has no excuse for such behavior."", \n ""0-7: Clearly"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""Please handle the situation carefuly"", \n ""28-36: carefuly"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""Complete the task quickly"", \n ""18-25: quickly"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 586,MBPP/586,Scala,Write a scala function to split the array and add the first part to the end.,"/** * Write a scala function to split the array and add the first part to the end. */ def splitArr(a: List[Int], n: Int, k: Int) = {","def splitArr(a: List[Int], n: Int, k: Int) = {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'splitArr', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: List[Int], n: Int, k: Int, expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(12, 10, 5, 6, 52, 36), 6, 2, \n List(5, 6, 52, 36, 12, 10) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4), 4, 1, \n List(2, 3, 4, 1) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(0, 1, 2, 3, 4, 5, 6, 7), 8, 3, \n List(3, 4, 5, 6, 7, 0, 1, 2) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 587,MBPP/587,Scala,Write a function to convert a list to a tuple.,"/** * Write a function to convert a list to a tuple. */ def listTuple(listx: List[Int]) = {",def listTuple(listx: List[Int]) = {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'listTuple', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(listx: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(listx),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(5, 10, 7, 4, 15, 3), \n List(5, 10, 7, 4, 15, 3) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(2, 4, 5, 6, 2, 3, 4, 4, 7), \n List(2, 4, 5, 6, 2, 3, 4, 4, 7) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(58, 44, 56), \n List(58, 44, 56) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 588,MBPP/588,Scala,Write a scala function to find the difference between largest and smallest value in a given array.,"/** * Write a scala function to find the difference between largest and smallest value in a given array. */ def bigDiff(nums: List[Int]) = {",def bigDiff(nums: List[Int]) = {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'bigDiff', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(nums: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 2, 3, 4), \n 3 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(4, 5, 12), \n 8 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(9, 2, 3), \n 7 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 589,MBPP/589,Scala,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ def perfectSquares(a: Int, b: Int) = {","def perfectSquares(a: Int, b: Int) = {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'perfectSquares', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(a: Int, b: Int, expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 1, 30, \n List(1, 4, 9, 16, 25) \n )}"") \n\n\n println(s""TEST-1...${driver(\n 50, 100, \n List(64, 81, 100) \n )}"") \n\n\n println(s""TEST-2...${driver(\n 100, 200, \n List(100, 121, 144, 169, 196) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 591,MBPP/591,Scala,Write a scala function to interchange the first and last elements in a list.,"/** * Write a scala function to interchange the first and last elements in a list. */ def swapList(newlist: List[Int]) = {",def swapList(newlist: List[Int]) = {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'swapList', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: List[Int] , expected: List[Int]): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(newlist: List[Int], expected: List[Int]): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(12, 35, 9, 56, 24), \n List(24, 35, 9, 56, 12) \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3), \n List(3, 2, 1) \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(4, 5, 6), \n List(6, 5, 4) \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 592,MBPP/592,Scala,Write a scala function to find sum of product of binomial co-efficients.,"/** * Write a scala function to find sum of product of binomial co-efficients. */ def sumOfProduct(n: Int) = {",def sumOfProduct(n: Int) = {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'sumOfProduct', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 3, \n 15 \n )}"") \n\n\n println(s""TEST-1...${driver(\n 4, \n 56 \n )}"") \n\n\n println(s""TEST-2...${driver(\n 1, \n 1 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 593,MBPP/593,Scala,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ def removezeroIp(ip: String) = {",def removezeroIp(ip: String) = {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'removezeroIp', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: String , expected: String): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(ip: String, expected: String): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(ip),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n ""216.08.094.196"", \n ""216.8.94.196"" \n )}"") \n\n\n println(s""TEST-1...${driver(\n ""12.01.024"", \n ""12.1.24"" \n )}"") \n\n\n println(s""TEST-2...${driver(\n ""216.08.094.0196"", \n ""216.8.94.196"" \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 594,MBPP/594,Scala,Write a function to find the difference of first even and odd number of a given list.,"/** * Write a function to find the difference of first even and odd number of a given list. */ def diffEvenOdd(list1: List[Int]) = {",def diffEvenOdd(list1: List[Int]) = {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'diffEvenOdd', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(list1: List[Int], expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(1, 3, 5, 7, 4, 1, 6, 8), \n 3 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), \n 1 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(1, 5, 7, 9, 10), \n 9 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 597,MBPP/597,Scala,Write a function to find kth element from the given two sorted arrays.,"/** * Write a function to find kth element from the given two sorted arrays. */ def findKth(arr1: List[Int], arr2: List[Int], m: Int, n: Int, k: Int) = {","def findKth(arr1: List[Int], arr2: List[Int], m: Int, n: Int, k: Int) = {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'findKth', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Int , expected: Int): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(arr1: List[Int], arr2: List[Int], m: Int, n: Int, k: Int, expected: Int): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n List(2, 3, 6, 7, 9), List(1, 4, 8, 10), 5, 4, 5, \n 6 \n )}"") \n\n\n println(s""TEST-1...${driver(\n List(100, 112, 256, 349, 770), List(72, 86, 113, 119, 265, 445, 892), 5, 7, 7, \n 256 \n )}"") \n\n\n println(s""TEST-2...${driver(\n List(3, 4, 7, 8, 10), List(2, 5, 9, 11), 5, 4, 6, \n 8 \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 598,MBPP/598,Scala,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ def armstrongNumber(number: Int) = {",def armstrongNumber(number: Int) = {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'armstrongNumber', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(number: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(number),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 153, \n true \n )}"") \n\n\n println(s""TEST-1...${driver(\n 259, \n false \n )}"") \n\n\n println(s""TEST-2...${driver(\n 4458, \n false \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 600,MBPP/600,Scala,Write a scala function to check whether the given number is even or not using bitwise operator.,"/** * Write a scala function to check whether the given number is even or not using bitwise operator. */ def isEven(n: Int) = {",def isEven(n: Int) = {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'scala', 'entry_fn_name': 'isEven', 'test_code': 'import scala.collection.mutable.HashMap\nimport scala.collection.immutable.HashSet\n\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n\n// TESTING CODE \n// ============================================\ndef validateSolution(actual: Boolean , expected: Boolean): Boolean = {\n actual.toString == expected.toString\n}\n\ndef driver(n: Int, expected: Boolean): String = {\n try {\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {\n ""PASSED""\n } else{\n ""FAILED""\n }\n }catch{\n case e: Exception => {e.getClass.getName}\n }\n\n}\nobject QuestionEvaluator extends App {\n\n println(s""TEST-0...${driver(\n 1, \n false \n )}"") \n\n\n println(s""TEST-1...${driver(\n 2, \n true \n )}"") \n\n\n println(s""TEST-2...${driver(\n 3, \n false \n )}"") \n\n}\n', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['scalac', '-d', 'evaluation.jar', '__FILENAME__'], ['scala', '-d', 'evaluation.jar', 'QuestionEvaluator']], 'timeouts': [15, 10]}" 511,MBPP/511,TypeScript,Write a typescript function to find minimum sum of factors of a given number.,"/** * Write a typescript function to find minimum sum of factors of a given number. */ function findMinSum(num: number): number {",function findMinSum(num: number): number {,['num'],"def find_Min_Sum(num): sum = 0 i = 2 while(i * i <= num): while(num % i == 0): sum += i num /= i i += 1 sum += num return sum","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findMinSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find minimum sum of factors of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(num: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(12, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver(105, 15);\n console.log(`TEST-1...${result}`);\n\n result = driver(2, 2);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""num"": 12}}, {""idx"": 1, ""outputs"": 15, ""inputs"": {""num"": 105}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""num"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 514,MBPP/514,TypeScript,Write a function to find the summation of tuple elements in the given tuple array.,"/** * Write a function to find the summation of tuple elements in the given tuple array. */ function sumElements(test_tup: Array): number {",function sumElements(test_tup: Array): number {,['test_tup'],"def sum_elements(test_tup): res = sum(list(test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'sumElements', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the summation of tuple elements in the given tuple list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(test_tup: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([7, 8, 9, 1, 10, 7], 42);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6], 21);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 12, 13, 45, 14], 95);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 42, ""inputs"": {""test_tup"": [7, 8, 9, 1, 10, 7]}}, {""idx"": 1, ""outputs"": 21, ""inputs"": {""test_tup"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": 95, ""inputs"": {""test_tup"": [11, 12, 13, 45, 14]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 515,MBPP/515,TypeScript,Write a function to check if there is a subset with sum divisible by m.,"/** * Write a function to check if there is a subset with sum divisible by m. */ function modularSum(arr: Array, n: number, m: number): boolean {","function modularSum(arr: Array, n: number, m: number): boolean {","['arr', 'n', 'm']","def modular_sum(arr, n, m): if (n > m): return True DP = [False for i in range(m)] for i in range(n): if (DP[0]): return True temp = [False for i in range(m)] for j in range(m): if (DP[j] == True): if (DP[(j + arr[i]) % m] == False): temp[(j + arr[i]) % m] = True for j in range(m): if (temp[j]): DP[j] = True DP[arr[i] % m] = True return DP[0]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'modularSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if there is a subset with sum divisible by m.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, m: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, m),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 1, 7, 5], 4, 6, true);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 7], 2, 5, false);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 6], 2, 5, false);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""arr"": [3, 1, 7, 5], ""n"": 4, ""m"": 6}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""arr"": [1, 7], ""n"": 2, ""m"": 5}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""arr"": [1, 6], ""n"": 2, ""m"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 516,MBPP/516,TypeScript,Write a function to sort array of elements using radix sort.,"/** * Write a function to sort array of elements using radix sort. */ function radixSort(nums: Array): Array {",function radixSort(nums: Array): Array {,['nums'],"def radix_sort(nums): RADIX = 10 placement = 1 max_digit = max(nums) while placement < max_digit: buckets = [list() for _ in range( RADIX )] for i in nums: tmp = int((i / placement) % RADIX) buckets[tmp].append(i) a = 0 for b in range( RADIX ): buck = buckets[b] for i in buck: nums[a] = i a += 1 placement *= RADIX return nums","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'radixSort', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort a list of elements using radix sort.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(nums: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([15, 79, 25, 68, 37], [15, 25, 37, 68, 79]);\n console.log(`TEST-0...${result}`);\n\n result = driver([9, 11, 8, 7, 3, 2], [2, 3, 7, 8, 9, 11]);\n console.log(`TEST-1...${result}`);\n\n result = driver([36, 12, 24, 26, 29], [12, 24, 26, 29, 36]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [15, 25, 37, 68, 79], ""inputs"": {""nums"": [15, 79, 25, 68, 37]}}, {""idx"": 1, ""outputs"": [2, 3, 7, 8, 9, 11], ""inputs"": {""nums"": [9, 11, 8, 7, 3, 2]}}, {""idx"": 2, ""outputs"": [12, 24, 26, 29, 36], ""inputs"": {""nums"": [36, 12, 24, 26, 29]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 517,MBPP/517,TypeScript,Write a typescript function to find the largest postive number from the given array.,"/** * Write a typescript function to find the largest postive number from the given array. */ function largestPos(list1: Array): number {",function largestPos(list1: Array): number {,['list1'],"def largest_pos(list1): max = list1[0] for x in list1: if x > max : max = x return max","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'largestPos', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the largest postive number from the given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, -1], 4);\n console.log(`TEST-0...${result}`);\n\n result = driver([0, 1, 2, -5, -1, 6], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([0, 0, 1, 0], 1);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""list1"": [1, 2, 3, 4, -1]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list1"": [0, 1, 2, -5, -1, 6]}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""list1"": [0, 0, 1, 0]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 518,MBPP/518,TypeScript,Write a function to find the square root of a perfect number.,"/** * Write a function to find the square root of a perfect number. */ function sqrtRoot(num: number): number {",function sqrtRoot(num: number): number {,['num'],"import math def sqrt_root(num): sqrt_root = math.pow(num, 0.5) return sqrt_root ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'sqrtRoot', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the square root of a perfect number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(num: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver(16, 4);\n console.log(`TEST-1...${result}`);\n\n result = driver(400, 20);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""num"": 4}}, {""idx"": 1, ""outputs"": 4, ""inputs"": {""num"": 16}}, {""idx"": 2, ""outputs"": 20, ""inputs"": {""num"": 400}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 519,MBPP/519,TypeScript,Write a function to calculate volume of a tetrahedron.,"/** * Write a function to calculate volume of a tetrahedron. */ function volumeTetrahedron(num: number): number {",function volumeTetrahedron(num: number): number {,['num'],"import math def volume_tetrahedron(num): volume = (num ** 3 / (6 * math.sqrt(2))) return round(volume, 2)","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'volumeTetrahedron', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to calculate volume of a tetrahedron.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(num: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 117.85);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, 397.75);\n console.log(`TEST-1...${result}`);\n\n result = driver(20, 942.81);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 117.85, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 397.75, ""inputs"": {""num"": 15}}, {""idx"": 2, ""outputs"": 942.81, ""inputs"": {""num"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 520,MBPP/520,TypeScript,Write a function to find the lcm of the given array elements.,"/** * Write a function to find the lcm of the given array elements. */ function getLcm(l: Array): number {",function getLcm(l: Array): number {,['l'],"def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while (rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm def get_lcm(l): num1 = l[0] num2 = l[1] lcm = find_lcm(num1, num2) for i in range(2, len(l)): lcm = find_lcm(lcm, l[i]) return lcm ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'getLcm', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the lcm of the given array elements.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(l: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(l),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 7, 3, 9, 4], 252);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 8, 3], 24);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 8, 4, 10, 5], 120);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 252, ""inputs"": {""l"": [2, 7, 3, 9, 4]}}, {""idx"": 1, ""outputs"": 24, ""inputs"": {""l"": [1, 2, 8, 3]}}, {""idx"": 2, ""outputs"": 120, ""inputs"": {""l"": [3, 8, 4, 10, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 521,MBPP/521,TypeScript,Write a function to print check if the triangle is scalene or not.,"/** * Write a function to print check if the triangle is scalene or not. */ function checkIsosceles(x: number, y: number, z: number): boolean {","function checkIsosceles(x: number, y: number, z: number): boolean {","['x', 'y', 'z']","def check_isosceles(x,y,z): if x!=y & y!=z & z!=x: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'checkIsosceles', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to print check if the triangle is scalene or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(x: number, y: number, z: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(x, y, z),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(6, 8, 12, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(6, 6, 12, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(6, 15, 20, true);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 8, ""z"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""x"": 6, ""y"": 6, ""z"": 12}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""x"": 6, ""y"": 15, ""z"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 522,MBPP/522,TypeScript,Write a function to find the longest bitonic subsequence for the given array.,"/** * Write a function to find the longest bitonic subsequence for the given array. */ function lbs(arr: Array): number {",function lbs(arr: Array): number {,['arr'],"def lbs(arr): n = len(arr) lis = [1 for i in range(n+1)] for i in range(1 , n): for j in range(0 , i): if ((arr[i] > arr[j]) and (lis[i] < lis[j] +1)): lis[i] = lis[j] + 1 lds = [1 for i in range(n+1)] for i in reversed(range(n-1)): for j in reversed(range(i-1 ,n)): if(arr[i] > arr[j] and lds[i] < lds[j] + 1): lds[i] = lds[j] + 1 maximum = lis[0] + lds[0] - 1 for i in range(1 , n): maximum = max((lis[i] + lds[i]-1), maximum) return maximum","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'lbs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the longest bitonic subsequence for the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15], 7);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 11, 2, 10, 4, 5, 2, 1], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([80, 60, 30, 40, 20, 10], 5);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""arr"": [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""arr"": [1, 11, 2, 10, 4, 5, 2, 1]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""arr"": [80, 60, 30, 40, 20, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 523,MBPP/523,TypeScript,"Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.","/** * Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function. */ function checkString(str1: string): Array {",function checkString(str1: string): Array {,['str1'],"def check_string(str1): messg = [ lambda str1: any(x.isupper() for x in str1) or 'String must have 1 upper case character.', lambda str1: any(x.islower() for x in str1) or 'String must have 1 lower case character.', lambda str1: any(x.isdigit() for x in str1) or 'String must have 1 number.', lambda str1: len(str1) >= 7 or 'String length should be atleast 8.',] result = [x for x in [i(str1) for i in messg] if x != True] if not result: result.append('Valid string.') return result ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'checkString', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a given string has a capital letter, a lower case letter, a number and specified length using lambda function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(str1: string, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""123python"", [""String must have 1 upper case character.""]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""123Python"", [""Valid string.""]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [""String must have 1 upper case character."", ""String must have 1 number."", ""String length should be atleast 8.""], ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": [""String must have 1 upper case character.""], ""inputs"": {""str1"": ""123python""}}, {""idx"": 2, ""outputs"": [""Valid string.""], ""inputs"": {""str1"": ""123Python""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 524,MBPP/524,TypeScript,Write a function to find the sum of maximum increasing subsequence of the given array.,"/** * Write a function to find the sum of maximum increasing subsequence of the given array. */ function maxSumIncreasingSubsequence(arr: Array, n: number): number {","function maxSumIncreasingSubsequence(arr: Array, n: number): number {","['arr', 'n']","def max_sum_increasing_subsequence(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): if max < msis[i]: max = msis[i] return max","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'maxSumIncreasingSubsequence', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the sum of maximum increasing subsequence of the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 101, 2, 3, 100, 4, 5], 7, 106);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 4, 5, 10], 4, 22);\n console.log(`TEST-1...${result}`);\n\n result = driver([10, 5, 4, 3], 4, 10);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 106, ""inputs"": {""arr"": [1, 101, 2, 3, 100, 4, 5], ""n"": 7}}, {""idx"": 1, ""outputs"": 22, ""inputs"": {""arr"": [3, 4, 5, 10], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [10, 5, 4, 3], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 525,MBPP/525,TypeScript,Write a typescript function to check whether two given lines are parallel or not.,"/** * Write a typescript function to check whether two given lines are parallel or not. */ function parallelLines(line1: Array, line2: Array): boolean {","function parallelLines(line1: Array, line2: Array): boolean {","['line1', 'line2']","def parallel_lines(line1, line2): return line1[0]/line1[1] == line2[0]/line2[1]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'parallelLines', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether two given lines are parallel or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(line1: Array, line2: Array, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(line1, line2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 4], [2, 3, 8], true);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 3, 4], [4, -3, 8], false);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 3], [5, 5], true);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [2, 3, 8]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""line1"": [2, 3, 4], ""line2"": [4, -3, 8]}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""line1"": [3, 3], ""line2"": [5, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 526,MBPP/526,TypeScript,Write a typescript function to capitalize first and last letters of each word of a given string.,"/** * Write a typescript function to capitalize first and last letters of each word of a given string. */ function capitalizeFirstLastLetters(str1: string): string {",function capitalizeFirstLastLetters(str1: string): string {,['str1'],"def capitalize_first_last_letters(str1): str1 = result = str1.title() result = """" for word in str1.split(): result += word[:-1] + word[-1].upper() + "" "" return result[:-1] ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'capitalizeFirstLastLetters', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to capitalize first and last letters of each word of a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(str1: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", ""PythoN"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""bigdata"", ""BigdatA"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Hadoop"", ""HadooP"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""PythoN"", ""inputs"": {""str1"": ""python""}}, {""idx"": 1, ""outputs"": ""BigdatA"", ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": ""HadooP"", ""inputs"": {""str1"": ""Hadoop""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 527,MBPP/527,TypeScript,Write a function to find all pairs in an integer array whose sum is equal to a given number.,"/** * Write a function to find all pairs in an integer array whose sum is equal to a given number. */ function getPairsCount(arr: Array, n: number, sum: number): number {","function getPairsCount(arr: Array, n: number, sum: number): number {","['arr', 'n', 'sum']","def get_pairs_count(arr, n, sum): count = 0 for i in range(0, n): for j in range(i + 1, n): if arr[i] + arr[j] == sum: count += 1 return count","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'getPairsCount', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all pairs in an integer array whose sum is equal to a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, sum: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, sum),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 5, 7, -1, 5], 5, 6, 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 5, 7, -1], 4, 6, 2);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 1, 1, 1], 4, 2, 6);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""arr"": [1, 5, 7, -1, 5], ""n"": 5, ""sum"": 6}}, {""idx"": 1, ""outputs"": 2, ""inputs"": {""arr"": [1, 5, 7, -1], ""n"": 4, ""sum"": 6}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4, ""sum"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 529,MBPP/529,TypeScript,Write a function to find the nth jacobsthal-lucas number.,"/** * Write a function to find the nth jacobsthal-lucas number. */ function jacobsthalLucas(n: number): number {",function jacobsthalLucas(n: number): number {,['n'],"def jacobsthal_lucas(n): dp=[0] * (n + 1) dp[0] = 2 dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i - 1] + 2 * dp[i - 2]; return dp[n]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'jacobsthalLucas', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the nth jacobsthal-lucas number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(5, 31);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 5);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 17);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 31, ""inputs"": {""n"": 5}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 17, ""inputs"": {""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 530,MBPP/530,TypeScript,Write a function to find the ration of negative numbers in an array of integers.,"/** * Write a function to find the ration of negative numbers in an array of integers. */ function negativeCount(nums: Array): number {",function negativeCount(nums: Array): number {,['nums'],"from array import array def negative_count(nums): n = len(nums) n1 = 0 for x in nums: if x < 0: n1 += 1 else: None return round(n1/n,2)","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'negativeCount', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the ration of negative numbers in an array of integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(nums: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8], 0.31);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8], 0.31);\n console.log(`TEST-1...${result}`);\n\n result = driver([2, 4, -6, -9, 11, -12, 14, -5, 17], 0.44);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 0.31, ""inputs"": {""nums"": [0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8]}}, {""idx"": 1, ""outputs"": 0.31, ""inputs"": {""nums"": [2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8]}}, {""idx"": 2, ""outputs"": 0.44, ""inputs"": {""nums"": [2, 4, -6, -9, 11, -12, 14, -5, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 531,MBPP/531,TypeScript,Write a function to find minimum number of coins that make a given value.,"/** * Write a function to find minimum number of coins that make a given value. */ function minCoins(coins: Array, m: number, v: number): number {","function minCoins(coins: Array, m: number, v: number): number {","['coins', 'm', 'v']","import sys def min_coins(coins, m, V): if (V == 0): return 0 res = sys.maxsize for i in range(0, m): if (coins[i] <= V): sub_res = min_coins(coins, m, V-coins[i]) if (sub_res != sys.maxsize and sub_res + 1 < res): res = sub_res + 1 return res ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'minCoins', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find minimum number of coins that make a given value.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(coins: Array, m: number, v: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(coins, m, v),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([9, 6, 5, 1], 4, 11, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([4, 5, 6, 7, 8, 9], 6, 9, 1);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 3, 4, 2);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""coins"": [9, 6, 5, 1], ""m"": 4, ""v"": 11}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""coins"": [4, 5, 6, 7, 8, 9], ""m"": 6, ""v"": 9}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""coins"": [1, 2, 3], ""m"": 3, ""v"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 532,MBPP/532,TypeScript,Write a function to check if the two given strings are permutations of each other.,"/** * Write a function to check if the two given strings are permutations of each other. */ function checkPermutation(str1: string, str2: string): boolean {","function checkPermutation(str1: string, str2: string): boolean {","['str1', 'str2']","def check_permutation(str1, str2): n1=len(str1) n2=len(str2) if(n1!=n2): return False a=sorted(str1) str1="" "".join(a) b=sorted(str2) str2="" "".join(b) for i in range(0, n1, 1): if(str1[i] != str2[i]): return False return True","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'checkPermutation', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check if the two given strings are permutations of each other.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(str1: string, str2: string, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""abc"", ""cba"", true);\n console.log(`TEST-0...${result}`);\n\n result = driver(""test"", ""ttew"", false);\n console.log(`TEST-1...${result}`);\n\n result = driver(""xxyz"", ""yxzx"", true);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""str1"": ""abc"", ""str2"": ""cba""}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""str1"": ""test"", ""str2"": ""ttew""}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""str1"": ""xxyz"", ""str2"": ""yxzx""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 534,MBPP/534,TypeScript,Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.,"/** * Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs. */ function searchLiteral(pattern: string, text: string): Array {","function searchLiteral(pattern: string, text: string): Array {","['pattern', 'text']","import re def search_literal(pattern,text): match = re.search(pattern, text) s = match.start() e = match.end() return (s, e)","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'searchLiteral', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(pattern: string, text: string, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(pattern, text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", ""python programming language"", [0, 6]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""programming"", ""python programming language"", [7, 18]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""language"", ""python programming language"", [19, 27]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [0, 6], ""inputs"": {""pattern"": ""python"", ""text"": ""python programming language""}}, {""idx"": 1, ""outputs"": [7, 18], ""inputs"": {""pattern"": ""programming"", ""text"": ""python programming language""}}, {""idx"": 2, ""outputs"": [19, 27], ""inputs"": {""pattern"": ""language"", ""text"": ""python programming language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 535,MBPP/535,TypeScript,Write a function to find the top or bottom surface area of a cylinder.,"/** * Write a function to find the top or bottom surface area of a cylinder. */ function topbottomSurfacearea(r: number): number {",function topbottomSurfacearea(r: number): number {,['r'],"def topbottom_surfacearea(r): toporbottomarea=3.1415*r*r return toporbottomarea","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'topbottomSurfacearea', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the top or bottom surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return Math.abs(actual - expected) < 1e-09;\n}\n\nfunction driver(r: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 314.15000000000003);\n console.log(`TEST-0...${result}`);\n\n result = driver(5, 78.53750000000001);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 50.264);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 314.15000000000003, ""inputs"": {""r"": 10}}, {""idx"": 1, ""outputs"": 78.53750000000001, ""inputs"": {""r"": 5}}, {""idx"": 2, ""outputs"": 50.264, ""inputs"": {""r"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 536,MBPP/536,TypeScript,Write a function to select the nth items of array.,"/** * Write a function to select the nth items of array. */ function nthItems(list: Array, n: number): Array {","function nthItems(list: Array, n: number): Array {","['list', 'n']","def nth_items(list,n): return list[::n]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'nthItems', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to select the nth items of a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list: Array, n: number, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9], 2, [1, 3, 5, 7, 9]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 15, 19, 17, 16, 18], 3, [10, 17]);\n console.log(`TEST-1...${result}`);\n\n result = driver([14, 16, 19, 15, 17], 4, [14, 17]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5, 7, 9], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""n"": 2}}, {""idx"": 1, ""outputs"": [10, 17], ""inputs"": {""list"": [10, 15, 19, 17, 16, 18], ""n"": 3}}, {""idx"": 2, ""outputs"": [14, 17], ""inputs"": {""list"": [14, 16, 19, 15, 17], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 537,MBPP/537,TypeScript,Write a typescript function to find the first repeated word in a given string.,"/** * Write a typescript function to find the first repeated word in a given string. */ function firstRepeatedWord(str1: string): string {",function firstRepeatedWord(str1: string): string {,['str1'],"def first_repeated_word(str1): temp = set() for word in str1.split(): if word in temp: return word; else: temp.add(word) return 'None'","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'firstRepeatedWord', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the first repeated word in a given string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(str1: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""ab ca bc ab"", ""ab"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""ab ca bc"", ""None"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""ab ca bc ca ab bc"", ""ca"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""ab"", ""inputs"": {""str1"": ""ab ca bc ab""}}, {""idx"": 1, ""outputs"": ""None"", ""inputs"": {""str1"": ""ab ca bc""}}, {""idx"": 2, ""outputs"": ""ca"", ""inputs"": {""str1"": ""ab ca bc ca ab bc""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 538,MBPP/538,TypeScript,Write a typescript function to convert a given string array to a tuple.,"/** * Write a typescript function to convert a given string array to a tuple. */ function stringListToTuple(str1: string): Array {",function stringListToTuple(str1: string): Array {,['str1'],"def string_list_to_tuple(str1): result = tuple(x for x in str1 if not x.isspace()) return result","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'stringListToTuple', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to convert a given string list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(str1: string, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python 3.0"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\', \'3\', \'.\', \'0\']);\n console.log(`TEST-0...${result}`);\n\n result = driver(""bigdata"", [\'b\', \'i\', \'g\', \'d\', \'a\', \'t\', \'a\']);\n console.log(`TEST-1...${result}`);\n\n result = driver(""language"", [\'l\', \'a\', \'n\', \'g\', \'u\', \'a\', \'g\', \'e\']);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n"", ""3"", ""."", ""0""], ""inputs"": {""str1"": ""python 3.0""}}, {""idx"": 1, ""outputs"": [""b"", ""i"", ""g"", ""d"", ""a"", ""t"", ""a""], ""inputs"": {""str1"": ""bigdata""}}, {""idx"": 2, ""outputs"": [""l"", ""a"", ""n"", ""g"", ""u"", ""a"", ""g"", ""e""], ""inputs"": {""str1"": ""language""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 539,MBPP/539,TypeScript,Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function.,"/** * Write a function to create array containing the power of said number in bases raised to the corresponding number in the index using map function. */ function basesnumCoresspondingnum(bases_num: Array, index: Array): Array {","function basesnumCoresspondingnum(bases_num: Array, index: Array): Array {","['bases_num', 'index']","def basesnum_coresspondingnum(bases_num,index): result = list(map(pow, bases_num, index)) return result","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'basesnumCoresspondingnum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to create a list containing the power of said number in bases raised to the corresponding number in the index using map function.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(bases_num: Array, index: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(bases_num, index),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 20, 30, 40, 50, 60, 70, 80, 90, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249]);\n console.log(`TEST-1...${result}`);\n\n result = driver([4, 8, 12, 16, 20, 24, 28], [3, 6, 9, 12, 15, 18, 21], [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [10, 400, 27000, 2560000, 312500000, 46656000000, 8235430000000, 1677721600000000, 387420489000000000, 100000000000000000000], ""inputs"": {""bases_num"": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], ""index"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 1, ""outputs"": [1, 1048576, 205891132094649, 1208925819614629174706176, 88817841970012523233890533447265625, 48873677980689257489322752273774603865660850176, 143503601609868434285603076356671071740077383739246066639249], ""inputs"": {""bases_num"": [1, 2, 3, 4, 5, 6, 7], ""index"": [10, 20, 30, 40, 50, 60, 70]}}, {""idx"": 2, ""outputs"": [64, 262144, 5159780352, 281474976710656, 32768000000000000000, 6979147079584381377970176, 2456510688823056210273111113728], ""inputs"": {""bases_num"": [4, 8, 12, 16, 20, 24, 28], ""index"": [3, 6, 9, 12, 15, 18, 21]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 540,MBPP/540,TypeScript,Write a typescript function to find the difference between highest and least frequencies in a given array.,"/** * Write a typescript function to find the difference between highest and least frequencies in a given array. */ function findDiff(arr: Array, n: number): number {","function findDiff(arr: Array, n: number): number {","['arr', 'n']","def find_Diff(arr,n): arr.sort() count = 0; max_count = 0; min_count = n for i in range(0,(n-1)): if arr[i] == arr[i + 1]: count += 1 continue else: max_count = max(max_count,count) min_count = min(min_count,count) count = 0 return max_count - min_count ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findDiff', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between highest and least frequencies in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 1, 2, 2, 7, 8, 4, 5, 1, 4], 10, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 7, 9, 2, 3, 3, 1, 3, 3], 9, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 1, 2], 4, 0);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 1, 2, 2, 7, 8, 4, 5, 1, 4], ""n"": 10}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [1, 7, 9, 2, 3, 3, 1, 3, 3], ""n"": 9}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""arr"": [1, 2, 1, 2], ""n"": 4}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 541,MBPP/541,TypeScript,Write a function to find if the given number is abundant or not.,"/** * Write a function to find if the given number is abundant or not. */ function checkAbundant(n: number): boolean {",function checkAbundant(n: number): boolean {,['n'],"import math def get_sum(n): sum = 0 i = 1 while i <= (math.sqrt(n)): if n%i == 0: if n/i == i : sum = sum + i else: sum = sum + i sum = sum + (n / i ) i = i + 1 sum = sum - n return sum def check_abundant(n): if (get_sum(n) > n): return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'checkAbundant', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find if the given number is abundant or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(12, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(18, true);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""n"": 12}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": true, ""inputs"": {""n"": 18}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 542,MBPP/542,TypeScript,"Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.","/** * Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex. */ function fillSpaces(text: string): string {",function fillSpaces(text: string): string {,['text'],"import re def fill_spaces(text): return (re.sub(""[ ,.]"", "":"", text))","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'fillSpaces', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to replace all occurrences of spaces, commas, or dots with a colon in the given string by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(text: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Boult Curve Wireless Neckband"", ""Boult:Curve:Wireless:Neckband"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Stereo Sound Sweatproof"", ""Stereo:Sound:Sweatproof"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Probass Curve Audio"", ""Probass:Curve:Audio"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""Boult:Curve:Wireless:Neckband"", ""inputs"": {""text"": ""Boult Curve Wireless Neckband""}}, {""idx"": 1, ""outputs"": ""Stereo:Sound:Sweatproof"", ""inputs"": {""text"": ""Stereo Sound Sweatproof""}}, {""idx"": 2, ""outputs"": ""Probass:Curve:Audio"", ""inputs"": {""text"": ""Probass Curve Audio""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 543,MBPP/543,TypeScript,Write a function to add two numbers and print number of digits of sum.,"/** * Write a function to add two numbers and print number of digits of sum. */ function countDigits(num1: number, num2: number): number {","function countDigits(num1: number, num2: number): number {","['num1', 'num2']","def count_digits(num1,num2): number=num1+num2 count = 0 while(number > 0): number = number // 10 count = count + 1 return count","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'countDigits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to add two numbers and print number of digits of sum.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(num1: number, num2: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num1, num2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(9875, 10, 4);\n console.log(`TEST-0...${result}`);\n\n result = driver(98759853034, 100, 11);\n console.log(`TEST-1...${result}`);\n\n result = driver(1234567, 500, 7);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""num1"": 9875, ""num2"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""num1"": 98759853034, ""num2"": 100}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""num1"": 1234567, ""num2"": 500}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 545,MBPP/545,TypeScript,Write a typescript function to toggle only first and last bits of a given number.,"/** * Write a typescript function to toggle only first and last bits of a given number. */ function toggleFAndLBits(n: number): number {",function toggleFAndLBits(n: number): number {,['n'],"def take_L_and_F_set_bits(n) : n = n | n >> 1 n = n | n >> 2 n = n | n >> 4 n = n | n >> 8 n = n | n >> 16 return ((n + 1) >> 1) + 1 def toggle_F_and_L_bits(n) : if (n == 1) : return 0 return n ^ take_L_and_F_set_bits(n) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'toggleFAndLBits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to toggle only first and last bits of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 3);\n console.log(`TEST-0...${result}`);\n\n result = driver(15, 6);\n console.log(`TEST-1...${result}`);\n\n result = driver(20, 5);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""n"": 10}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n"": 15}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""n"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 546,MBPP/546,TypeScript,Write a function to find the last occurrence of a character in a string.,"/** * Write a function to find the last occurrence of a character in a string. */ function lastOccurenceChar(string_arg0: string, char_arg1: string): number {","function lastOccurenceChar(string_arg0: string, char_arg1: string): number {","['string_arg0', 'char_arg1']","def last_occurence_char(string,char): flag = -1 for i in range(len(string)): if(string[i] == char): flag = i if(flag == -1): return None else: return flag + 1","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'lastOccurenceChar', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the last occurrence of a character in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(string_arg0: string, char_arg1: string, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0, char_arg1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""hello world"", \'l\', 10);\n console.log(`TEST-0...${result}`);\n\n result = driver(""language"", \'g\', 7);\n console.log(`TEST-1...${result}`);\n\n result = driver(""little"", \'y\', None);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 10, ""inputs"": {""string_arg0"": ""hello world"", ""char_arg1"": ""l""}}, {""idx"": 1, ""outputs"": 7, ""inputs"": {""string_arg0"": ""language"", ""char_arg1"": ""g""}}, {""idx"": 2, ""outputs"": null, ""inputs"": {""string_arg0"": ""little"", ""char_arg1"": ""y""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 547,MBPP/547,TypeScript,Write a typescript function to find the sum of hamming distances of all consecutive numbers from o to n.,"/** * Write a typescript function to find the sum of hamming distances of all consecutive numbers from o to n. */ function totalHammingDistance(n: number): number {",function totalHammingDistance(n: number): number {,['n'],"def Total_Hamming_Distance(n): i = 1 sum = 0 while (n // i > 0): sum = sum + n // i i = i * 2 return sum","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'totalHammingDistance', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of hamming distances of all consecutive numbers from o to n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver(5, 8);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 548,MBPP/548,TypeScript,Write a function to find the length of the longest increasing subsequence of the given sequence.,"/** * Write a function to find the length of the longest increasing subsequence of the given sequence. */ function longestIncreasingSubsequence(arr: Array): number {",function longestIncreasingSubsequence(arr: Array): number {,['arr'],"def longest_increasing_subsequence(arr): n = len(arr) longest_increasing_subsequence = [1]*n for i in range (1 , n): for j in range(0 , i): if arr[i] > arr[j] and longest_increasing_subsequence[i]< longest_increasing_subsequence[j] + 1 : longest_increasing_subsequence[i] = longest_increasing_subsequence[j]+1 maximum = 0 for i in range(n): maximum = max(maximum , longest_increasing_subsequence[i]) return maximum","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'longestIncreasingSubsequence', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the length of the longest increasing subsequence of the given sequence.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 22, 9, 33, 21, 50, 41, 60], 5);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 10, 2, 1, 20], 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([50, 3, 10, 7, 40, 80], 4);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""arr"": [10, 22, 9, 33, 21, 50, 41, 60]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""arr"": [3, 10, 2, 1, 20]}}, {""idx"": 2, ""outputs"": 4, ""inputs"": {""arr"": [50, 3, 10, 7, 40, 80]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 549,MBPP/549,TypeScript,Write a typescript function to find the sum of fifth power of first n odd natural numbers.,"/** * Write a typescript function to find the sum of fifth power of first n odd natural numbers. */ function oddNumSum(n: number): number {",function oddNumSum(n: number): number {,['n'],"def odd_Num_Sum(n) : j = 0 sm = 0 for i in range(1,n+1) : j = (2*i-1) sm = sm + (j*j*j*j*j) return sm ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'oddNumSum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the sum of fifth power of first n odd natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 1);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, 244);\n console.log(`TEST-1...${result}`);\n\n result = driver(3, 3369);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": 244, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": 3369, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 550,MBPP/550,TypeScript,Write a typescript function to find the maximum element in a sorted and rotated array.,"/** * Write a typescript function to find the maximum element in a sorted and rotated array. */ function findMax(arr: Array, low: number, high: number): number {","function findMax(arr: Array, low: number, high: number): number {","['arr', 'low', 'high']","def find_Max(arr,low,high): if (high < low): return arr[0] if (high == low): return arr[low] mid = low + (high - low) // 2 if (mid < high and arr[mid + 1] < arr[mid]): return arr[mid] if (mid > low and arr[mid] < arr[mid - 1]): return arr[mid - 1] if (arr[low] > arr[mid]): return find_Max(arr,low,mid - 1) else: return find_Max(arr,mid + 1,high) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findMax', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum element in a sorted and rotated array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, low: number, high: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, low, high),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 5, 6, 9], 0, 4, 9);\n console.log(`TEST-0...${result}`);\n\n result = driver([3, 4, 5, 2, 1], 0, 4, 5);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 0, 2, 3);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 9, ""inputs"": {""arr"": [2, 3, 5, 6, 9], ""low"": 0, ""high"": 4}}, {""idx"": 1, ""outputs"": 5, ""inputs"": {""arr"": [3, 4, 5, 2, 1], ""low"": 0, ""high"": 4}}, {""idx"": 2, ""outputs"": 3, ""inputs"": {""arr"": [1, 2, 3], ""low"": 0, ""high"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 551,MBPP/551,TypeScript,Write a function to extract a specified column from a given nested array.,"/** * Write a function to extract a specified column from a given nested array. */ function extractColumn(list1: Array>, n: number): Array {","function extractColumn(list1: Array>, n: number): Array {","['list1', 'n']","def extract_column(list1, n): result = [i.pop(n) for i in list1] return result ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'extractColumn', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract a specified column from a given nested list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array>, n: number, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[1, 2, 3], [2, 4, 5], [1, 1, 1]], 0, [1, 2, 1]);\n console.log(`TEST-0...${result}`);\n\n result = driver([[1, 2, 3], [-2, 4, -5], [1, -1, 1]], 2, [3, -5, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], 0, [1, 5, 1, 13, 5, 9]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 2, 1], ""inputs"": {""list1"": [[1, 2, 3], [2, 4, 5], [1, 1, 1]], ""n"": 0}}, {""idx"": 1, ""outputs"": [3, -5, 1], ""inputs"": {""list1"": [[1, 2, 3], [-2, 4, -5], [1, -1, 1]], ""n"": 2}}, {""idx"": 2, ""outputs"": [1, 5, 1, 13, 5, 9], ""inputs"": {""list1"": [[1, 3], [5, 7], [1, 3], [13, 15, 17], [5, 7], [9, 11]], ""n"": 0}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 552,MBPP/552,TypeScript,Write a typescript function to check whether a given sequence is linear or not.,"/** * Write a typescript function to check whether a given sequence is linear or not. */ function seqLinear(seq_nums: Array): string {",function seqLinear(seq_nums: Array): string {,['seq_nums'],"def Seq_Linear(seq_nums): seq_nums = [seq_nums[x] - seq_nums[x-1] for x in range(1, len(seq_nums))] if len(set(seq_nums)) == 1: return ""Linear Sequence"" else: return ""Non Linear Sequence""","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'seqLinear', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether a given sequence is linear or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(seq_nums: Array, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(seq_nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([0, 2, 4, 6, 8, 10], ""Linear Sequence"");\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3], ""Linear Sequence"");\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 5, 2], ""Non Linear Sequence"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [0, 2, 4, 6, 8, 10]}}, {""idx"": 1, ""outputs"": ""Linear Sequence"", ""inputs"": {""seq_nums"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": ""Non Linear Sequence"", ""inputs"": {""seq_nums"": [1, 5, 2]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 553,MBPP/553,TypeScript,Write a function to convert the given tuple to a floating-point number.,"/** * Write a function to convert the given tuple to a floating-point number. */ function tupleToFloat(test_tup: Array): number {",function tupleToFloat(test_tup: Array): number {,['test_tup'],"def tuple_to_float(test_tup): res = float('.'.join(str(ele) for ele in test_tup)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'tupleToFloat', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert the given tuple to a floating-point number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return Math.abs(actual - expected) < 1e-06;\n}\n\nfunction driver(test_tup: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([4, 56], 4.56);\n console.log(`TEST-0...${result}`);\n\n result = driver([7, 256], 7.256);\n console.log(`TEST-1...${result}`);\n\n result = driver([8, 123], 8.123);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 4.56, ""inputs"": {""test_tup"": [4, 56]}}, {""idx"": 1, ""outputs"": 7.256, ""inputs"": {""test_tup"": [7, 256]}}, {""idx"": 2, ""outputs"": 8.123, ""inputs"": {""test_tup"": [8, 123]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 554,MBPP/554,TypeScript,Write a typescript function to find odd numbers from a mixed array.,"/** * Write a typescript function to find odd numbers from a mixed array. */ function split(list: Array): Array {",function split(list: Array): Array {,['list'],"def Split(list): od_li = [] for i in list: if (i % 2 != 0): od_li.append(i) return od_li","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'split', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find odd numbers from a mixed list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6], [1, 3, 5]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 11, 12, 13], [11, 13]);\n console.log(`TEST-1...${result}`);\n\n result = driver([7, 8, 9, 1], [7, 9, 1]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 3, 5], ""inputs"": {""list"": [1, 2, 3, 4, 5, 6]}}, {""idx"": 1, ""outputs"": [11, 13], ""inputs"": {""list"": [10, 11, 12, 13]}}, {""idx"": 2, ""outputs"": [7, 9, 1], ""inputs"": {""list"": [7, 8, 9, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 555,MBPP/555,TypeScript,Write a typescript function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.,"/** * Write a typescript function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers. */ function difference(n: number): number {",function difference(n: number): number {,['n'],"def difference(n) : S = (n*(n + 1))//2; res = S*(S-1); return res; ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'difference', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between sum of cubes of first n natural numbers and the sum of first n natural numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 30);\n console.log(`TEST-0...${result}`);\n\n result = driver(5, 210);\n console.log(`TEST-1...${result}`);\n\n result = driver(2, 6);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 30, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 210, ""inputs"": {""n"": 5}}, {""idx"": 2, ""outputs"": 6, ""inputs"": {""n"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 556,MBPP/556,TypeScript,Write a typescript function to count the pairs with xor as an odd number.,"/** * Write a typescript function to count the pairs with xor as an odd number. */ function findOddPair(a: Array, n: number): number {","function findOddPair(a: Array, n: number): number {","['a', 'n']","def find_Odd_Pair(A,N) : oddPair = 0 for i in range(0,N) : for j in range(i+1,N) : if ((A[i] ^ A[j]) % 2 != 0): oddPair+=1 return oddPair ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findOddPair', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count the pairs with xor as an odd number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: Array, n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([5, 4, 7, 2, 1], 5, 6);\n console.log(`TEST-0...${result}`);\n\n result = driver([7, 2, 8, 1, 0, 5, 11], 7, 12);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3], 3, 2);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""a"": [5, 4, 7, 2, 1], ""n"": 5}}, {""idx"": 1, ""outputs"": 12, ""inputs"": {""a"": [7, 2, 8, 1, 0, 5, 11], ""n"": 7}}, {""idx"": 2, ""outputs"": 2, ""inputs"": {""a"": [1, 2, 3], ""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 557,MBPP/557,TypeScript,Write a function to toggle characters case in a string.,"/** * Write a function to toggle characters case in a string. */ function toggleString(string_arg0: string): string {",function toggleString(string_arg0: string): string {,['string_arg0'],"def toggle_string(string): string1 = string.swapcase() return string1","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'toggleString', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to toggle characters case in a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(string_arg0: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Python"", ""pYTHON"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Pangram"", ""pANGRAM"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""LIttLE"", ""liTTle"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""pYTHON"", ""inputs"": {""string_arg0"": ""Python""}}, {""idx"": 1, ""outputs"": ""pANGRAM"", ""inputs"": {""string_arg0"": ""Pangram""}}, {""idx"": 2, ""outputs"": ""liTTle"", ""inputs"": {""string_arg0"": ""LIttLE""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 558,MBPP/558,TypeScript,Write a typescript function to find the digit distance between two integers.,"/** * Write a typescript function to find the digit distance between two integers. */ function digitDistanceNums(n1: number, n2: number): number {","function digitDistanceNums(n1: number, n2: number): number {","['n1', 'n2']","def digit_distance_nums(n1, n2): return sum(map(int,str(abs(n1-n2))))","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'digitDistanceNums', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the digit distance between two integers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n1: number, n2: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n1, n2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 2, 1);\n console.log(`TEST-0...${result}`);\n\n result = driver(23, 56, 6);\n console.log(`TEST-1...${result}`);\n\n result = driver(123, 256, 7);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 1, ""inputs"": {""n1"": 1, ""n2"": 2}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""n1"": 23, ""n2"": 56}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""n1"": 123, ""n2"": 256}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 559,MBPP/559,TypeScript,Write a function to find the largest sum of contiguous subarray in the given array.,"/** * Write a function to find the largest sum of contiguous subarray in the given array. */ function maxSubArraySum(a: Array, size: number): number {","function maxSubArraySum(a: Array, size: number): number {","['a', 'size']","def max_sub_array_sum(a, size): max_so_far = 0 max_ending_here = 0 for i in range(0, size): max_ending_here = max_ending_here + a[i] if max_ending_here < 0: max_ending_here = 0 elif (max_so_far < max_ending_here): max_so_far = max_ending_here return max_so_far","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'maxSubArraySum', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the largest sum of contiguous subarray in the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: Array, size: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, size),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([-2, -3, 4, -1, -2, 1, 5, -3], 8, 7);\n console.log(`TEST-0...${result}`);\n\n result = driver([-3, -4, 5, -2, -3, 2, 6, -4], 8, 8);\n console.log(`TEST-1...${result}`);\n\n result = driver([-4, -5, 6, -3, -4, 3, 7, -5], 8, 10);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 7, ""inputs"": {""a"": [-2, -3, 4, -1, -2, 1, 5, -3], ""size"": 8}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""a"": [-3, -4, 5, -2, -3, 2, 6, -4], ""size"": 8}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""a"": [-4, -5, 6, -3, -4, 3, 7, -5], ""size"": 8}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 560,MBPP/560,TypeScript,Write a function to find the union of elements of the given tuples.,"/** * Write a function to find the union of elements of the given tuples. */ function unionElements(test_tup1: Array, test_tup2: Array): Array {","function unionElements(test_tup1: Array, test_tup2: Array): Array {","['test_tup1', 'test_tup2']","def union_elements(test_tup1, test_tup2): res = tuple(set(test_tup1 + test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'unionElements', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the union of elements of the given tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(test_tup1: Array, test_tup2: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 4, 5, 6, 7, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], [3, 4, 5, 6], [1, 2, 3, 4, 5, 6]);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 12, 13, 14], [13, 15, 16, 17], [11, 12, 13, 14, 15, 16, 17]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [3, 4, 5, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 2, 3, 4, 5, 6], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [3, 4, 5, 6]}}, {""idx"": 2, ""outputs"": [11, 12, 13, 14, 15, 16, 17], ""inputs"": {""test_tup1"": [11, 12, 13, 14], ""test_tup2"": [13, 15, 16, 17]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 562,MBPP/562,TypeScript,Write a typescript function to find the maximum length of sublist.,"/** * Write a typescript function to find the maximum length of sublist. */ function findMaxLength(lst: Array>): number {",function findMaxLength(lst: Array>): number {,['lst'],"def Find_Max_Length(lst): maxLength = max(len(x) for x in lst ) return maxLength ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findMaxLength', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the maximum length of sublist.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(lst: Array>, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(lst),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[1], [1, 4], [5, 6, 7, 8]], 4);\n console.log(`TEST-0...${result}`);\n\n result = driver([[0, 1], [2, 2], [3, 2, 1]], 3);\n console.log(`TEST-1...${result}`);\n\n result = driver([[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]], 5);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""lst"": [[1], [1, 4], [5, 6, 7, 8]]}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""lst"": [[0, 1], [2, 2], [3, 2, 1]]}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""lst"": [[7], [22, 23], [13, 14, 15], [10, 20, 30, 40, 50]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 563,MBPP/563,TypeScript,Write a function to extract values between quotation marks of a string.,"/** * Write a function to extract values between quotation marks of a string. */ function extractValues(text: string): Array {",function extractValues(text: string): Array {,['text'],"import re def extract_values(text): return (re.findall(r'""(.*?)""', text))","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'extractValues', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to extract values between quotation marks of a string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(text: string, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""\\""Python\\"", \\""PHP\\"", \\""Java\\"""", [""Python"", ""PHP"", ""Java""]);\n console.log(`TEST-0...${result}`);\n\n result = driver(""\\""python\\"",\\""program\\"",\\""language\\"""", [""python"", ""program"", ""language""]);\n console.log(`TEST-1...${result}`);\n\n result = driver(""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\"""", [""red"", ""blue"", ""green"", ""yellow""]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [""Python"", ""PHP"", ""Java""], ""inputs"": {""text"": ""\\""Python\\"", \\""PHP\\"", \\""Java\\""""}}, {""idx"": 1, ""outputs"": [""python"", ""program"", ""language""], ""inputs"": {""text"": ""\\""python\\"",\\""program\\"",\\""language\\""""}}, {""idx"": 2, ""outputs"": [""red"", ""blue"", ""green"", ""yellow""], ""inputs"": {""text"": ""\\""red\\"",\\""blue\\"",\\""green\\"",\\""yellow\\""""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 564,MBPP/564,TypeScript,Write a typescript function to count unequal element pairs from the given array.,"/** * Write a typescript function to count unequal element pairs from the given array. */ function countPairs(arr: Array, n: number): number {","function countPairs(arr: Array, n: number): number {","['arr', 'n']","def count_Pairs(arr,n): cnt = 0; for i in range(n): for j in range(i + 1,n): if (arr[i] != arr[j]): cnt += 1; return cnt; ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'countPairs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to count unequal element pairs from the given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 1], 3, 2);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 1, 1, 1], 4, 0);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5], 5, 10);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 2, ""inputs"": {""arr"": [1, 2, 1], ""n"": 3}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""arr"": [1, 1, 1, 1], ""n"": 4}}, {""idx"": 2, ""outputs"": 10, ""inputs"": {""arr"": [1, 2, 3, 4, 5], ""n"": 5}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 565,MBPP/565,TypeScript,Write a typescript function to split a string into characters.,"/** * Write a typescript function to split a string into characters. */ function split(word: string): Array {",function split(word: string): Array {,['word'],"def split(word): return [char for char in word] ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'split', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split a string into characters.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(word: string, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(word),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""python"", [\'p\', \'y\', \'t\', \'h\', \'o\', \'n\']);\n console.log(`TEST-0...${result}`);\n\n result = driver(""Name"", [\'N\', \'a\', \'m\', \'e\']);\n console.log(`TEST-1...${result}`);\n\n result = driver(""program"", [\'p\', \'r\', \'o\', \'g\', \'r\', \'a\', \'m\']);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [""p"", ""y"", ""t"", ""h"", ""o"", ""n""], ""inputs"": {""word"": ""python""}}, {""idx"": 1, ""outputs"": [""N"", ""a"", ""m"", ""e""], ""inputs"": {""word"": ""Name""}}, {""idx"": 2, ""outputs"": [""p"", ""r"", ""o"", ""g"", ""r"", ""a"", ""m""], ""inputs"": {""word"": ""program""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 566,MBPP/566,TypeScript,Write a function to get the sum of a non-negative integer.,"/** * Write a function to get the sum of a non-negative integer. */ function sumDigits(n: number): number {",function sumDigits(n: number): number {,['n'],"def sum_digits(n): if n == 0: return 0 else: return n % 10 + sum_digits(int(n / 10))","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'sumDigits', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to get the sum of a non-negative integer.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(345, 12);\n console.log(`TEST-0...${result}`);\n\n result = driver(12, 3);\n console.log(`TEST-1...${result}`);\n\n result = driver(97, 16);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 12, ""inputs"": {""n"": 345}}, {""idx"": 1, ""outputs"": 3, ""inputs"": {""n"": 12}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""n"": 97}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 567,MBPP/567,TypeScript,Write a function to check whether a specified array is sorted or not.,"/** * Write a function to check whether a specified array is sorted or not. */ function issortList(list1: Array): boolean {",function issortList(list1: Array): boolean {,['list1'],"def issort_list(list1): result = all(list1[i] <= list1[i+1] for i in range(len(list1)-1)) return result","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'issortList', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether a specified list is sorted or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 16, 17], true);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 4, 6, 8, 10, 12, 14, 20, 17], false);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 4, 6, 8, 10, 15, 14, 20], false);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 16, 17]}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 12, 14, 20, 17]}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""list1"": [1, 2, 4, 6, 8, 10, 15, 14, 20]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 569,MBPP/569,TypeScript,Write a function to sort each sublist of strings in a given array of arrays.,"/** * Write a function to sort each sublist of strings in a given array of arrays. */ function sortSublists(list1: Array>): Array> {",function sortSublists(list1: Array>): Array> {,['list1'],"def sort_sublists(list1): result = list(map(sorted,list1)) return result","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'sortSublists', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to sort each sublist of strings in a given list of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array>, expected: Array>): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array>, expected:Array>): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]], [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]]);\n console.log(`TEST-0...${result}`);\n\n result = driver([[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]);\n console.log(`TEST-1...${result}`);\n\n result = driver([[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]], [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [[""green"", ""orange""], [""black"", ""white""], [""black"", ""orange"", ""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black"", ""white""], [""white"", ""black"", ""orange""]]}}, {""idx"": 1, ""outputs"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]], ""inputs"": {""list1"": [[""green"", ""orange""], [""black""], [""green"", ""orange""], [""white""]]}}, {""idx"": 2, ""outputs"": [[""a"", ""b""], [""c"", ""d""], [""g"", ""h""], [""e"", ""f""]], ""inputs"": {""list1"": [[""a"", ""b""], [""d"", ""c""], [""g"", ""h""], [""f"", ""e""]]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 570,MBPP/570,TypeScript,Write a function to remove words from a given array of strings containing a character or string.,"/** * Write a function to remove words from a given array of strings containing a character or string. */ function removeWords(list1: Array, charlist: Array): Array {","function removeWords(list1: Array, charlist: Array): Array {","['list1', 'charlist']","def remove_words(list1, charlist): new_list = [] for line in list1: new_words = ' '.join([word for word in line.split() if not any([phrase in word for phrase in charlist])]) new_list.append(new_words) return new_list","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'removeWords', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove words from a given list of strings containing a character or string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array, charlist: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, charlist),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], [""#"", ""color"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-0...${result}`);\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""&"", ""+"", ""@""], [""Red"", """", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-1...${result}`);\n\n result = driver([""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], [""@""], [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red color"", ""Orange#"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""#"", ""color"", ""@""]}}, {""idx"": 1, ""outputs"": [""Red"", """", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""&"", ""+"", ""@""]}}, {""idx"": 2, ""outputs"": [""Red &"", ""Orange+"", ""Green"", ""Orange"", ""White""], ""inputs"": {""list1"": [""Red &"", ""Orange+"", ""Green"", ""Orange @"", ""White""], ""charlist"": [""@""]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 571,MBPP/571,TypeScript,Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.,"/** * Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k. */ function maxSumPairDiffLessthanK(arr: Array, n: number, k: number): number {","function maxSumPairDiffLessthanK(arr: Array, n: number, k: number): number {","['arr', 'n', 'k']","def max_sum_pair_diff_lessthan_K(arr, N, K): arr.sort() dp = [0] * N dp[0] = 0 for i in range(1, N): dp[i] = dp[i-1] if (arr[i] - arr[i-1] < K): if (i >= 2): dp[i] = max(dp[i], dp[i-2] + arr[i] + arr[i-1]); else: dp[i] = max(dp[i], arr[i] + arr[i-1]); return dp[N - 1]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'maxSumPairDiffLessthanK', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find maximum possible sum of disjoint pairs for the given array of integers and a number k.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr: Array, n: number, k: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 5, 10, 15, 17, 12, 9], 7, 4, 62);\n console.log(`TEST-0...${result}`);\n\n result = driver([5, 15, 10, 300], 4, 12, 25);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6], 6, 6, 21);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 62, ""inputs"": {""arr"": [3, 5, 10, 15, 17, 12, 9], ""n"": 7, ""k"": 4}}, {""idx"": 1, ""outputs"": 25, ""inputs"": {""arr"": [5, 15, 10, 300], ""n"": 4, ""k"": 12}}, {""idx"": 2, ""outputs"": 21, ""inputs"": {""arr"": [1, 2, 3, 4, 5, 6], ""n"": 6, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 572,MBPP/572,TypeScript,Write a typescript function to remove two duplicate numbers from a given number of arrays.,"/** * Write a typescript function to remove two duplicate numbers from a given number of arrays. */ function twoUniqueNums(nums: Array): Array {",function twoUniqueNums(nums: Array): Array {,['nums'],"def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'twoUniqueNums', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to remove two duplicate numbers from a given number of lists.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(nums: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 2, 3, 4, 5], [1, 4, 5]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 2, 4, 5], [1, 3, 4, 5]);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 3, 4, 5]}}, {""idx"": 1, ""outputs"": [1, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 2, 4, 5]}}, {""idx"": 2, ""outputs"": [1, 2, 3, 4, 5], ""inputs"": {""nums"": [1, 2, 3, 4, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 573,MBPP/573,TypeScript,Write a typescript function to calculate the product of the unique numbers of a given array.,"/** * Write a typescript function to calculate the product of the unique numbers of a given array. */ function uniqueProduct(list_data: Array): number {",function uniqueProduct(list_data: Array): number {,['list_data'],"def unique_product(list_data): temp = list(set(list_data)) p = 1 for i in temp: p *= i return p","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'uniqueProduct', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to calculate the product of the unique numbers of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list_data: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list_data),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([10, 20, 30, 40, 20, 50, 60, 40], 720000000);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 1], 6);\n console.log(`TEST-1...${result}`);\n\n result = driver([7, 8, 9, 0, 1, 1], 0);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 720000000, ""inputs"": {""list_data"": [10, 20, 30, 40, 20, 50, 60, 40]}}, {""idx"": 1, ""outputs"": 6, ""inputs"": {""list_data"": [1, 2, 3, 1]}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""list_data"": [7, 8, 9, 0, 1, 1]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 574,MBPP/574,TypeScript,Write a function to find the surface area of a cylinder.,"/** * Write a function to find the surface area of a cylinder. */ function surfaceareaCylinder(r: number, h: number): number {","function surfaceareaCylinder(r: number, h: number): number {","['r', 'h']","def surfacearea_cylinder(r,h): surfacearea=((2*3.1415*r*r) +(2*3.1415*r*h)) return surfacearea","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'surfaceareaCylinder', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the surface area of a cylinder.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return Math.abs(actual - expected) < 1e-09;\n}\n\nfunction driver(r: number, h: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(r, h),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 5, 942.45);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 5, 226.18800000000002);\n console.log(`TEST-1...${result}`);\n\n result = driver(4, 10, 351.848);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 942.45, ""inputs"": {""r"": 10, ""h"": 5}}, {""idx"": 1, ""outputs"": 226.18800000000002, ""inputs"": {""r"": 4, ""h"": 5}}, {""idx"": 2, ""outputs"": 351.848, ""inputs"": {""r"": 4, ""h"": 10}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 575,MBPP/575,TypeScript,Write a typescript function to find nth number in a sequence which is not a multiple of a given number.,"/** * Write a typescript function to find nth number in a sequence which is not a multiple of a given number. */ function countNo(a: number, n: number, l: number, r: number): number {","function countNo(a: number, n: number, l: number, r: number): number {","['a', 'n', 'l', 'r']","def count_no (A,N,L,R): count = 0 for i in range (L,R + 1): if (i % A != 0): count += 1 if (count == N): break return (i) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'countNo', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find nth number in a sequence which is not a multiple of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: number, n: number, l: number, r: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, l, r),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(2, 3, 1, 10, 5);\n console.log(`TEST-0...${result}`);\n\n result = driver(3, 6, 4, 20, 11);\n console.log(`TEST-1...${result}`);\n\n result = driver(5, 10, 4, 20, 16);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 5, ""inputs"": {""a"": 2, ""n"": 3, ""l"": 1, ""r"": 10}}, {""idx"": 1, ""outputs"": 11, ""inputs"": {""a"": 3, ""n"": 6, ""l"": 4, ""r"": 20}}, {""idx"": 2, ""outputs"": 16, ""inputs"": {""a"": 5, ""n"": 10, ""l"": 4, ""r"": 20}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 576,MBPP/576,TypeScript,Write a typescript function to check whether an array is subarray of another or not.,"/** * Write a typescript function to check whether an array is subarray of another or not. */ function isSubArray(a: Array, b: Array, n: number, m: number): boolean {","function isSubArray(a: Array, b: Array, n: number, m: number): boolean {","['a', 'b', 'n', 'm']","def is_Sub_Array(A,B,n,m): i = 0; j = 0; while (i < n and j < m): if (A[i] == B[j]): i += 1; j += 1; if (j == m): return True; else: i = i - j + 1; j = 0; return False; ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'isSubArray', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether an array is subarray of another or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: Array, b: Array, n: number, m: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b, n, m),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 4, 3, 5], [1, 2], 4, 2, false);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 1], [1, 2, 1], 3, 3, true);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 0, 2, 2], [2, 2, 0], 4, 3, false);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""a"": [1, 4, 3, 5], ""b"": [1, 2], ""n"": 4, ""m"": 2}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""a"": [1, 2, 1], ""b"": [1, 2, 1], ""n"": 3, ""m"": 3}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""a"": [1, 0, 2, 2], ""b"": [2, 2, 0], ""n"": 4, ""m"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 577,MBPP/577,TypeScript,Write a typescript function to find the last digit in factorial of a given number.,"/** * Write a typescript function to find the last digit in factorial of a given number. */ function lastDigitFactorial(n: number): number {",function lastDigitFactorial(n: number): number {,['n'],"def last_Digit_Factorial(n): if (n == 0): return 1 elif (n <= 2): return n elif (n == 3): return 6 elif (n == 4): return 4 else: return 0","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'lastDigitFactorial', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the last digit in factorial of a given number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(4, 4);\n console.log(`TEST-0...${result}`);\n\n result = driver(21, 0);\n console.log(`TEST-1...${result}`);\n\n result = driver(30, 0);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 4, ""inputs"": {""n"": 4}}, {""idx"": 1, ""outputs"": 0, ""inputs"": {""n"": 21}}, {""idx"": 2, ""outputs"": 0, ""inputs"": {""n"": 30}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 578,MBPP/578,TypeScript,Write a function to interleave arrays of the same length.,"/** * Write a function to interleave arrays of the same length. */ function interleaveLists(list1: Array, list2: Array, list3: Array): Array {","function interleaveLists(list1: Array, list2: Array, list3: Array): Array {","['list1', 'list2', 'list3']","def interleave_lists(list1,list2,list3): result = [el for pair in zip(list1, list2, list3) for el in pair] return result","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'interleaveLists', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to interleave lists of the same length.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array, list2: Array, list3: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1, list2, list3),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4, 5, 6, 7], [10, 20, 30, 40, 50, 60, 70], [100, 200, 300, 400, 500, 600, 700], [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]);\n console.log(`TEST-0...${result}`);\n\n result = driver([10, 20], [15, 2], [5, 10], [10, 15, 5, 20, 2, 10]);\n console.log(`TEST-1...${result}`);\n\n result = driver([11, 44], [10, 15], [20, 5], [11, 10, 20, 44, 15, 5]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700], ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7], ""list2"": [10, 20, 30, 40, 50, 60, 70], ""list3"": [100, 200, 300, 400, 500, 600, 700]}}, {""idx"": 1, ""outputs"": [10, 15, 5, 20, 2, 10], ""inputs"": {""list1"": [10, 20], ""list2"": [15, 2], ""list3"": [5, 10]}}, {""idx"": 2, ""outputs"": [11, 10, 20, 44, 15, 5], ""inputs"": {""list1"": [11, 44], ""list2"": [10, 15], ""list3"": [20, 5]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 579,MBPP/579,TypeScript,Write a function to find the dissimilar elements in the given two tuples.,"/** * Write a function to find the dissimilar elements in the given two tuples. */ function findDissimilar(test_tup1: Array, test_tup2: Array): Array {","function findDissimilar(test_tup1: Array, test_tup2: Array): Array {","['test_tup1', 'test_tup2']","def find_dissimilar(test_tup1, test_tup2): res = tuple(set(test_tup1) ^ set(test_tup2)) return (res) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findDissimilar', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the dissimilar elements in the given two tuples.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(test_tup1: Array, test_tup2: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(test_tup1, test_tup2),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([3, 4, 5, 6], [5, 7, 4, 10], [3, 6, 7, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], [7, 2, 3, 9], [1, 4, 7, 9]);\n console.log(`TEST-1...${result}`);\n\n result = driver([21, 11, 25, 26], [26, 34, 21, 36], [34, 36, 11, 25]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [3, 6, 7, 10], ""inputs"": {""test_tup1"": [3, 4, 5, 6], ""test_tup2"": [5, 7, 4, 10]}}, {""idx"": 1, ""outputs"": [1, 4, 7, 9], ""inputs"": {""test_tup1"": [1, 2, 3, 4], ""test_tup2"": [7, 2, 3, 9]}}, {""idx"": 2, ""outputs"": [34, 36, 11, 25], ""inputs"": {""test_tup1"": [21, 11, 25, 26], ""test_tup2"": [26, 34, 21, 36]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 581,MBPP/581,TypeScript,Write a typescript function to find the surface area of the square pyramid.,"/** * Write a typescript function to find the surface area of the square pyramid. */ function surfaceArea(b: number, s: number): number {","function surfaceArea(b: number, s: number): number {","['b', 's']","def surface_Area(b,s): return 2 * b * s + pow(b,2) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'surfaceArea', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the surface area of the square pyramid.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(b: number, s: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(b, s),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 4, 33);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 5, 56);\n console.log(`TEST-1...${result}`);\n\n result = driver(1, 2, 5);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 33, ""inputs"": {""b"": 3, ""s"": 4}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""b"": 4, ""s"": 5}}, {""idx"": 2, ""outputs"": 5, ""inputs"": {""b"": 1, ""s"": 2}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 583,MBPP/583,TypeScript,Write a function for nth catalan number.,"/** * Write a function for nth catalan number. */ function catalanNumber(num: number): number {",function catalanNumber(num: number): number {,['num'],"def catalan_number(num): if num <=1: return 1 res_num = 0 for i in range(num): res_num += catalan_number(i) * catalan_number(num-i-1) return res_num","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'catalanNumber', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function for nth catalan number.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(num: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(num),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(10, 16796);\n console.log(`TEST-0...${result}`);\n\n result = driver(9, 4862);\n console.log(`TEST-1...${result}`);\n\n result = driver(7, 429);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 16796, ""inputs"": {""num"": 10}}, {""idx"": 1, ""outputs"": 4862, ""inputs"": {""num"": 9}}, {""idx"": 2, ""outputs"": 429, ""inputs"": {""num"": 7}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 584,MBPP/584,TypeScript,Write a function to find all adverbs and their positions in a given sentence by using regex.,"/** * Write a function to find all adverbs and their positions in a given sentence by using regex. */ function findAdverbs(text: string): string {",function findAdverbs(text: string): string {,['text'],"import re def find_adverbs(text): for m in re.finditer(r""\w+ly"", text): return ('%d-%d: %s' % (m.start(), m.end(), m.group(0)))","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findAdverbs', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find all adverbs and their positions in a given sentence by using regex.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(text: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(text),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""Clearly, he has no excuse for such behavior."", ""0-7: Clearly"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""Please handle the situation carefuly"", ""28-36: carefuly"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""Complete the task quickly"", ""18-25: quickly"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""0-7: Clearly"", ""inputs"": {""text"": ""Clearly, he has no excuse for such behavior.""}}, {""idx"": 1, ""outputs"": ""28-36: carefuly"", ""inputs"": {""text"": ""Please handle the situation carefuly""}}, {""idx"": 2, ""outputs"": ""18-25: quickly"", ""inputs"": {""text"": ""Complete the task quickly""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 586,MBPP/586,TypeScript,Write a typescript function to split the array and add the first part to the end.,"/** * Write a typescript function to split the array and add the first part to the end. */ function splitArr(a: Array, n: number, k: number): Array {","function splitArr(a: Array, n: number, k: number): Array {","['a', 'n', 'k']","def split_Arr(a,n,k): b = a[:k] return (a[k::]+b[::]) ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'splitArr', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to split the array and add the first part to the end.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: Array, n: number, k: number, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([12, 10, 5, 6, 52, 36], 6, 2, [5, 6, 52, 36, 12, 10]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4], 4, 1, [2, 3, 4, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([0, 1, 2, 3, 4, 5, 6, 7], 8, 3, [3, 4, 5, 6, 7, 0, 1, 2]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [5, 6, 52, 36, 12, 10], ""inputs"": {""a"": [12, 10, 5, 6, 52, 36], ""n"": 6, ""k"": 2}}, {""idx"": 1, ""outputs"": [2, 3, 4, 1], ""inputs"": {""a"": [1, 2, 3, 4], ""n"": 4, ""k"": 1}}, {""idx"": 2, ""outputs"": [3, 4, 5, 6, 7, 0, 1, 2], ""inputs"": {""a"": [0, 1, 2, 3, 4, 5, 6, 7], ""n"": 8, ""k"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 587,MBPP/587,TypeScript,Write a function to convert array to a tuple.,"/** * Write a function to convert array to a tuple. */ function listTuple(listx: Array): Array {",function listTuple(listx: Array): Array {,['listx'],"def list_tuple(listx): tuplex = tuple(listx) return tuplex","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'listTuple', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to convert a list to a tuple.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(listx: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(listx),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([5, 10, 7, 4, 15, 3], [5, 10, 7, 4, 15, 3]);\n console.log(`TEST-0...${result}`);\n\n result = driver([2, 4, 5, 6, 2, 3, 4, 4, 7], [2, 4, 5, 6, 2, 3, 4, 4, 7]);\n console.log(`TEST-1...${result}`);\n\n result = driver([58, 44, 56], [58, 44, 56]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [5, 10, 7, 4, 15, 3], ""inputs"": {""listx"": [5, 10, 7, 4, 15, 3]}}, {""idx"": 1, ""outputs"": [2, 4, 5, 6, 2, 3, 4, 4, 7], ""inputs"": {""listx"": [2, 4, 5, 6, 2, 3, 4, 4, 7]}}, {""idx"": 2, ""outputs"": [58, 44, 56], ""inputs"": {""listx"": [58, 44, 56]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 588,MBPP/588,TypeScript,Write a typescript function to find the difference between largest and smallest value in a given array.,"/** * Write a typescript function to find the difference between largest and smallest value in a given array. */ function bigDiff(nums: Array): number {",function bigDiff(nums: Array): number {,['nums'],"def big_diff(nums): diff= max(nums)-min(nums) return diff","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'bigDiff', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find the difference between largest and smallest value in a given array.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(nums: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(nums),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 2, 3, 4], 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([4, 5, 12], 8);\n console.log(`TEST-1...${result}`);\n\n result = driver([9, 2, 3], 7);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""nums"": [1, 2, 3, 4]}}, {""idx"": 1, ""outputs"": 8, ""inputs"": {""nums"": [4, 5, 12]}}, {""idx"": 2, ""outputs"": 7, ""inputs"": {""nums"": [9, 2, 3]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 589,MBPP/589,TypeScript,Write a function to find perfect squares between two given numbers.,"/** * Write a function to find perfect squares between two given numbers. */ function perfectSquares(a: number, b: number): Array {","function perfectSquares(a: number, b: number): Array {","['a', 'b']","def perfect_squares(a, b): lists=[] for i in range (a,b+1): j = 1; while j*j <= i: if j*j == i: lists.append(i) j = j+1 i = i+1 return lists","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'perfectSquares', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find perfect squares between two given numbers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(a: number, b: number, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, 30, [1, 4, 9, 16, 25]);\n console.log(`TEST-0...${result}`);\n\n result = driver(50, 100, [64, 81, 100]);\n console.log(`TEST-1...${result}`);\n\n result = driver(100, 200, [100, 121, 144, 169, 196]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [1, 4, 9, 16, 25], ""inputs"": {""a"": 1, ""b"": 30}}, {""idx"": 1, ""outputs"": [64, 81, 100], ""inputs"": {""a"": 50, ""b"": 100}}, {""idx"": 2, ""outputs"": [100, 121, 144, 169, 196], ""inputs"": {""a"": 100, ""b"": 200}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 591,MBPP/591,TypeScript,Write a typescript function to interchange the first and last elements in array.,"/** * Write a typescript function to interchange the first and last elements in array. */ function swapList(newlist: Array): Array {",function swapList(newlist: Array): Array {,['newlist'],"def swap_List(newList): size = len(newList) temp = newList[0] newList[0] = newList[size - 1] newList[size - 1] = temp return newList ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'swapList', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to interchange the first and last elements in a list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: Array, expected: Array): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(newlist: Array, expected:Array): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(newlist),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([12, 35, 9, 56, 24], [24, 35, 9, 56, 12]);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3], [3, 2, 1]);\n console.log(`TEST-1...${result}`);\n\n result = driver([4, 5, 6], [6, 5, 4]);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": [24, 35, 9, 56, 12], ""inputs"": {""newlist"": [12, 35, 9, 56, 24]}}, {""idx"": 1, ""outputs"": [3, 2, 1], ""inputs"": {""newlist"": [1, 2, 3]}}, {""idx"": 2, ""outputs"": [6, 5, 4], ""inputs"": {""newlist"": [4, 5, 6]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 592,MBPP/592,TypeScript,Write a typescript function to find sum of product of binomial co-efficients.,"/** * Write a typescript function to find sum of product of binomial co-efficients. */ function sumOfProduct(n: number): number {",function sumOfProduct(n: number): number {,['n'],"def binomial_Coeff(n,k): C = [0] * (k + 1); C[0] = 1; # nC0 is 1 for i in range(1,n + 1): for j in range(min(i, k),0,-1): C[j] = C[j] + C[j - 1]; return C[k]; def sum_Of_product(n): return binomial_Coeff(2 * n,n - 1); ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'sumOfProduct', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to find sum of product of binomial co-efficients.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(3, 15);\n console.log(`TEST-0...${result}`);\n\n result = driver(4, 56);\n console.log(`TEST-1...${result}`);\n\n result = driver(1, 1);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 15, ""inputs"": {""n"": 3}}, {""idx"": 1, ""outputs"": 56, ""inputs"": {""n"": 4}}, {""idx"": 2, ""outputs"": 1, ""inputs"": {""n"": 1}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 593,MBPP/593,TypeScript,Write a function to remove leading zeroes from an ip address.,"/** * Write a function to remove leading zeroes from an ip address. */ function removezeroIp(ip: string): string {",function removezeroIp(ip: string): string {,['ip'],"import re def removezero_ip(ip): string = re.sub('\.[0]*', '.', ip) return string ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'removezeroIp', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to remove leading zeroes from an ip address.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: string, expected: string): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(ip: string, expected:string): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(ip),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(""216.08.094.196"", ""216.8.94.196"");\n console.log(`TEST-0...${result}`);\n\n result = driver(""12.01.024"", ""12.1.24"");\n console.log(`TEST-1...${result}`);\n\n result = driver(""216.08.094.0196"", ""216.8.94.196"");\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.196""}}, {""idx"": 1, ""outputs"": ""12.1.24"", ""inputs"": {""ip"": ""12.01.024""}}, {""idx"": 2, ""outputs"": ""216.8.94.196"", ""inputs"": {""ip"": ""216.08.094.0196""}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 594,MBPP/594,TypeScript,Write a function to find the difference of first even and odd number of a given array.,"/** * Write a function to find the difference of first even and odd number of a given array. */ function diffEvenOdd(list1: Array): number {",function diffEvenOdd(list1: Array): number {,['list1'],"def diff_even_odd(list1): first_even = next((el for el in list1 if el%2==0),-1) first_odd = next((el for el in list1 if el%2!=0),-1) return (first_even-first_odd)","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'diffEvenOdd', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find the difference of first even and odd number of a given list.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(list1: Array, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(list1),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([1, 3, 5, 7, 4, 1, 6, 8], 3);\n console.log(`TEST-0...${result}`);\n\n result = driver([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1);\n console.log(`TEST-1...${result}`);\n\n result = driver([1, 5, 7, 9, 10], 9);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 3, ""inputs"": {""list1"": [1, 3, 5, 7, 4, 1, 6, 8]}}, {""idx"": 1, ""outputs"": 1, ""inputs"": {""list1"": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}}, {""idx"": 2, ""outputs"": 9, ""inputs"": {""list1"": [1, 5, 7, 9, 10]}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 597,MBPP/597,TypeScript,Write a function to find kth element from the given two sorted arrays.,"/** * Write a function to find kth element from the given two sorted arrays. */ function findKth(arr1: Array, arr2: Array, m: number, n: number, k: number): number {","function findKth(arr1: Array, arr2: Array, m: number, n: number, k: number): number {","['arr1', 'arr2', 'm', 'n', 'k']","def find_kth(arr1, arr2, m, n, k): sorted1 = [0] * (m + n) i = 0 j = 0 d = 0 while (i < m and j < n): if (arr1[i] < arr2[j]): sorted1[d] = arr1[i] i += 1 else: sorted1[d] = arr2[j] j += 1 d += 1 while (i < m): sorted1[d] = arr1[i] d += 1 i += 1 while (j < n): sorted1[d] = arr2[j] d += 1 j += 1 return sorted1[k - 1]","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'findKth', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to find kth element from the given two sorted arrays.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: number, expected: number): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(arr1: Array, arr2: Array, m: number, n: number, k: number, expected:number): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(arr1, arr2, m, n, k),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver([2, 3, 6, 7, 9], [1, 4, 8, 10], 5, 4, 5, 6);\n console.log(`TEST-0...${result}`);\n\n result = driver([100, 112, 256, 349, 770], [72, 86, 113, 119, 265, 445, 892], 5, 7, 7, 256);\n console.log(`TEST-1...${result}`);\n\n result = driver([3, 4, 7, 8, 10], [2, 5, 9, 11], 5, 4, 6, 8);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": 6, ""inputs"": {""arr1"": [2, 3, 6, 7, 9], ""arr2"": [1, 4, 8, 10], ""m"": 5, ""n"": 4, ""k"": 5}}, {""idx"": 1, ""outputs"": 256, ""inputs"": {""arr1"": [100, 112, 256, 349, 770], ""arr2"": [72, 86, 113, 119, 265, 445, 892], ""m"": 5, ""n"": 7, ""k"": 7}}, {""idx"": 2, ""outputs"": 8, ""inputs"": {""arr1"": [3, 4, 7, 8, 10], ""arr2"": [2, 5, 9, 11], ""m"": 5, ""n"": 4, ""k"": 6}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 598,MBPP/598,TypeScript,Write a function to check whether the given number is armstrong or not.,"/** * Write a function to check whether the given number is armstrong or not. */ function armstrongNumber(number: number): boolean {",function armstrongNumber(number: number): boolean {,['number'],"def armstrong_number(number): sum = 0 times = 0 temp = number while temp > 0: times = times + 1 temp = temp // 10 temp = number while temp > 0: reminder = temp % 10 sum = sum + (reminder ** times) temp //= 10 if number == sum: return True else: return False","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'armstrongNumber', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a function to check whether the given number is armstrong or not.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(number: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(number),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(153, true);\n console.log(`TEST-0...${result}`);\n\n result = driver(259, false);\n console.log(`TEST-1...${result}`);\n\n result = driver(4458, false);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": true, ""inputs"": {""number"": 153}}, {""idx"": 1, ""outputs"": false, ""inputs"": {""number"": 259}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""number"": 4458}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}" 600,MBPP/600,TypeScript,Write a typescript function to check whether the given number is even or not using bitwise operator.,"/** * Write a typescript function to check whether the given number is even or not using bitwise operator. */ function isEven(n: number): boolean {",function isEven(n: number): boolean {,['n'],"def is_Even(n) : if (n^1 == n+1) : return True; else : return False; ","{'entry_cls_name': 'Solution', 'extension': 'ts', 'entry_fn_name': 'isEven', 'test_code': '\n// Question Prompt (NOT what is passed to the model)\n// Write a python function to check whether the given number is even or not using bitwise operator.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nfunction convertToString(value: any): string{\n return JSON.stringify(value, function (key, val) {\n if (val instanceof Set) {\n return Array.from(val);\n } return val;});\n}\n\nfunction validateSolution(actual: boolean, expected: boolean): boolean {\n return convertToString(actual) === convertToString(expected);\n}\n\nfunction driver(n: number, expected:boolean): string {\n try{\n if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){\n return ""PASSED"";\n }\n return ""FAILED"";\n } catch (error) {\n return error.name;\n }\n \n}\n \nfunction main(){\n let result = \'\';\n result = driver(1, false);\n console.log(`TEST-0...${result}`);\n\n result = driver(2, true);\n console.log(`TEST-1...${result}`);\n\n result = driver(3, false);\n console.log(`TEST-2...${result}`);\n\n};\n\nmain();', 'test_list': '[{""idx"": 0, ""outputs"": false, ""inputs"": {""n"": 1}}, {""idx"": 1, ""outputs"": true, ""inputs"": {""n"": 2}}, {""idx"": 2, ""outputs"": false, ""inputs"": {""n"": 3}}]', 'test_case_ids': ['0', '1', '2'], 'commands': [['tsc', '--target', 'es2020', '--lib', 'es5,dom,es2015,es2020', '__FILENAME__'], ['node', '__FILENAME__.js']], 'timeouts': [15, 10]}"