All Posts

Leetcode 2427: Number of Common Factors

You are given two positive integers, a and b. Your task is to find the number of common divisors (factors) between a and b. A number x is considered a common divisor of a and b if it divides both a and b without leaving any remainder.

Leetcode 2442: Count Number of Distinct Integers After Reverse Operations

You are given an array nums consisting of positive integers. For each number in the array, you need to reverse its digits and append the reversed number to the end of the array. After performing this operation for all numbers, return the number of distinct integers in the resulting array.

Leetcode 2443: Sum of Number and Its Reverse

Given a non-negative integer num, determine if num can be expressed as the sum of a non-negative integer and its reverse. If so, return true, otherwise return false.

Leetcode 2447: Number of Subarrays With GCD Equal to K

Given an integer array nums and an integer k, return the number of subarrays in which the greatest common divisor (GCD) of all the elements is exactly k. A subarray is a contiguous non-empty sequence of elements within the array.

Leetcode 2455: Average Value of Even Numbers That Are Divisible by Three

You are given an array of positive integers ’nums’. Your task is to calculate the average value of all even numbers in the array that are also divisible by 3. The average should be rounded down to the nearest integer.

Leetcode 2457: Minimum Addition to Make Integer Beautiful

Given a positive integer n and a target sum, the task is to find the smallest non-negative integer x such that the sum of the digits of n + x is less than or equal to the given target. The solution is guaranteed to always be possible for the given constraints.