All Posts

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 1986: Minimum Number of Work Sessions to Finish the Tasks

You are assigned several tasks, each with a specified time required to complete. A work session allows you to work continuously for up to sessionTime consecutive hours before taking a break. Your goal is to determine the minimum number of work sessions required to complete all tasks under the following conditions:

  • If a task is started in a session, it must be completed within that same session.
  • You may complete the tasks in any order.
  • You can begin a new task immediately after finishing the previous one.

Return the minimum number of work sessions needed to complete all tasks.

Leetcode 2002: Maximum Product of the Length of Two Palindromic Subsequences

Given a string s, find two disjoint palindromic subsequences such that the product of their lengths is maximized. The two subsequences are disjoint if they do not both pick a character at the same index.

Leetcode 2044: Count Number of Maximum Bitwise-OR Subsets

Given an integer array nums, find the maximum bitwise OR that can be achieved by any subset of nums and count how many different non-empty subsets yield this maximum value. A subset is defined as any combination of elements from the array, and subsets are considered different if their elements are selected from different indices.

Leetcode 2048: Next Greater Numerically Balanced Number

An integer x is numerically balanced if, for every digit d in x, the digit d occurs exactly d times in the number. For example, 22 is numerically balanced because the digit 2 appears exactly 2 times, while 3133 is numerically balanced because the digit 3 appears exactly 3 times, and the digit 1 appears exactly 1 time.

Given an integer n, find the smallest numerically balanced integer that is strictly greater than n.

Leetcode 2178: Maximum Split of Positive Even Integers

Given an integer finalSum, split it into a sum of as many unique positive even integers as possible. If such a split is not possible, return an empty array.