27. Merge the Tools: Hackerrank | Python Solution Explained

preview_player
Показать описание
In this tutorial, I am showing you how to easily and efficiently tackle this hackerrank challenge. The video will also teach you the fundamentals and necessary operations to achieve that.

#hackerrank #hackerranksolutions #pyhtonhackerrank #capitalize
Рекомендации по теме
Комментарии
Автор

But set doesn't maintain any order. how is maintaining in your case? in my case its not.
Even in your notebook it AB, AC & AD but it should be AB, CA&AD in first test case.

gauv
Автор

it shows error in the arranging sequence how to fix it

itsmealbi
Автор

I copied your code and yet my output is BA CA AD. In sub variable, I did this code instead, sub = sorted(set(temp), key=temp.index)

Cloudxxx
Автор

parts = list()
while len(string)>=k:
new_string = string[:k]
string = string[k:]
parts.append(new_string)


for part in parts:
unique_part = ''
for char in part:
if char not in unique_part:
unique_part += char
print(unique_part)


I did it from my own way and it worked in all cases. But I didn't got in my first try I converted them into set() but in all test gone wrong cuz sets put items randomly. why in your case it didn't happen? list(set(list(temp))) why these are not random?

fobos
welcome to shbcf.ru