Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Determine if the set of values {1, ..., k} appears contiguously anywhere in the given permutation.
Return a binary string where the k-th character is '1' if k is balanced and '0' otherwise.
Solve the problem in linear time relative to the permutation length.
What This Tests
Position mapping and constant-time lookups
Span and interval properties of value sets
Iterative state maintenance without brute force
Mathematical conditions for array contiguity
Common Patterns
Hashing
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected