Given an integer array, find the shortest continuous subarray such that, if you sort this subarray in non-decreasing order, the whole array will become sorted.
Given an array of integers, return the number of triplets that can form a valid triangle. A valid triangle is formed when the sum of any two sides is greater than the third side.
Given a list of tasks and a number n, determine the minimum number of CPU intervals required to complete all tasks, respecting the constraint that the same task must be separated by at least n intervals.
Design and implement a Circular Queue. A circular queue is a linear data structure where the operations follow the FIFO principle, and the last position is connected to the first, forming a circle. This design allows better space utilization.
You are given m sorted arrays. Your task is to pick two integers, each from a different array, and calculate the maximum distance between them, where the distance is defined as the absolute difference of the two numbers.