Skip to content

Instantly share code, notes, and snippets.

@rvbsanjose
Created April 16, 2014 05:57
Show Gist options
  • Save rvbsanjose/10813687 to your computer and use it in GitHub Desktop.
Save rvbsanjose/10813687 to your computer and use it in GitHub Desktop.
// Using the JavaScript language, have the function ThirdGreatest(strArr) take the array of strings stored in strArr and return // the third largest word within in. So for example: if strArr is ["hello", "world", "before", "all"] your output should be
// world because "before" is 6 letters long, and "hello" and "world" are both 5, but the output should be world because it
// appeared as the last 5 letter word in the array. If strArr was ["hello", "world", "after", "all"] the output should be after // because the first three words are all 5 letters long, so return the last one. The array will have at least three strings and // each string will only contain letters.
// Input = "coder","byte","code" Output = "code"
// Input = "abc","defg","z","hijk" Output = "abc"
@Ravikirandhekle
Copy link

Y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment