Showing 3 questions
Calculate a new array where each element is the product of all numbers in the original array, excluding the number at that index. Do this efficiently without using division.
#1. Product of Array Except Self
Determine the maximum number of times a given word consecutively repeats as a substring within a larger sequence. Find the largest integer k such that word * k is a substring of sequence.
#2. Maximum Repeating Substring
Find the k points closest to the origin (0, 0) from a given list of points on a 2D plane. The distance is measured using the Euclidean distance.
#3. K Closest Points to Origin