Problem

Return max of (lastIndexOf val - firstIndexOf val) over values present.

Examples

  • maxSpanSimple([1, 2, 1]) -> 2
Compile and test (Ctrl+Enter)