Javascript DSA — 02 : Palindrome

Yuvaraj S
Nov 22, 2023

--

In our previous blog we understood,
Javascript DSA — 01 : String Reversal

Today we will se second DSA Problem,

“Given a string, check if we reversed will the string is same as original string”

On to the solution!!!

Solution 01: our array solution,

In this example, we are converting string into Array. We just reversed the array and again converted into string using join(‘’) and stored in new variable.

Solution 02: Complex Approach

So now in our second solution, we are taking character and checking whether the character is same from last.

NEXT lesson : Javascript DSA — 03 : Integer reversal

--

--

Yuvaraj S

Passionate Angular Developer. I post programming content regarding, Frontend Development with working example. ie, Angular, Html, CSS, Javascript