All Posts

Leetcode 2125: Number of Laser Beams in a Bank

You are given a 2D binary grid, where ‘1’ represents a security device and ‘0’ represents an empty cell. A laser beam can be formed between two devices if they are located on two different rows and no security device is in any row between them. The task is to find the total number of laser beams that can be formed.

Leetcode 2139: Minimum Moves to Reach Target Score

You start with the integer 1, and you need to reach the target integer using the minimum number of moves. In one move, you can either increment the current integer by 1 or double it. The doubling operation can be used at most maxDoubles times.

Leetcode 2160: Minimum Sum of Four Digit Number After Splitting Digits

You are given a four-digit integer ’num’. Your task is to split this number into two new integers, ’new1’ and ’new2’, by rearranging its digits. The digits in ’num’ must be used in their entirety, and leading zeros are allowed in ’new1’ and ’new2’. Your goal is to return the minimum possible sum of ’new1’ and ’new2'.

Leetcode 2165: Smallest Value of the Rearranged Number

You are given an integer ’num’. Your task is to rearrange the digits of ’num’ such that its value is minimized, with the constraint that the number must not contain any leading zeros. The sign of the number should not change after rearranging the digits.

Leetcode 2169: Count Operations to Obtain Zero

You are given two non-negative integers, num1 and num2. In each operation, subtract the smaller number from the larger one. Continue until one of the numbers becomes zero and return the number of operations performed.

Leetcode 2177: Find Three Consecutive Integers That Sum to a Given Number

Given an integer num, your task is to determine if it can be expressed as the sum of three consecutive integers. If it can, return these integers as a sorted array. If not, return an empty array.