File size: 1,658 Bytes
0810902
 
 
 
 
1
2
3
4
5
6
{"id": "cd-01", "prompt": "Write a Python function `reverse_words(s)` that reverses the order of words in a string. Return only a fenced Python code block.", "check": {"type": "python_exec", "call": "reverse_words", "cases": [[["one two three"], "three two one"], [["hello"], "hello"], [[""], ""]]}}
{"id": "cd-02", "prompt": "Write a Python function `is_palindrome(s)` returning True if s is a palindrome ignoring case and non-alphanumeric characters. Return only a fenced Python code block.", "check": {"type": "python_exec", "call": "is_palindrome", "cases": [[["A man, a plan, a canal: Panama"], true], [["hello"], false], [[""], true]]}}
{"id": "cd-03", "prompt": "Write a Python function `merge_intervals(intervals)` that merges overlapping intervals given as a list of [start, end] pairs and returns the merged list sorted by start. Return only a fenced Python code block.", "check": {"type": "python_exec", "call": "merge_intervals", "cases": [[[[[1, 3], [2, 6], [8, 10]]], [[1, 6], [8, 10]]], [[[[1, 4], [4, 5]]], [[1, 5]]]]}}
{"id": "cd-04", "prompt": "Write a Python function `fizzbuzz(n)` returning a list of strings for 1..n with the usual FizzBuzz rules. Return only a fenced Python code block.", "check": {"type": "python_exec", "call": "fizzbuzz", "cases": [[[5], ["1", "2", "Fizz", "4", "Buzz"]], [[3], ["1", "2", "Fizz"]]]}}
{"id": "cd-05", "prompt": "Write a Python function `two_sum(nums, target)` returning the indices of the two numbers adding to target, as a sorted list. Return only a fenced Python code block.", "check": {"type": "python_exec", "call": "two_sum", "cases": [[[[2, 7, 11, 15], 9], [0, 1]], [[[3, 2, 4], 6], [1, 2]]]}}