使用谱卷积比较光谱

作者:L. Grondin

http://rosalind.info/problems/conv/

样本输入

186.07931 287.12699 548.20532 580.18077 681.22845 706.27446 782.27613 968.35544 968.35544
101.04768 158.06914 202.09536 318.09979 419.14747 463.17369

样本输出

3
85.03163

源代码:conv-grondilu.pl

use v6;

my $a = "186.07931 287.12699 548.20532 580.18077 681.22845 706.27446 782.27613 968.35544 968.35544";
my $b = "101.04768 158.06914 202.09536 318.09979 419.14747 463.17369";

my %conv; %conv{$_}++ for $a.split(/\s+/) X- $b.split(/\s+/);
.say for max(:by(*.value), %conv).kv.reverse;