Skip to content

Commit

Permalink
Create SolutionByDhaval.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dhavalpandey authored Oct 30, 2023
1 parent b7cbc6c commit 335258a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Divide and Conquer/Longest Common Prefix/SolutionByDhaval.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os

list_input = input()[1:]
list_input = list_input[:-1]

list_input = list_input.replace("”", "")
list_input = list_input.replace("“", "")
list_input = list_input.replace('"', '')
list_input = list_input.replace(" ", "")

list = list(map(str, list_input.split(",")))

print(os.path.commonprefix(list))

0 comments on commit 335258a

Please sign in to comment.