Posts

Showing 10 of 42 Posts |Page4

485. Max Consecutive Ones | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/max-consecutive-ones/] introduced in the Arrays 101 track of LeetCode. I first solved this and got it wrong by over-complicating it. Deleted the whole code and tried a simpler approach. SIMPLE ITERATIVE APPROACH If we encounter a 1, increment count...

383. Ransom Note | LeetCode Solution | JavaScript | Easy

LeetCodeEasy
> LeetCode Problem - Link [https://leetcode.com/problems/ransom-note/] I will be solving the Ransom Note problem from LeetCode today, this requires you to utilize a hashmap to solve this. I took a while to solve this perfectly, I spent almost 20 minutes trying to create 2 hashes (god knows for what) and compare them....

876. Middle of the Linked List | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/middle-of-the-linked-list/description/] A supposedly stepped-up difficult problem in easy mode on the Explore Course [https://leetcode.com/explore/learn/card/the-leetcode-beginners-guide/692/challenge-problems/4426/] I was doing....

412. Fizz Buzz | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/fizz-buzz/] Coming back to solving FizzBuzz after almost a decade brings back a lot of memories. I remember the FizzBuzz program was known to be very easy. It also teaches us the importance of ordering logical statements, there was a time when candidates get this wrong in...

1672. Richest Customer Wealth | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/richest-customer-wealth/description/] Today, I solved the Richest Customer Wealth on LeetCode. A pretty straightforward approach for solving this, we're given a 2-dimensional array, we need to loop over them, and maintain one variable for ma...

1480. Running Sum of 1d Array | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/running-sum-of-1d-array/] A pretty straightforward approach for solving this, we add the adjacent numbers in an array and return the final resultant array SEQUENTIAL APPROACH /** * @param {number[]} nums * @...

2. Add Two Numbers | LeetCode Solution | JavaScript | Medium

LeetCodeArraysMedium
> LeetCode Problem - Link [https://leetcode.com/problems/add-two-numbers/] Today I attempted to solve the Add Two Numbers Problem on LeetCode, don't be fooled by the title. It's not as simple as adding two numbers. The devil is in the details. JK! It's not that difficult to be honest, although I did take a...

1. Two Sum | LeetCode Solution | JavaScript | Easy

LeetCodeArraysEasy
> LeetCode Problem - Link [https://leetcode.com/problems/two-sum/] I had just added support for category tags on my blog, LeetCode makes a debut! It's customary to begin my LeetCode journey by solving the first problem. Two Sum Problem Your job is to find two numbers that add up to a third number in...

Implementing Dark Mode and Solving Dark Mode Flickering/Blinking Issues on Server Side Rendered [SSR] Applications

Web DevelopmentReact
Implementing Dark Mode in applications can be challenging, especially for large or legacy applications. It requires incrementally updating different parts of your app before rolling out the complete dark mode feature to your users. However, there are libraries available, such as Radix UI, that can simplify the process of implementing Dark Mode for your application. or legacy. You need to incrementally update parts...