/largest5

Returns the largest five digit number found within the number given.

Primary LanguageJavaScript

Copyright for implementation, Zachary Mitchell, 2017

This function accepts a number of any length and then outputs the largest 5 digit number from that input.

The problem was defined by jhoffner @ https://www.codewars.com/kata/51675d17e0c1bed195000001

- - - - - - - - - - - - - - - - - - 

In the following 6 digit number:

283910

91 is the greatest sequence of 2 digits.

In the following 10 digit number:

1234567890

67890 is the greatest sequence of 5 digits.

Complete the solution so that it returns the largest five digit number found within the number given. The number will be passed in as a string of only digits. It should return a five digit integer. The number passed may be as large as 1000 digits.

Adapted from ProjectEuler.net