5 Ways to Reverse a String | Daily Programmer | Episode 1

preview_player
Показать описание
In this video I talk about the programming problem reverse a string and solve it in several ways.

Комментарии
Автор

To avoid using temp you can use the array destructuring to reverse the values like so `[arr[left], arr[right]] = [arr[right], arr[left]]`. Great content BTW see you tomorrow.

NeniEmSu
Автор

The recursive solution and the array map/pop version even more are perfect examples how to turn javascript into perl. One liners with the arrow function short syntax and trickery become completely unreadable.

For years everyone and their debug buddy were complaining about the bad syntax of perl and regular expressions. Yet with every new version JS and PHP are getting more and more cryptic. I find this extremely funny, , ,

chrishuhn
Автор

I think for the resolution from 9th minute, instead of putting the letter at index 0 at the end of input, you've to put it at the index of your iterator starting from the end so first iterate the h at input.length-1 (-1-i with i=0), 2nd iterate e at input.length-2 (-1-i with i=1), 3rd iterate l at input.length-3 (-1-i with i=2)...

louptreize
Автор

🦎>>reverse 2020 >>2020 ==Deadly

nivasff
Автор

Some would argue that transforming the string to an array is a new variable, thus not making it "in-place". ^_^

TheLoGgIDK
Автор

why you stop making these js algorithms videos these are awesome please continue this series and new persons should learn everything from you

onlinetechnology
Автор

I'm still here, just so you know

themudreco
Автор

this is a one liner "idol".split('').reduce((a, b) => b+a)

webcoderph