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

0% completed

Vote For New Content
why are we checking for direction again when calculating nextIndex?

Aniket Joshi

Jul 16, 2023

as the title suggest, when I am at index i, i already have the information if the num at i is < 0 or > 0. why do we need to check again when we calculate the next index?

0

0

Comments
Comments

On this page