151. Reverse Words in a String | JavaScript | LeetCode | Daily Challenge | Easy Explanation

preview_player
Показать описание


I have explained the thought process to find the optimized solution to LeetCode daily challenge 151. Reverse Words in a String.

#leetcode #javascript #coding #datastructures #leetcodedailychallenge
Рекомендации по теме
Комментарии
Автор

Your solution was easy and understandable. I Appreciate that. Thanks

varunrawat
Автор

with regex you can create a capturing group using the space and then apply reverse/join. Runtime is very low - ')

Celtic
Автор

Hello, I am a final year college student and an absolute beginner in coding, and currently I am learning JavaScript. So I have a question that can I do DSA using Javascript?? And is it possible to do competitive programming using Javascript?? Can I give interview in JS??

And please also guide me on how I can learn JS and become good at it. Please reply 🙏🙏🥺🥺

bishalkumarshaw
Автор

const str = "good morning john"
let arr = str.split(" ")
arr.reverse()
console.log(arr.join(" "))

developwithhaider