Micron Technology Interview Question

Reverse a string in place

Interview Answer

Anonymous

Jul 2, 2015

my $str ='abcdefgh'; my @index=split//,$str; my $n=$#ind; for (0..$n){print $ind[$n--];} or print scalar reverse($str);