November 2022 Archives

Array Degree

The Weekly Challenge 189/2

The Task 2 was rather interesting in the week 189.

You are given an array of 2 or more non-negative integers.

Write a script to find out the smallest slice, i.e. contiguous subarray of the original array, having the degree of the given array.

The degree of an array is the maximum frequency of an element in the array.

About E. Choroba

user-pic I blog about Perl.