Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
There is a simple O(N) solution using sliding window.

Andrew McMillan

Dec 30, 2021

There is a simple O(N) solution using sliding window.

1

0

Comments
Design Gurus
Design Gurus4 years ago

Can you share it? We are quite sure, it must be a different problem.

S
Syed Hassan4 years ago

there is'nt. good lucj

J
Design Gurus
Design Gurus3 years ago

Yes, finding the count can be done in O(n). Finding all the subarray will take O(n^2).