Hi Lets solve the Leet code problem "Longest Common Prefix"
Problem :
we were given an array of string we should return the Longest common prefix
Input: ["flower","flow","flight"]
Problem :
we were given an array of string we should return the Longest common prefix
Input: ["flower","flow","flight"]
Output: "fl
here the largest matching prefix is fl
Code:
Test Cases:
if you have any query or suggestion please feel free to post a comment


No comments:
Post a Comment