You are given two strings s and p, where p is a subsequence of s. You are also given an array removable containing distinct indices of s. Your task is to determine the maximum number of indices you can remove from s such that p is still a subsequence of the remaining string.
In a given 2D grid, a peak element is an element that is greater than all of its adjacent elements (left, right, top, and bottom). You are given an m x n matrix mat where no two adjacent elements are equal. Your task is to find and return the coordinates of any peak element. The grid is surrounded by a perimeter filled with -1.
You are participating in an online chess tournament where rounds start every 15 minutes, starting at 00:00. You are given two times: loginTime and logoutTime. Your task is to calculate the number of full rounds you have participated in during the period from loginTime to logoutTime.
You are given two m x n binary matrices, grid1 and grid2, where each cell can either be 0 (representing water) or 1 (representing land). An island is a group of connected 1’s, connected either horizontally or vertically. An island in grid2 is considered a sub-island if there is a corresponding island in grid1 that contains all the cells of the island in grid2. Your task is to determine the number of sub-islands in grid2.
Given an array of integers nums and a list of queries, where each query is defined as a subarray nums[li...ri], compute the minimum absolute difference between any two distinct elements in that subarray. If all elements in the subarray are the same, return -1.