All Posts

Leetcode 1860: Incremental Memory Leak

You are given two memory sticks with certain amounts of available memory. A program runs and allocates increasing amounts of memory to the stick with more available memory. If neither stick has enough memory to allocate the required amount, the program crashes. Determine when the program crashes and the remaining memory on each stick.

Leetcode 1863: Sum of All Subset XOR Totals

You are given an array of integers nums. The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For every subset of nums, calculate the XOR total and return the sum of all XOR totals.

Leetcode 1878: Get Biggest Three Rhombus Sums in a Grid

You are given an m x n matrix grid. A rhombus sum refers to the sum of the elements that form the border of a rhombus shape. The rhombus should be viewed as a square rotated 45 degrees, with each of its corners centered on a grid cell. Compute the biggest three distinct rhombus sums in the grid and return them in descending order. If there are fewer than three distinct sums, return all of them.

Leetcode 1903: Largest Odd Number in String

You are given a string num, which represents a large integer. Your task is to find the largest odd integer that can be formed from any non-empty substring of num. If no odd integer exists, return an empty string.

Leetcode 1904: The Number of Full Rounds You Have Played

You are participating in an online chess tournament where rounds start every 15 minutes, starting at 00:00. You are given two times: loginTime and logoutTime. Your task is to calculate the number of full rounds you have participated in during the period from loginTime to logoutTime.

Leetcode 1925: Count Square Sum Triples

Given an integer n, count how many square triples (a, b, c) satisfy the equation a^2 + b^2 = c^2 where 1 <= a, b, c <= n. The order of a, b, and c matters.