Skip to main content
All Questions

Find an index where an array of True values turns to False.

Unlock detailed company stats for this questionUpgrade

You are given an array that is a mixture of True and False values. It always starts with True and always ends with False. Find any index i such that arr[i] == True and arr[i+1] == False.

Goal: an optimized O(log n) solution using binary search.

Community answers

No answers contributed by the community yet.

Related courses

Course

Solutions Architect Interview Prep

Land your dream solutions architect job at Amazon, Google, Meta, Microsoft, Salesforce, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Practice system design principles and leadership skills to ace your interviews.

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.