All Posts

Leetcode 343: Integer Break

You are given an integer n. Your task is to break it into a sum of at least two positive integers such that the product of these integers is maximized. Return the maximum product that can be obtained.

Leetcode 357: Count Numbers with Unique Digits

Given an integer n, return the count of all numbers with unique digits x, such that 0 <= x < 10^n.

Leetcode 365: Water and Jug Problem

You are given two jugs with capacities x and y liters, and an infinite supply of water. You need to determine whether you can measure exactly target liters of water using the following operations: fill, empty, and pour water between the jugs.

Leetcode 368: Largest Divisible Subset

You are given a set of distinct positive integers. Return the largest subset where every pair of elements in the subset satisfies either ‘one element is divisible by the other’.

Leetcode 371: Sum of Two Integers

You are given two integers a and b. Return their sum without using the + or - operators. You must implement the solution using bitwise operations.

Leetcode 372: Super Pow

Given an integer a and an array b, where b represents a very large number, compute ( a^b % 1337 ). The array b stores the digits of b from most significant to least significant. You must handle extremely large values of b efficiently.