ForNext
Only Do What Only You Can Do
119. relative complement, symmetric difference
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
PHP
$a1 = array(1,2,3); $a2 = array(2); array_values(array_diff($a1, $a2)) none
Python
{1,2,3} - {2} {1,2} ^ {2,3,4}
Ruby
require 'set' [1,2,3] - [2] Set[1,2] ^ Set[2,3,4]