diff --git a/python-pass.py b/python-pass.py index dbf8e87..150969f 100644 --- a/python-pass.py +++ b/python-pass.py @@ -1,7 +1,29 @@ +def find(s): + + string_word = "" + max_repeat = s[0]; + -class Solution: + length= len(s) - @staticmethod - def longest_palindromic(s: str) -> str: - pass + for i in s: + num = s.count(i) + + if s.count(max_repeat) < num: + max_repeat = i + + + for i in range(length): + if(s[i] == max_repeat): + for j in range(i,length): + + if(string_word.count(max_repeat) < s.count(max_repeat)): + + string_word += s[j] + print(string_word.count(max_repeat)) + + print("the longest Palindromic = ",string_word) + +x = input("enter the string: ") +find(x)