3 ms·
I see, your description to GPT does not match the problem statement. > It just says to use the value from the first element, but it’s unclear if it’s before or
by pedrosorio 4y ago
I see, your description to GPT does not match the problem statement.
> 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
- jcims 4y agoI didn’t spend any time at all on it, I was curious to see if the results would be improved by describing the algorithm in prose rather than mathematical notation.