Tag: c++
You are given a list blocks where each block contains two integers where start < end. You can join two blocks if the end of one is equal to …
In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree with N …
Given a binary tree root, remove all nodes with only one child. Constraints n ≤ 100,000 where n is the number of nodes in root Example 1 Input root …
Given a list of integers nums and an integer k, return whether there are four distinct elements in the list that add up to k. Constraints n ≤ 100 …
Given a directed graph represented as an adjacency list, return its reverse so if an edge goes from A to B, it now goes from B to A. Each …