Showing 3 of 26 questions
Design a data structure to check if the last 'k' integers in a stream are equal to a given number. Implement a function that efficiently determines if the last 'k' elements are consecutive and match the given value.
#1. Find Consecutive Integers from a Data Stream
Determine the maximum level of nested parentheses within a given string. Essentially, find the deepest level of parentheses in the expression.
#2. Maximum Nesting Depth of the Parentheses
Given a grid representing land and water, count the number of distinct islands. An island is formed by connected land cells.
#3. Number of Islands