gpt-4o-2024-08-06· OpenAI
WildChat-4.8M (AI2)
Please generate a unique programming task in JSON format with the following structure: {…
- User
Please generate a unique programming task in JSON format with the following structure: { "Title": "Task Name", "Task Description": "Description of the task.", "Function Signature": "def function_name(parameters) -> return_type:", "Solve": "", "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 task includes graph traversal algorithms.
- The task must avoid the following titles: .
- The task should be unique and complex.
- The "Solve" section should remain empty.
- Assistantjson
{ "Title": "Unique Paths with Obstacles in a Grid", "Task Description": "Given a grid with obstacles, find the number of unique paths from the top-left corner to the bottom-right corner. The grid consists of cells which may be empty or contain obstacles. The robot can only move either down or right at any point in time.", "Function Signature": "def unique_paths_with_obstacles(grid: List[List[int]]) -> int:", "Solve": "", "Input": "A 2D list 'grid' where each element is either 0 (an empty cell) or 1 (an obstacle). The grid is at least 1x1 in size.", "Output": "An integer representing the number of unique paths from the top-left to the bottom-right of the grid avoiding obstacles.", "Examples": [ { "input": "grid = [[0, 0, 0], [0, 1, 0], [0, 0, 0]]", "output": "2" }, { "input": "grid = [[0, 1], [0, 0]]", "output": "1" } ] }