Find the missing permutation: Difference between revisions

Content added Content deleted
m (→‎{{header|Sidef}}: modified code to work with Sidef 2.10)
Line 1,807: Line 1,807:
{{trans|Perl}}
{{trans|Perl}}
<lang ruby>func check_perm(arr) {
<lang ruby>func check_perm(arr) {
(var hash = Hash.new)[arr] = 1;
(var hash = Hash.new).@{arr} = @[1]*arr.len;
arr.each { |s|
arr.each { |s|
s.len.times {
s.len.times {
Line 1,813: Line 1,813:
hash.has_key(t) || return t;
hash.has_key(t) || return t;
}
}
};
}
}
}