Skip to content

LeetCode

Single Number - 136

Single Number – 136

🔗LC136 🟢 Easy 🧩 Pattern – XOR, Hashmap Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant extra space. Example Solution Bitwise XOR operator ^ is the only way to solve… Read More »Single Number – 136

30 Days of JavaScript Challenge

30 Days of JavaScript Challenge

30 Days of JavaScript Challenge – solving one problem a day and writing a blog post on the solution approach, this was more of a JS basics revision with hands-on than a typical problem-solving. 30 Days of JavaScript Solutions ✨ Good Luck

Calculator with Method Chaining - 2726

Calculator with Method Chaining – 2726

🔗LC2726 🟢 Easy 🧩 Pattern – Classes 📅 Day 30/30 Days of JavaScript Design a Calculator class. The class should provide the mathematical operations of addition, subtraction, multiplication, division, and exponentiation. It should also allow consecutive operations to be performed using method chaining. The Calculator class constructor should accept a number which serves as… Read More »Calculator with Method Chaining – 2726

Array Wrapper - 2695

Array Wrapper – 2695

🔗LC2695 🟢 Easy 🧩 Pattern – Classes and Arrays 📅 Day 29/30 Days of JavaScript Create a class ArrayWrapper that accepts an array of integers in its constructor. This class should have two features: Example Solution

Event Emitter - 2694

Event Emitter – 2694

🔗LC2694 🟡 Medium 🧩 Pattern – Classes and Arrays 📅 Day 28/30 Days of JavaScript Design an EventEmitter class. This interface is similar (but with some differences) to the one found in Node.js or the Event Target interface of the DOM. The EventEmitter should allow for subscribing to events and emitting… Read More »Event Emitter – 2694