Practice Maximum Points Inside the Square
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Maximum Points Inside the Square
Problem Statement
Given point coordinates points and corresponding tags s, consider squares centered at (0, 0) with sides parallel to the coordinate axes. A point counts as contained when it is on or inside the boundary. A square is valid when it contains no two points with the same tag, and its side length may be zero. Return the maximum number of points contained in a valid square.
Source: Maximum Points Inside the Square on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
points = [[2,2],[-1,-2],[-4,4],[-3,1],[3,-3]], s = "abdca"
2
# Example 2
points = [[1,1],[-2,-2],[-2,2]], s = "abb"
1
# Example 3
points = [[1,1],[-1,-1],[2,-2]], s = "ccd"
0
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Points Inside the Square.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.