All Posts
Leetcode 1943: Describe the Painting
You are given a painting represented by a number line. Multiple overlapping segments are painted with different colors. Your task is to return a minimal set of non-overlapping painted segments, where each segment represents a portion of the painting with a unique set of mixed colors. Each segment should be represented by the sum of the colors in the mixed sets.
Leetcode 1980: Find Unique Binary String
You are given an array of unique binary strings, each of length n. Your task is to find and return a binary string of length n that is not present in the given array. There can be multiple valid solutions.
Leetcode 1993: Operations on Tree
n
nodes numbered from 0
to n - 1
represented by a parent
array. You need to implement the LockingTree
class with methods for locking, unlocking, and upgrading nodes in the tree based on certain conditions.
You are given a tree with Leetcode 1995: Count Special Quadruplets
Given a 0-indexed integer array ’nums’, return the number of distinct quadruplets (a, b, c, d) such that:
- nums[a] + nums[b] + nums[c] == nums[d], and
- a < b < c < d.