about | help | code help+videos | done | prefs |
Think about the leftmost and rightmost appearances of each unique value in the array. If the span is the inclusive number of elements between the leftmost and rightmost appearances of that value, find the span between the two of every unique value and return the minimum span that is greater than 1 (if the maximum span is also 1, return 1). A single value has a span of 1. LASA_minSpan_KS([1, 2, 1, 1, 3]) → 4 LASA_minSpan_KS([1, 4, 2, 1, 4, 1, 4]) → 6 LASA_minSpan_KS([1, 4, 2, 1, 4, 1]) → 4 ...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