Remove Duplicate Script Added (#1570)

* Added Remove duplicate script and updated requirements.txt

* Requirements.txt Updated

* Remove Duplicate Script Added

* Directory Modified

* Directory.md Updated
This commit is contained in:
Sarath Kaul
2019-11-15 01:31:51 +05:30
committed by Christian Clauss
parent e3aa0f65e8
commit e3f55aecce
2 changed files with 145 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# Created by sarathkaul on 14/11/19
def remove_duplicates(sentence: str) -> str:
"""
Reomove duplicates from sentence
>>> remove_duplicates("Python is great and Java is also great")
'Java Python also and great is'
"""
sen_list = sentence.split(" ")
check = set()
for a_word in sen_list:
check.add(a_word)
return " ".join(sorted(check))
if __name__ == "__main__":
print(remove_duplicates("INPUT_SENTENCE"))