Given an array of positive integers and a target value, find the minimal length of a contiguous subarray whose sum is greater than or equal to the target. If no such subarray exists, return 0.
Given an integer array, your task is to return an array where each element at index ‘i’ is the product of all the elements of the original array except the element at index ‘i’. You are not allowed to use division in your solution, and the algorithm must run in O(n) time.
You are given an array of non-overlapping axis-aligned rectangles. Each rectangle is represented by its bottom-left and top-right corner. Your task is to design a system that can pick a random integer point from the space covered by one of the given rectangles. A point on the perimeter of a rectangle is considered inside the rectangle.
Given an integer array nums and an integer k, return true if there exists a good subarray, otherwise return false. A good subarray is defined as a subarray whose length is at least 2 and the sum of its elements is a multiple of k.
You are given a 0-indexed array of positive integers w, where w[i] describes the weight of the ith index. You need to implement the function pickIndex() which randomly picks an index in the range [0, w.length - 1] (inclusive), and the probability of picking index i is w[i] / sum(w).