Finding the Largest Word in a Ruby Array of Mixed Strings

0
558

This guide describes how to find the largest word in a Ruby array filled with mixed strings.

Summary

Implement a method that returns the longest string in an array of mixed strings.

Exercise File

Code File

Exercise Description

Build a method that returns the largest word in a Ruby array, even when it’s filled with variable length strings.

Sample Input

['A sentence', 'broken into several', 'array elements']

Expected Output

'sentence'

Real World Usage

This is an important skill to understand when it comes to working with data that isn’t formatted perfectly, which is common when working with machine learning algorithms.

Solution

Can be found on the solutions branch on github.

LEAVE A REPLY

Please enter your comment!
Please enter your name here