|
|
|
|
|
by jcims
1295 days ago
|
|
Yes according to the puzzle, but the operation as described isn’t clear (to me anyway) about which value should be used for the final assignment. It just says to use the value from the first element, but it’s unclear if it’s before or after that first element is replaced by the first operation. |
|
> It just says to use the value from the first element, but it’s unclear if it’s before or after that first element is replaced by the first operation.
Is the following python code unclear to you?
a = 0 b = 1 a, b = b, a
or alternatively:
a = [1,2,3,4,5] a[0:3] = a[1:3] + [a[0]]
There's nothing in the statement that indicates the assignments should be done one element at a time (if so, the order of the assignments would need to be specified). It's an atomic operation that circularly shifts the values in the array in the range l...r