Neural Sync Active
Synthetic 1 · Ends Share a Remainder
Registry Synced
Synthetic 1 · Ends Share a Remainder
69 words
1 min read
2026-08-02
Ends Share a Remainder
Write
ends_share_remainder(nums, k). Return whether the first and last numbers leave the same remainder when divided by positive integer k. Assume nums is non-empty.Template Code
pythondef ends_share_remainder(nums, k): pass
Public Tests
is_equal(ends_share_remainder([14, 8, 22], 4), True)
is_equal(ends_share_remainder([5, 9, 12], 5), False)
is_equal(ends_share_remainder([7], 3), True)
MCQ
3 Unit Assessment
Reference-only archive item
The completed export preserved the prompt as an image but not a reusable answer key. The reconstruction below is for study, not scoring.
Study reconstruction
def ends_share_remainder(nums, k):
return nums[0] % k == nums[-1] % k