All Posts

Leetcode 2469: Convert the Temperature

You are given a non-negative floating point number celsius (rounded to two decimal places) representing a temperature in Celsius. Convert it to Kelvin and Fahrenheit and return the results in a list. The formulas are: Kelvin = Celsius + 273.15 and Fahrenheit = Celsius * 1.80 + 32.00. Return the results rounded to five decimal places.

Leetcode 2470: Number of Subarrays With LCM Equal to K

Given an integer array nums and an integer k, return the number of subarrays where the Least Common Multiple (LCM) of all the elements in the subarray equals k. A subarray is a contiguous subsequence of elements in the array.

Leetcode 2481: Minimum Cuts to Divide a Circle

You are given a circle, and you need to divide it into ’n’ equal slices using the minimum number of straight cuts. A valid cut can either be through the center of the circle touching two points on the edge or touching just one point and the center.

Leetcode 2485: Find the Pivot Integer

Given a positive integer n, you are tasked with finding an integer x such that the sum of all integers from 1 to x is equal to the sum of all integers from x to n, inclusive. If no such integer exists, return -1. It is guaranteed that there will be at most one solution for the given input.

Leetcode 2507: Smallest Value After Replacing With Sum of Prime Factors

You are given a positive integer n. The task is to repeatedly replace n with the sum of its prime factors, and continue this process until n reaches a value that cannot be reduced further. The process stops when the sum of the prime factors is equal to the current value of n. Return the smallest value n will eventually become.

Leetcode 2513: Minimize the Maximum of Two Arrays

Given two integers divisor1 and divisor2, and two integers uniqueCnt1 and uniqueCnt2, construct two arrays such that: arr1 contains uniqueCnt1 distinct integers that are not divisible by divisor1, arr2 contains uniqueCnt2 distinct integers that are not divisible by divisor2, and no integer appears in both arrays. Return the smallest possible maximum integer in either array.