about | help | code help+videos | done | prefs |
Write a method that accepts an array containing at least one integer. Return the longest "run" of identical numbers in the array. To be a "run" the same number must appear repeatedly with no other numbers in between. The length of the "run" is how many matching numbers appeared in a row. Look at the test data for examples. jan11_2016_SLHLlongestSame([5, 23, 1, 3, 6, 5, 7, 5, 1]) → 1 jan11_2016_SLHLlongestSame([7, 7, 5, 2, 2, 2, 2, 6, 8, 8, 8]) → 4 jan11_2016_SLHLlongestSame([6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 4, 4, 8]) → 9 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy