Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
Remove Consecutive for Balance
Medium
You are given a list of track lengths tracks and a positive integer k. Remove exactly k consecutive tracks from the list so that the sum of track lengths at even indices equals the sum at odd indices in the resulting list. Return the smallest valid starting index of the removed segment, or -1 if no such removal exists.
Indices are 0-based. The "even index sum" and "odd index sum" are computed on the resulting array after removal. ...
Asked at:TikTok
More TikTok interview questions
- [CodeSignal] Synchronized Pipeline Delayshard
- Path Prefix Routermedium
- Character String Addereasy
- Tiered Order Pricinghard
- HTML Tag Renderereasy
- Bounded Repeat Substringmedium
- Spread Avoidance Escapehard
- Region Grid Coloringmedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.