Zulip Chat Archive
Stream: Is there code for X?
Topic: Swap List Element
Marcus Rossel (Jan 12 2021 at 13:06):
Is there code for swapping a list element à la:
[10, 20, 10, 30].swap 2 40 = [10, 20, 40, 30]
Mario Carneiro (Jan 12 2021 at 13:07):
that looks like update_nth
Mario Carneiro (Jan 12 2021 at 13:07):
what we call "swap" is exchanging the positions of two data elements
Last updated: Dec 20 2023 at 11:08 UTC