Help for this page
push @soln, $val if ( $soln[-1] ne $val );
push @soln # and then .. $val if ( $soln[-1] ne $val );