A utility function to reverse String str [ low . . high ]
function reverse ( low , high ) { while ( low < high ) { let t = str [ low ] ; str [ low ] = str [ high ] ; str [ high ] = t ; ++ low ; -- high ; } }