Write Recursive Haskell Function Cannot Use Existing Functions Following Write Function Lo Q37117280

Write arecursive Haskell function (you cannot use existing functions) todo the following:

Write a functionlongestString that takes a string list and returns the longeststring in the list. If the list is empty, return “” (i.e., an emptystring). In the case of a tie, return the string closest to thebeginning of the list. For example:

longestString [“abc”, “Hello”, “car”, “apple”] -> “hello”

longestString [] ->””


Solution


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.