Tag: algorithm
Given a list of lowercase alphabet strings words, return the length of the longest contiguous sublist where all words share the same first letter. Example 1 Input words = …
You are given a list of integers nums that used to be an arithmetic sequence. Given that a number was removed, and that the number was not the first …
Given a sorted list nums of size n, construct a binary search tree by Taking nums as the root where k = floor(n / 2). Recursively constructing the left …
Given an n by n integer matrix, return the sum of all elements that form a Z in the matrix. Constraints n ≤ 1,000 Example 1 Input matrix = …
Given a binary tree root, return the maximum width of any level in the tree. The width of a level is the number of nodes that can fit between …