Palindrome Number – 9
🔗LC9 🟢 Easy 🧩 Pattern – math logic Given an integer x, return true if x is a PALINDROME, and false otherwise. Follow up: Could you solve it without converting the integer to a string? Example Solution
Algorithms, Data Structures, Competitive Coding, and problems from LeetCode with complete Solution Approach, Pseudocode, and Explanation.
🔗LC9 🟢 Easy 🧩 Pattern – math logic Given an integer x, return true if x is a PALINDROME, and false otherwise. Follow up: Could you solve it without converting the integer to a string? Example Solution
🔗LC3024 🟢 Easy 🧩 Pattern – Array, math logic You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle. Return a string representing the type of triangle that can be formed or “none” if it cannot form a triangle. Example Solution… Read More »Type of Triangle – 3024
🔗LC2648 🟢 Easy 🧩 Pattern – Generator Functions Write a generator function that returns a generator object which yields the Fibonacci sequence. The Fibonacci sequence is defined by the relation Xn = Xn-1 + Xn-2. The first few numbers of the series are 0, 1, 1, 2, 3, 5, 8, 13. Example Solution
Given an object, create a deep clone of it. This is a common interview question, and we are advised not to use any built-in methods to solve this problem. 🟡 Medium 🧩 Pattern – Objects Drawbacks of other methods structuredClone is the way ✅ The structuredClone() method of the Window… Read More »Deep Clone an Object in JavaScript
🔗LC1 🟢 Easy 🧩 Pattern – Hashtable and Array Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element… Read More »Two Sum – LC1 JS Solution
🔗LC150 🟡 Medium 🧩 Pattern – Stack You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation. Evaluate the expression. Return an integer that represents the value of the expression. Note that: Example Solution We use a stack to keep track of… Read More »Evaluate Reverse Polish Notation – 150