New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
AI Insights
Quick Summary
Find the minimum sequence of rotate or flip operations to sort an integer array.
Each step applies a fixed transformation, and operations can be chained in any order.
Return -1 if the sorted arrangement is unreachable through the allowed moves.
What This Tests
Modeling discrete state transformations as a graph
Shortest-path exploration on unweighted state spaces
Tracking visited configurations to prevent cycles and redundant work
Understanding how constraint bounds affect algorithmic feasibility
Common Patterns
DFS/BFS
Graph Traversal
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
29
/64
Acceptance Rate
45.3%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
arr =
Output
Expected