sravanapisupati / SampleDataSet

5 stars 14 forks source link

Need to return common prefix in a list _ in scala #2

Open Unayak900 opened 2 years ago

Unayak900 commented 2 years ago

I have two string from here i need to find the common prefix as shown below Input: strs = ["flower","flow","flight"] Output: "fl"

  1. Here there is no common prefix which returns empty Input: strs = ["dog","racecar","car"] Output: ""