Tag: algorithm
Given an integer list nums where each number represents the maximum number of hops you can make, return the minimum number of hops it would take to reach the …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a array of numbers (more than 3 elements), not necessarily sorted, find out the max product of 3 numbers. …
Implement a data structure with the following methods: SlidingWindowProduct() constructs a new instance. add(int num) adds the number num to the data structure. product(int k) returns the product of …
Teaching Kids Programming: Videos on Data Structures and Algorithms An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if …
You are given a string s containing “1”s and “0”s. Return the number of substrings that contain only “1”s. Mod the result by 10 ** 9 + 7. Constraints …