From 6c74899eae58332aac26a3079752e396209fde69 Mon Sep 17 00:00:00 2001 From: shxlxn-05 <86524327+shxlxn-05@users.noreply.github.com> Date: Thu, 28 Oct 2021 18:13:16 +0530 Subject: [PATCH] Add files via upload --- removeduplicatestring.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 removeduplicatestring.py diff --git a/removeduplicatestring.py b/removeduplicatestring.py new file mode 100644 index 0000000..49d9f75 --- /dev/null +++ b/removeduplicatestring.py @@ -0,0 +1,18 @@ +def removeDuplicate(str, n): + i = 0 + + for j in range(0, n): + for k in range(0, j + 1): + if (str[j] == str[k]): + break + + if (k == j): + str[i] = str[j] + i += 1 + + string = "".join(str[:i]) + return string + +str= str(input("Enter String Value:")) +n = len(str) +print(removeDuplicate(list(str), n)) \ No newline at end of file