Skip to content

LeetCode

Create Hello World Function — 130 JavaScript

Create Hello World Function – 2667

🔗 LC2667 🟢 Easy 🧩 Pattern – Closures and Higher Order Functions 📅 Day 1/30 Days of JavaScript Write a function createHelloWorld. It should return a new function that always returns “Hello World”. Example Solution While this is a straightforward question, it’s important to understand key JavaScript concepts such as Higher Order Functions,… Read More »Create Hello World Function – 2667

Contains Duplicate LeetCode JS Solution

Contains Duplicate LeetCode – JS Solution

Contains Duplicate – LeetCode problem: We need to check if the given array contains duplicates and return True if duplicates are present and False otherwise. Link: Contains Duplicate LeetCode Difficulty: Easy Examples:Input: nums = [1,2,3,2]Output: true Example 2:Input: nums = [1,2,3,4]Output: false Solution in JavaScript Here we use an object… Read More »Contains Duplicate LeetCode – JS Solution

#30DaysofCode

#30DaysofCode

I had started the #30DaysofCode📚 challenge while I was revising the basic concepts, data structures, and solving easy problems on LeetCode. I documented this so that it helps both me and others to recall what we have learned. How to use this list📑 First, look at the given questions, if… Read More »#30DaysofCode

How to Reverse a Linked List

Reverse a Linked List

Yes, we are doing it today. The all-time famous interview question, Do you know how to reverse a Linked List? Well turns out, it isn’t that difficult and it’s all about logic and pointers, okay let’s get started. Alright, I already wrote a post explaining the basic operations and structure… Read More »Reverse a Linked List