Coding contest, problem 4 of 5
Your submission is recorded and graded after the round closes.
0 of 5 submitted
Symmetric heart rates
A training app checks whether a workout was perfectly mirrored: the heart-rate samples during the cool-down should retrace the warm-up exactly, so the whole session reads the same forwards and backwards. Given the list rates, return True if it is symmetric (a palindrome of values) and False otherwise. Compare from both ends inward instead of building a reversed copy. Example: [90, 110, 130, 110, 90] is symmetric.
Implement
is_mirrored_session(rates: list[int]) → boolExamples
in
[[90,110,130,110,90]]outtrueWhat a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 10 min
solution.py
InputExpectedGot
[[90,110,130,110,90]]truenot run yetsample