Algorithms Number of Substrings in String of 0s and 1s that have K 1s In this article, we have explored algorithm to find the Number of Substrings in a String of 0's and 1's that have 'K' number of 1's.

Data Structures Data Structure with insert and product of last K elements operations We have presented 2 designs for Data Structure with insert and product of last K elements operations. Both operations can be done in constant time O(1).

List of Mathematical Algorithms Equilibrium Index: Find index such that sum of left sub-array = right sub-array For a given array, we need to find an index such that sum of left sub-array = right sub-array also called the Equilibrium Index. We solve this using brute force approach O(N^2) and using prefix array in linear O(N) time.

Algorithms Tile Stacking Problem We demonstrate how we will reduce the time complexity from O((k+1)^(m+1)) to O(N * M * K) to O(N * M). We have infinite number of tiles of sizes 1 to m. The task is calculate the number of different stable tower of height n with restriction that you can use at most k tiles of each size in the tower

Data Structures Prefix sum array Prefix Sum array is a data structure design which helps us to answer several queries such as sum in a given range in constant time which would otherwise take linear time. It requires a linear time preprocessing and is widely used due to its simplicity and effectiveness.