Linear Algorithm to Check If All 1’s Are at Least Length K Places Away May 3, 2020 algorithms, c / c++ No Comments Given an array nums of 0s and 1s and an integer k, return True if all 1’s are at least k places away from each other, otherwise return False. … [Continue Reading...]
Coding Exercise – Find Max Consecutive Ones July 28, 2018 c / c++, coding exercise, learn to code, python No Comments Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: Output: 3 Explanation: The first two digits or the last three digits … [Continue Reading...]