You are given an array of 1s and 0s and you are given an integer k which signifies the number of flips allowed. Write a program to find the position of zeros which when flipped will produce a maximum continuous series of 1s. Note: This is an excellent problem to learn problem solving using sliding window technique in O(n) time and O(1) space.
A binary array X is given where elements are either 0 or 1. Write a program to find the maximum consecutive ones. The subarray with max continuous 1's can be present anywhere, starting from some index i and ending at some index j. This is an excellent problem to learn problem solving using a sliding window approach and single loop.
Given array X of n integers, write a program to return the count of distinct elements in every window of size k. Here k sized window is a continuous subarray of k elements, and output is an array with the count of unique elements in each window. Note: This is an excellent problem to learn problem-solving using the sliding window approach.
Given a string S, write a program to find the length of longest substring without repeating characters. The substring is a continuous subpart of the string and we need to return the largest substring which has all unique characters. Note: This is an excellent problem to learn problem solving and time complexity optimization using sliding window approach.
Subscribe to get well designed content on data structure and algorithms, machine learning, system design, object orientd programming and math.