All Posts

Leetcode 513: Find Bottom Left Tree Value

Given the root of a binary tree, return the leftmost value in the last row of the tree.

Leetcode 515: Find Largest Value in Each Tree Row

Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).

Leetcode 516: Longest Palindromic Subsequence

Given a string s, return the length of the longest palindromic subsequence in s. A subsequence is a sequence derived by deleting some or no elements without changing the order of the remaining elements.

Leetcode 518: Coin Change II

Given a set of coins of different denominations, determine how many distinct combinations of these coins sum up to the target amount.

Leetcode 519: Random Flip Matrix

You are given a binary grid of size m x n, where each cell is initially set to 0. The task is to design an algorithm that can randomly pick a cell that is still 0, flip it to 1, and ensure that all available cells are equally likely to be selected.

Leetcode 522: Longest Uncommon Subsequence II

Given an array of strings strs, determine the length of the longest uncommon subsequence between them. An uncommon subsequence is a string that is a subsequence of one string but not the others. If no such subsequence exists, return -1.