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 the sliding window and a single loop.
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 maximum continuous series of 1s.This is one of the good problems to understand the idea of the sliding window technique. Using this approach, We can solve several interview problems efficiently in O(n) and O(1) space.
Write a program to find the length of the longest substring without repeating characters. Substring is the continuous sub-part of the string. The aim is to determine the maximum such subpart which has all the unique characters.
Subscribe to get free weekly content on data structure and algorithms, machine learning, system design, oops design and mathematics.