for one of the test;
tests.append({
‘input’: {
‘cards’: [13, 11, 10, 7, 4, 3, 1, 0],
‘query’: 1
},
‘output’: 6
})
why is the output 6 and not 2.
It doesn’t seem like correctly defined test case for this problem.
This question is from the PythonDSA course Lecture 1 correct? The test case output
gives the index of the query
element from the cards
list. Since the index of 1
in the cards
list is 6
the output is 6.
Hi @adefowokea, here’s the definition we are using for rotating a list.
We define “rotating a list” as removing the last element of the list and adding it before the first element. E.g. rotating the list
[3, 2, 4, 1]
produces[1, 3, 2, 4]
.
Hope it helps!