Array
1437. Check If All 1's Are at Least Length K Places Away
Check that every pair of adjacent 1s in a binary array is separated by at least k zeros. Just track the last 1's position and verify each gap.
Loading…
Check that every pair of adjacent 1s in a binary array is separated by at least k zeros. Just track the last 1's position and verify each gap.
Loading…