Skip to content

[Sliding Window] Max Consecutive Ones III #13

@sudosf

Description

@sudosf

Problem

Given a binary array and integer k, return the maximum number of consecutive 1s if you can flip at most k zeros.

References

Difficulty

🟡 Medium

Companies

Amazon, Google, Microsoft

Notes

Language: Java
Variable window. Track zeros flipped. Shrink left when zeros flipped exceeds k.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arraysArray problemsmediumMedium difficultysliding-windowSliding window pattern

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions