All Posts

Leetcode 113: Path Sum II

Given the root of a binary tree and an integer targetSum, return all paths from the root to the leaf nodes where the sum of the node values along the path equals the targetSum. A root-to-leaf path is defined as any path that starts from the root and ends at a leaf node. A leaf node is a node that does not have any children.

Leetcode 131: Palindrome Partitioning

You are given a string s. Partition the string into all possible substrings such that each substring is a palindrome.

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 494: Target Sum

You are given an integer array nums and an integer target. You must build an expression by adding ‘+’ or ‘-’ before each element in nums and concatenate them to form an expression. Return the number of different expressions that result in the target value.

Leetcode 638: Shopping Offers

In a store, there are n items available for sale, each with a given price. You are also given a list of special offers where you can buy multiple items at a discounted price. Your task is to determine the minimum total price to purchase the required quantities of each item, while utilizing the special offers optimally. You can use any offer as many times as you like, but cannot buy more items than you need.

Leetcode 698: Partition to K Equal Sum Subsets

Given an integer array nums and an integer k, your task is to determine if it is possible to divide this array into k non-empty subsets such that each subset has an equal sum.