1:  Add constant-time solution in Perl