How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Two Optimisation Tasks in the Weekly Challenge 391

calendar_today September 14, 2026 person E. Choroba domain perl

Array Median We are given two sorted arrays, our task is to merge them and return the median. Let’s start with the naive approach: just let Perl sort the list and select the median. #!/usr/bin/perl use warnings; use strict; use experimental qw( signatures ); sub array_median_naive($arr1, $arr2) { my @m = sort { $a $b } @$arr1, @$arr2; return unless @m; return @m % 2 ?

open_in_new Read original post