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 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 1302: Deepest Leaves Sum

Given the root of a binary tree, return the sum of values of its deepest leaves. The deepest leaves are the nodes found at the lowest level of the tree.

Leetcode 1306: Jump Game III

You are given an array of non-negative integers arr and a starting index start. You can jump forward or backward from any index based on the values at the index. Your task is to determine whether you can reach an index with a value of 0.

Leetcode 1311: Get Watched Videos by Your Friends

You are given n people with unique IDs and two lists: watchedVideos and friends. For a given ID and a level k, find the list of videos watched by people at exactly level k from you. Return the videos ordered by their frequency (in increasing order), and alphabetically if there is a tie in frequency.

Leetcode 1315: Sum of Nodes with Even-Valued Grandparent

Given the root of a binary tree, return the sum of the values of the nodes that have an even-valued grandparent. If there are no nodes with an even-valued grandparent, return 0. A grandparent is defined as the parent of a node’s parent, if it exists.