I uploaded this question twice already and no one had the expertise to answer the question correctly. Please assign an Analysis of Algorithms Expert. You're allowed to use any language (state it) providing the solution pass all test cases (they are anonymous).

![I #1/bin/python$ 3 import os 4 import sys 5 7 8 ▼if · -name------main-- nkinput().split) n int (nk[0]) k int (nk[1]) for n_](http://img.homeworklib.com/images/7ef1b588-0bf4-4164-b72d-d6f264668af0.png?x-oss-process=image/resize,w_560)
![1 #!/bin/Python3 3 import os 4 import sys nk-input().split() n-int(nk[]) k-int(nk[1]) codewords [] #taking input no.of words](http://img.homeworklib.com/images/02d588f3-cb4f-43de-84a0-0545add8b57e.png?x-oss-process=image/resize,w_560)
#!/bin/python3
import os
import sys
if __name__=='__main__':
nk=input().split() #taking input no.of words n and k ,
separated by space (as string)
n=int(nk[0]) #taking n
k=int(nk[1]) #taking k
codewords=[] #list to store the words
words=[]
a=[]
for n_itr in range(n): #iterating n times to take n
words
codeword=input() #taking word
codewords.append(codeword) #storing
into a list
words.append(codeword) #storing
words in words list
l=0 #starting index
decoded_words=[] #list to store the decoded
words
for i in range(k,n,k): #iterates through list based on
interval (ex:-0,2 2,4 4,6...) based on k
a=a+words[l:i] #storing words in
list a in intervals
a.sort() #sorting list
code_word=codewords[i-1] #code
word=word at k position
for j in a: #iterating through
every word
if j not in
decoded_words and (a.count(j)==1) and (code_word<j): #if word in
list is unique and not repeated(count shows the no.of
occurences)
code_word=j
break #if code_word found break
decoded_words.append(code_word)
#adding the words into a list
l=i #changing initial index to
slice the list
print("\nOutput:")
for i in decoded_words:
print(i) #printing the words
Output:

Try This!
I uploaded this question twice already and no one had the expertise to answer the question correc...