All Posts

Leetcode 1232: Check If It Is a Straight Line

You are given an array of coordinates, where each coordinate represents a point in the 2D plane. Your task is to check if all the points in the array lie on the same straight line.

Leetcode 1266: Minimum Time Visiting All Points

You are given an array of points with integer coordinates. Calculate the minimum time to visit all points in the given order using vertical, horizontal, or diagonal movements.

Leetcode 1401: Circle and Rectangle Overlapping

You are given a circle represented by its radius and center coordinates, as well as an axis-aligned rectangle represented by its bottom-left and top-right corners. Determine if the circle and the rectangle overlap, i.e., if there is any point inside both the circle and the rectangle.

Leetcode 1828: Queries on Number of Points Inside a Circle

You are given an array of points, each represented by its coordinates [xi, yi] on a 2D plane. You are also given an array of queries, where each query describes a circle defined by its center at (xj, yj) and its radius rj. For each query, your task is to compute how many points lie inside or on the border of the circle.

Leetcode 2101: Detonate the Maximum Bombs

You are given a list of bombs represented by a 2D array ‘bombs’ where each bomb is described by three integers: [xi, yi, ri]. xi and yi denote the X and Y coordinates of the bomb, while ri is its blast radius. Your task is to find the maximum number of bombs that can be detonated by initiating a detonation of one bomb.

Leetcode 2249: Count Lattice Points Inside a Circle

You are given a 2D integer array circles, where each element circles[i] = [xi, yi, ri] represents a circle with center at (xi, yi) and radius ri. The task is to find the number of lattice points that lie inside at least one of the given circles. A lattice point is defined as a point with integer coordinates, and points lying on the circumference of a circle are also considered inside.