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": "",
"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 nested structures.
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 'Solve' section must remain empty.
6. Ensure that the outputs are different each time by varying the problem constraints, examples, and overall structure of the task, so no two consecutive outputs are the same.
7. Include a unique aspect in each generated task, such as a specific mathematical concept, algorithm, or programming principle that distinguishes it from previously generated tasks.
8. The 'Function Signature' should strictly follow the format: 'def function_name(parameters) -> return_type:', but the 'Solve' section must remain empty. Ensure that the input description corresponds to the expected parameters in the signature.
Ensure that the solution must not be any of the following titles:
String Transformation with Vowel Count
Custom Weighted Sorting
Palindrome Substring Manipulation
Nested Substring Compression
Cyclic String Rotation and Character Frequency
Nested List Product Calculation
Selective Nested Function Evaluation
Maximum Non-Adjacent Sum
Graph Water Distribution Planning
Consonant Cluster Reversal
Shortest Path in a Weighted Grid
Palindrome Compression
Multi-Dimensional Array Spiral Sort
String Pattern Replacer
Matrix Diagonal Sum with Nested Conditions
String Interleaving with Character Frequency
Balanced Parentheses Scoring
Character Sequence Extraction and Reversal
Optimal Coin Change with Limited Supply
Optimal Subarray Partition
Nested Dictionary Path Evaluation
Digit Frequency Sort with Multiples
Custom Recursive Merge Sort with Conditional Swapping
Dynamic Subset Sum with Constraints
Graph Path with Prime Labeling
Nested Fibonacci Sequence Evaluation
Assistant
json
Hierarchical Data Aggregation
Multi-Dimensional Array Median Calculation
Cycle Detection in Directed Graph with Constraints
Minimum Cost Path with Obstacles
String Segment Reversal with Unique Character Count
Game Score Maximization with Constraints
Isomorphic Graph Detection
Advanced Alphanumeric Pattern Extraction
Constrained Pyramid Formation
Maximal Rectangle Area in Grid
Priority Queue Simulation with Custom Criteria
Weighted Nested List Sum
Depth-first Search with Prime Node Values
String Compression with Unique Character Count
Hierarchical Employee Salary Adjustment
Custom Radix Sort with Base Conversion
Nested Array Element Swapper
Graph Connectivity with Unique Path Count
Optimal Subsequence Product with Constraints
Graph Traversal with Unique Node Values
Matrix Anti-Diagonal Sorting
Custom Merge Sort with Inversion Count
Graph Shortest Path with Conditional Detours
Dynamic Subsequence Sum with Constraints
Custom Radix Sort with Mixed Base Conversion
Longest Increasing Subsequence with Unique Sum Constraint
Optimal Path in Energy Efficiency Grid
Custom Recursive Quick Sort with Median Pivot
Resource Allocation with Unique Constraints
Advanced Range-Based Sort
Navigating Nested Puzzle Boxes
Unique Graph Traversal with Color Coding
Circular Array Peak Finder
Pattern-Based String Expansion and Compression
Circular String Palindrome Detection
Hierarchical Task Scheduler
Recursive Dag Sorting with Node Constraints
Unique Graph Traversal with Color Coding
Two-Dimensional Float Grid Sort with Boundary Conditions
Nested Dictionary Path Evaluation
Custom Binary Search Tree Insertion
Pattern-Aware String Replacement
Dynamic Subset Product with Limit
Hierarchical Task Dependency Resolver
Maximum Unique Path Sum in Grid
String Manipulation with Character Frequency Analysis
{
"Title": "Matrix Island Detection with Conditional Expansion",
"Task Description": "Develop a function to identify distinct 'islands' in a 2D binary matrix where '1' represents land and '0' represents water. Islands are connected regions of '1's horizontally or vertically. Additionally, expand each island conditionally as follows: if an island's size is greater than or equal to a certain threshold, extend it by altering adjacent '0's to '1's. Return the modified matrix after applying these expansions.",
"Function Signature": "def detect_and_expand_islands(matrix: List[List[int]], threshold: int) -> List[List[int]]:",
"Solve": "",
"Input": "A 2D list of integers 'matrix' consisting of 0s and 1s, representing water and land respectively. An integer 'threshold' that determines the minimum island size required to begin expansion.",
"Output": "A 2D list of integers representing the modified matrix after islands meeting the threshold are expanded by converting adjacent waters ('0's) directly bordering their periphery to land ('1's).",
"Examples": [
{
"input": "matrix = [[1, 1, 0, 0], [1, 0, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]], threshold = 3",
"output": "[[1, 1, 0, 0], [1, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]]"
},
{
"input": "matrix = [[1, 0, 0], [0, 0, 1], [0, 1, 1]], threshold = 2",
"output": "[[1, 0, 0], [0, 0, 1], [0, 1, 1]]"
}
]
}