Generate a unique JSON object suitable for automating the programming…
- User
Assistant: User: 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", "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 the JSON follows this exact structure and does not include any additional text or variations. The task should be complex and unique, avoiding direct copying from common platforms like LeetCode or similar sources.
Assistant:
- Assistant
{ "Title": "Unique String Combination Generator", "Task Description": "Create a function that generates all possible unique two-character combinations from a given string. The function should return these combinations in a lexicographical order.", "Function Signature": "def generate_combinations(s: str) -> list:", "Solve": "def generate_combinations(s: str) -> list:\n from itertools import combinations\n unique_combinations = set(combinations(s, 2))\n sorted_combinations = sorted([''.join(comb) for comb in unique_combinations])\n return sorted_combinations", "Input": "A string 's' consisting of lowercase alphabets. The length of the string will be between 2 and 100.", "Output": "A list of strings containing two-character combinations sorted in lexicographical order.", "Examples": [ { "input": "\"abc\"", "output": "[\"ab\", \"ac\", \"bc\"]" }, { "input": "\"aabb\"", "output": "[\"ab\", \"aa\", \"bb\"]" } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.