From 036c92055613ce61982a7daa1d10965fd3fc9967 Mon Sep 17 00:00:00 2001 From: Arun Iyer Date: Wed, 5 Dec 2018 23:53:05 +0530 Subject: [PATCH] Create kth character --- Arrays & Strings/kth character | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Arrays & Strings/kth character diff --git a/Arrays & Strings/kth character b/Arrays & Strings/kth character new file mode 100644 index 0000000..33e3c2e --- /dev/null +++ b/Arrays & Strings/kth character @@ -0,0 +1,15 @@ +a = input() +size = 256 +def getrep(str): + count = [0] * size + max = -1 + b = '' + for i in str: + count[ord(i)]+=1; + for i in str: + if max < count[ord(i)]: + max = count[ord(i)] + b = i + return b +new = a.replace(getrep(a),"") +print(new)