All Posts

Leetcode 355: Design Twitter

Design a simplified version of Twitter where users can post tweets, follow/unfollow other users, and view the most recent tweets in their news feed.

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.