Given an integer array nums with no duplicates, construct a maximum binary tree by recursively selecting the largest number as the root, and building the left and right subtrees from the elements before and after the largest number.
Given a sorted integer array and two integers k and x, return the k closest integers to x in the array, sorted in ascending order. If two integers are equally close to x, the smaller integer should be preferred.
You are given a sorted integer array nums. Determine if it is possible to split nums into one or more subsequences such that each subsequence is a consecutive increasing sequence and each subsequence has a length of 3 or more.
Given two integers n and k, construct a list of n different positive integers from 1 to n such that the absolute differences between consecutive elements contain exactly k distinct integers. Return any valid solution.
You are given a binary matrix of size m x n, where 1 represents land and 0 represents water. An island is a group of 1’s connected horizontally or vertically. Return the area of the largest island. If there are no islands, return 0.