- or download this
#! perl -slw
use strict;
...
print nUniqC '1010101010';
print nUniqC '1234567812';
- or download this
sub nUniqC{
my @uniq;
scalar grep{ ++$uniq[$_] == 1 } unpack('C*',$_[0]);
}
- or download this
sub nUniqC{
scalar grep{ ++$_[$_] == 1 } unpack('C*',$_[0]);
}