Longest Common Prefix
Lesson 3 of 15 in Coddy's Recursion Challenges - Master The Recursive Thinking course.
Challenge
EasyWrite a function named lcp that gets an array of strings and returns the longest common prefix.
For example,
["somehow", "somewhat", "something", "some"]->"some"["maximum", "minimum"]->"m"["llo", "lloon"]->"llo"
Try it yourself
char* lcp(char** a, int n) {
// Write code here
}All lessons in Recursion Challenges - Master The Recursive Thinking
1Easy Challenges
Fibonacci SequenceIs PalindromeLongest Common PrefixMerge Two Sorted ListsFactorialFirst Occurrence in String