Skip to content

Commit

Permalink
py imp
Browse files Browse the repository at this point in the history
  • Loading branch information
Azureki committed Apr 18, 2020
1 parent 0f9b777 commit 9e48192
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 1409. Queries on a Permutation With Key/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Solution:
def processQueries(self, queries: List[int], m: int) -> List[int]:
P = [i for i in range(1, m+1)]
res = []
for i in queries:
res.append(P.index(i))
P.remove(i)
P.insert(0, i)
return res

0 comments on commit 9e48192

Please sign in to comment.