Practice Count Artifacts That Can Be Extracted
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
On an n by n grid, artifacts[i] = [r1,c1,r2,c2] gives the inclusive top-left and bottom-right corners of a buried rectangle. dig lists the cells excavated. Count artifacts whose every covered cell is excavated. Artifacts do not overlap, each covers at most four cells, and dig contains no repeated cells.
Source: Count Artifacts That Can Be Extracted on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1]]
1
# Example 2
n = 2, artifacts = [[0,0,0,0],[0,1,1,1]], dig = [[0,0],[0,1],[1,1]]
2
Constraints
Related LeetCode Problems
Practice more problems similar to Count Artifacts That Can Be Extracted.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.