All Posts

Leetcode 1261: Find Elements in a Contaminated Binary Tree

Given a contaminated binary tree, recover it and implement a class to search for specific values in the tree.

Leetcode 1262: Greatest Sum Divisible by Three

Given an array of integers, find the maximum sum of any subsequence where the sum is divisible by 3.

Leetcode 1267: Count Servers that Communicate

You are given a 2D grid where each cell is either 1 (indicating a server) or 0 (no server). Two servers are said to communicate if they are in the same row or column. The task is to find the number of servers that can communicate with at least one other server.

Leetcode 1268: Search Suggestions System

You are given a list of unique product names and a search word. As each character of the search word is typed, you need to suggest up to three products that have a prefix matching the current search word. If there are more than three products with the same prefix, return the three lexicographically smallest products.

Leetcode 1276: Number of Burgers with No Waste of Ingredients

Given two integers tomatoSlices and cheeseSlices, return the number of Jumbo and Small burgers that can be made, such that all tomatoSlices and cheeseSlices are used. If it is not possible, return an empty list.

Leetcode 1277: Count Square Submatrices with All Ones

Given a m x n matrix of ones and zeros, count how many square submatrices are filled with all ones.