Ridge Trail Kth Segment Total — Coding Problem — CareerVerse