प्रश्न
00:00

10. Longest Common Prefix

आसानस्ट्रिंगGoogleMicrosoft

Write a function that finds the longest common prefix among an array of strings.

उदाहरण 1:

इनपुट: strs = ["flower","flow","flight"]
आउटपुट: fl

उदाहरण 2:

इनपुट: strs = ["dog","racecar","car"]
आउटपुट: 

सीमाएँ:

  • 1 <= strs.length <= 200
मुख्य कोड मोड
● अपने आप सहेजा गयापंक्ति 1, कॉलम 1