New
The Learning module is now live
See what's new
×
Question Bank
Learning
NEW
Pricing
Blog
Forum
HOT
JobRadar
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
Hack2hire 50 Picks
AI Insights
Quick Summary
Remove exactly k consecutive elements from an array to balance the sum of values at even and odd indices.
The resulting array must satisfy sum(even_indices) == sum(odd_indices).
Return the smallest starting index of the removed window, or -1 if impossible.
What This Tests
Efficiently evaluating sliding windows using prefix sums.
Handling index parity shifts when subarrays are removed.
Mathematical reasoning regarding cumulative sums and constraints.
Common Patterns
Prefix Sum
Sliding Window
Math
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
2.1k
/3.9k
Acceptance Rate
52.8%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.7-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
nums =
k =
Output
Expected