about | help | code help+videos | done | prefs |
longest
Write a function longest(data) that returns the longest string in the list of strings named data. For example, longest([’Tris’, ’Tobias’, ’Caleb’]) should return ’Tobias’. If there is a tie it should return the first word of that length. longest(['some', 'lengthy', 'words', 'and', 'some', 'short']) → 'lengthy' longest(['a', 'b', 'c', '', 'd', 'e']) → 'a' longest(['ab', 'abb', 'a', 'babbbbb', 'abab', 'a']) → 'babbbbb' ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy