All Posts

Leetcode 1414: Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

You are given an integer k, and you need to determine the minimum number of Fibonacci numbers whose sum equals k. Note that the same Fibonacci number can be used multiple times. The Fibonacci sequence is defined as F1 = 1, F2 = 1, and Fn = Fn-1 + Fn-2 for n > 2.

Leetcode 1432: Max Difference You Can Get From Changing an Integer

You are given an integer num and you must apply a set of operations twice to generate two new integers. The goal is to find the maximum difference between the results of these operations.

Leetcode 1442: Count Triplets That Can Form Two Arrays of Equal XOR

You are given an array of integers arr. We want to find the number of triplets (i, j, k) where 0 <= i < j <= k < arr.length, such that the bitwise XOR of elements between indices i and j-1 (inclusive) equals the bitwise XOR of elements between indices j and k (inclusive).

Leetcode 1447: Simplified Fractions

Given an integer n, return a list of all unique simplified fractions between 0 and 1 (exclusive) where the denominator is less than or equal to n. A fraction is simplified if the greatest common divisor (GCD) of the numerator and denominator is 1. The result can be returned in any order.

Leetcode 1492: The kth Factor of n

You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0. Consider a sorted list of all factors of n in ascending order. Return the kth factor from this list or return -1 if n has less than k factors.

Leetcode 1512: Number of Good Pairs

You are given an array of integers. A pair (i, j) is called a good pair if nums[i] == nums[j] and i < j. Your task is to find the number of good pairs in the array.