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

0% completed

Vote For New Content
3 pointers?

krishnakeshav.pes

Jun 11, 2023

solution seems to be using 3 pointers but does it one pass(which is optimal) ie. O(n)

Another, O(n) would be to use 2 pointers but do 2 passes - place 0s in 1st pass and 1s in 2nd pass.

2

0

Comments
Comments

On this page

Problem Statement

Examples

Example 2

Try it yourself