feat: add maxConsecutiveOnesIII implementation (#1286)

This commit is contained in:
Andrea Tota
2023-02-13 12:40:20 +01:00
committed by GitHub
parent 49bd1fd0c2
commit 55c18aef69
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import { maxConsecutiveOnesIII } from '../MaxConsecutiveOnesIII'
describe('maxConsecutiveOnesIIIIII', () => {
it('expects to return 0 when argument is empty array', () => {
expect(maxConsecutiveOnesIII([], 3)).toBe(0)
})
it('expects to return 6', () => {
expect(maxConsecutiveOnesIII([1, 1, 0, 1, 1, 1], 1)).toBe(6)
})
it('expects to return 8', () => {
expect(maxConsecutiveOnesIII([1, 0, 1, 1, 1, 1, 0, 1], 2)).toBe(8)
})
})