Please generate a unique JSON object suitable for automating the…
- User
Assistant: User: Please generate a unique JSON object suitable for automating the programming task testing platform, strictly in the following format: { "Title": "Task Name", "Task Description": "Description of the task.", "Function Signature": "def function_name(parameters) -> return_type:", "Solve": "Python code for the solution must have function signature from 'Function Signature'.", "Input": "Description of the input parameters.", "Output": "Description of the expected output.", "Examples": [ { "input": "Example input here", "output": "Expected output here" }, { "input": "Another example input here", "output": "Another expected output here" } ] } Ensure that: 1.The task includes complex sorting algorithms. 2.The JSON follows this exact structure and does not include any additional text or variations. 3.The task should be complex and unique, avoiding direct copying from common platforms like LeetCode or similar sources. 4.The solution must not use any imports in the code (i.e., no import statements). 5.The solution must contain only one function. 6.Ensure that the outputs are different each time, so no two consecutive outputs are the same. Assistant:
- Assistantjson
{ "Title": "Custom String Sort", "Task Description": "Write a function that sorts a list of strings based on a custom alphabetical order defined by another string. The custom order string contains all the unique characters that can appear in the list of strings. Any character not present in the custom order should always come last in the sorted result, maintaining their original relative order.", "Function Signature": "def custom_string_sort(strings: List[str], order: str) -> List[str]:", "Solve": "def custom_string_sort(strings: List[str], order: str) -> List[str]:\n order_map = {c: i for i, c in enumerate(order)}\n def custom_key(s):\n return [order_map.get(c, len(order)) for c in s]\n return sorted(strings, key=custom_key)", "Input": "strings: A list of strings to sort; order: A string representing the custom alphabetical order.", "Output": "A list of strings sorted based on the given custom order.", "Examples": [ { "input": "['word', 'world', 'row'], 'ordcw'", "output": "['word', 'row', 'world']" }, { "input": "['bat', 'ball', 'apple'], 'lpab'", "output": "['apple', 'ball', 'bat']" } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.