strategies to puzzles

andych3n

Andy Chen

Posted on July 28, 2021

strategies to puzzles

Palindroms

  • recursion
  • stringmanipulation

string.replace(/[^A-Za-z0-9]/g, '') gets rid of spaces
string.split('').reverse().join('')

  • for loops for loops for (var i = 0; i < len / 2; i++) { if (characters[i] !== characters[len - 1 - i]) return false; }

Reversing strings = 1) reverse
2) decrementing for loop
3) recursion with substr and charAt

Binary Search.. linkedlist ... etc to come

💖 💪 🙅 🚩
andych3n
Andy Chen

Posted on July 28, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024