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 1287: Element Appearing More Than 25% In Sorted Array

Given a sorted integer array, find and return the integer that occurs more than 25% of the time.

Leetcode 1337: The K Weakest Rows in a Matrix

You are given a binary matrix where 1’s represent soldiers and 0’s represent civilians. The soldiers are positioned before the civilians in each row. A row is weaker than another if it has fewer soldiers, or if it has the same number of soldiers but appears earlier. Your task is to return the indices of the k weakest rows in the matrix, ordered from weakest to strongest.

Leetcode 1351: Count Negative Numbers in a Sorted Matrix

You are given an m x n matrix grid, sorted in non-increasing order both row-wise and column-wise. Your task is to determine how many negative numbers are present in the grid.

Leetcode 1356: Sort Integers by The Number of 1 Bits

You are given an array of integers. Sort the array based on the number of 1’s in the binary representation of each integer. If two integers have the same number of 1’s, sort them in ascending order of the integer value.