Algorithm Blog

Dive deep into computer science concepts with interactive visualizations, step-by-step explanations, and hands-on examples.

56 Articles
Interactive Visualizations
Step-by-Step Guides
webDevdesignEngineering
1 min read

Best Design Engineer Courses on the Internet

A comprehensive guide to the best design engineering courses available online, covering various aspects of design and engineering principles.

P

Pranay Kothapalli

Apr 10, 2025

Read More
webDevtest
1 min read

test-post

A test post for development and testing purposes.

P

Pranay Kothapalli

Apr 07, 2025

Read More
1 min read

Reverting Multiple file changes to last checkpoint of branch with Git

Learn how to efficiently revert multiple files to their last checkpoint in a Git branch using various techniques and automation.

P

Pranay Kothapalli

Jan 22, 2025

Read More
webDevtechBlogs
1 min read

Best Tech Blogs of Programmers | My top list of blogs I follow for inspiration

A curated list of the best tech blogs and programming resources that provide inspiration and valuable insights for developers.

P

Pranay Kothapalli

Oct 26, 2024

Read More
webDevmarketing
1 min read

Marketing Developer Tools 101 - Let's Talk about Rad UI

Marketing strategies for developer tools and open source projects, focusing on visual appeal, documentation, and community engagement.

P

Pranay Kothapalli

Oct 26, 2024

Read More
gameDevdevLog
2 min read

1. Kamikaze Kittens Devlog #1 | Better Muzzle Flashes

I've been working on a game called Kamikaze Kittens for a while now. It's a top-down shooter where you control a cat that can shoot bullets at enemies. I've been trying to improve the game feel and visual feedback.

P

Pranay Kothapalli

Oct 21, 2024

Read More
gameDevdevLog
2 min read

2. Kamikaze Kittens Devlog #2 | Better Gameplay Data Configs

In this devlog, I'll be talking about how I improved the data configuration system for Kamikaze Kittens. The game has various gameplay parameters that need to be easily adjustable for balancing and testing.

P

Pranay Kothapalli

Oct 21, 2024

Read More
leetCodeleetCode_arrays
1 min read

1920. Build Array from Permutation | LeetCode Solution | JavaScript | Easy

Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it.

P

Pranay Kothapalli

Oct 21, 2024

Read More
leetCodeleetCode_arrays
1 min read

1929. Concatenation of Array | LeetCode Solution | JavaScript | Easy

Given an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n (0-indexed).

P

Pranay Kothapalli

Oct 21, 2024

Read More
leetCodeleetCode_arrays
1 min read

2011. Final Value of Variable After Performing Operations | LeetCode Solution | JavaScript | Easy

There is a programming language with only four operations and one variable X: ++X and X++ increments the value of the variable X by 1. --X and X-- decrements the value of the variable X by 1.

P

Pranay Kothapalli

Oct 21, 2024

Read More
leetCodeleetCode_arrays
1 min read

3190. Find Minimum Operations to Make All Elements Divisible by Three | LeetCode Solution | JavaScript | Easy

You are given an integer array nums. In one operation, you can add or subtract 1 from any element of nums. Return the minimum number of operations to make all elements of nums divisible by 3.

P

Pranay Kothapalli

Oct 21, 2024

Read More
gameDevgodot
1 min read

Godot - Hitstop Implementation | GD Script | Autoload/Singleton Pattern

Here's my basic code for a Hitstop implementation, I usually put it up as a singleton/autoload node in my project so it can be called from anywhere globally.

P

Pranay Kothapalli

Aug 23, 2024

Read More
gameDevdevLog
1 min read

Kamikaze Kittens Documentation and Dev-logs

This is an index page for the devlogs/documentation for a game called Kamikaze Kittens that I'm currently building. I use this page to refer to notes and documentation about the game.

P

Pranay Kothapalli

Aug 23, 2024

Read More
leetCodeleetCode_arrays
2 min read

3146. Permutation Difference between Two Strings | LeetCode Solution | JavaScript | Easy

You are given two strings s and t such that every character occurs at most once in s and t is a permutation of s. The permutation difference between s and t is defined as the sum of the absolute difference between the index of the occurrence of each character.

P

Pranay Kothapalli

Aug 02, 2024

Read More
leetCodeleetCode_arrays
2 min read

3162. Find the Number of Good Pairs I | LeetCode Solution | JavaScript | Easy

You are given 2 integer arrays nums1 and nums2 of lengths n and m respectively. You are also given a positive integer k. A pair (i, j) is called good if nums1[i] is divisible by nums2[j] * k.

P

Pranay Kothapalli

Aug 01, 2024

Read More
leetCodeleetCode_arrays
2 min read

3168. Minimum Number of Chairs in a Waiting Room | LeetCode Solution | JavaScript | Easy

You are given a string s. Simulate events at each second i: If s[i] == 'E', a person enters the waiting room and takes one of the chairs in it. If s[i] == 'L', a person leaves the waiting room, freeing up a chair.

P

Pranay Kothapalli

Aug 01, 2024

Read More
leetCodeleetCode_arrays
2 min read

2810. Faulty Keyboard | LeetCode Solution | JavaScript | Easy

Your laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you have written. Typing other characters works as expected.

P

Pranay Kothapalli

Jul 29, 2024

Read More
leetCodeleetCode_arrays
2 min read

3200. Maximum Height of a Triangle | LeetCode Solution | JavaScript | Easy

You are given two integers red and blue representing the count of red and blue colored balls. You have to arrange these balls to form a triangle such that the 1st row will have 1 ball, the 2nd row will have 2 balls, and so on.

P

Pranay Kothapalli

Jul 29, 2024

Read More
leetCodeleetCode_arrays
1 min read

3232. Find if Digit Game Can Be Won | LeetCode Solution | JavaScript | Easy

You are given an array of positive integers nums. Alice and Bob are playing a game. In the game, Alice can choose either all single-digit numbers or all double-digit numbers from nums.

P

Pranay Kothapalli

Jul 29, 2024

Read More
leetCodeleetCode_arrays
1 min read

58. Length of Last Word | LeetCode Solution | JavaScript | Easy

Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only.

P

Pranay Kothapalli

Jul 28, 2024

Read More
leetCodeleetCode_arrays
2 min read

414. Third Maximum Number | LeetCode Solution | JavaScript | Easy

Given an integer array nums, return the third distinct maximum number in this array. If the third maximum does not exist, return the maximum number.

P

Pranay Kothapalli

Jul 26, 2024

Read More
leetCodeleetCode_arrays
1 min read

448. Find All Numbers Disappeared in an Array | LeetCode Solution | JavaScript | Easy

Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.

P

Pranay Kothapalli

Jul 26, 2024

Read More
leetCodeleetCode_arrays
2 min read

66. Plus One | LeetCode Solution | JavaScript | Easy

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order.

P

Pranay Kothapalli

Jul 26, 2024

Read More
leetCodeleetCode_arrays
1 min read

1051. Height Checker | LeetCode Solution | JavaScript | Easy

A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height.

P

Pranay Kothapalli

Jul 23, 2024

Read More
leetCodeleetCode_arrays
2 min read

283. Move Zeroes | LeetCode Solution | JavaScript | Easy

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. You must do this in-place without making a copy of the array.

P

Pranay Kothapalli

Jul 23, 2024

Read More
leetCodeleetCode_arrays
1 min read

905. Sort Array By Parity | LeetCode Solution | JavaScript | Easy

Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers. Return any array that satisfies this condition.

P

Pranay Kothapalli

Jul 23, 2024

Read More
leetCodeleetCode_arrays
1 min read

1299. Replace Elements with Greatest Element on Right Side | LeetCode Solution | JavaScript | Easy

Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1. After doing so, return the array.

P

Pranay Kothapalli

Jul 16, 2024

Read More
LeetCodeleetcode
1 min read

1346. Check If N and Its Double Exist | LeetCode Solution | JavaScript | Easy

Given an array arr of integers, check if there exist two indices i and j such that i != j, 0 <= i, j < arr.length, and arr[i] == 2 * arr[j].

P

Pranay Kothapalli

Jul 15, 2024

Read More
LeetCodeleetcode
2 min read

941. Valid Mountain Array | LeetCode Solution | JavaScript | Easy

Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain array if and only if it has a peak.

P

Pranay Kothapalli

Jul 15, 2024

Read More
LeetCodeleetcode
1 min read

26. Remove Duplicates from Sorted Array | LeetCode Solution | JavaScript | Easy

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.

P

Pranay Kothapalli

Jul 14, 2024

Read More
LeetCodeleetcode
2 min read

27. Remove Element | LeetCode Solution | JavaScript | Easy

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val.

P

Pranay Kothapalli

Jul 14, 2024

Read More
LeetCodeleetcode
2 min read

88. Merge Sorted Array | LeetCode Solution | JavaScript | Easy

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.

P

Pranay Kothapalli

Jul 13, 2024

Read More
LeetCodeleetcode
1 min read

1089. Duplicate Zeros | LeetCode Solution | JavaScript | Easy

Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.

P

Pranay Kothapalli

Jul 12, 2024

Read More
LeetCodeleetcode
1 min read

1295. Find Numbers with Even Number of Digits | LeetCode Solution | JavaScript | Easy

Another problem - Find Numbers with Even Number of Digits from LeetCode's 101 Array course. This was a pretty easy one to solve, You simply loop through all the numbers.

P

Pranay Kothapalli

Jul 12, 2024

Read More
LeetCodeleetcode
2 min read

383. Ransom Note | LeetCode Solution | JavaScript | Easy

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.

P

Pranay Kothapalli

Jul 12, 2024

Read More
LeetCodeleetcode
1 min read

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

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.

P

Pranay Kothapalli

Jul 12, 2024

Read More
LeetCodeleetcode
2 min read

977. Squares of a Sorted Array | LeetCode Solution | JavaScript | Easy

Solving Squares of a Sorted Array was pretty easy, I encountered this in the Arrays 101 course of LeetCode's Explore cards. It was straightforward, first I looped through an array by multiplying every number with itself.

P

Pranay Kothapalli

Jul 12, 2024

Read More
Software Engineeringsoftware-engineering
3 min read

What is Dogfooding in Software Development (and Why It Matters)

Dogfooding (short for "eating your own dog food") is a term that's thrown around a lot in tech. It simply means using your own product or service internally—just like your customers would.

P

Pranay Kothapalli

Jul 12, 2024

Read More
LeetCodeleetcode
1 min read

1342. Number of Steps to Reduce a Number to Zero | LeetCode Solution | JavaScript | Easy

An attempt at solving LeetCode's Number of Steps to Reduce a Number to Zero. It shouldn't take you more than a few minutes for you to get it right. Pretty easy.

P

Pranay Kothapalli

Jul 11, 2024

Read More
LeetCodeleetcode
1 min read

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

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 max_wealth.

P

Pranay Kothapalli

Jul 11, 2024

Read More
LeetCodeleetcode
1 min read

412. Fizz Buzz | LeetCode Solution | JavaScript | Easy

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.

P

Pranay Kothapalli

Jul 11, 2024

Read More
LeetCodeleetcode
2 min read

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

A supposedly stepped-up difficult problem in easy mode on the Explore Course I was doing. It isn't tough if you know how to traverse a Linked List.

P

Pranay Kothapalli

Jul 11, 2024

Read More
LeetCodeleetcode
1 min read

1. Two Sum | LeetCode Solution | JavaScript | Easy

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.

P

Pranay Kothapalli

Jul 10, 2024

Read More
LeetCodeleetcode
1 min read

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

A pretty straightforward approach for solving this, we add the adjacent numbers in an array and return the final resultant array.

P

Pranay Kothapalli

Jul 10, 2024

Read More
3 min read

The Const-ant Struggle: A Developer's Decade-Long Dance with Declarations

Hey fellow devs and code enthusiasts! Today, I'm taking you on a nostalgic journey through the wild world of JavaScript declarations. Hold on to your keyboards, because we're diving deep into the const-versus-let-versus-var debate that's been raging since the dawn of ES6.

P

Pranay Kothapalli

Jul 10, 2024

Read More
4 min read

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

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.

P

Pranay Kothapalli

Jul 10, 2024

Read More
JavaScriptjavascript
4 min read

Modern JavaScript Features You Should Know in 2024

Explore the latest JavaScript features that are transforming how we write code. From optional chaining to private class fields, learn what's new and how to use it effectively.

P

Pranay Kothapalli

Jan 30, 2024

Read More
Reactreact
7 min read

React Performance Optimization: A Complete Guide

Learn advanced React performance optimization techniques including memoization, code splitting, and bundle optimization. Make your React apps lightning fast!

P

Pranay Kothapalli

Jan 28, 2024

Read More
Algorithmsalgorithms
7 min read

Binary Search Algorithm: A Deep Dive with Interactive Visualization

Master the binary search algorithm through interactive visualization. Learn how this efficient O(log n) algorithm works and when to use it in your projects.

P

Pranay Kothapalli

Jan 25, 2024

Read More
4 min read

Interactive Algorithm Visualization: Learn Sorting Through Play

Explore sorting algorithms through interactive visualizations. Watch bubble sort and quick sort in action with real-time animations and step-by-step explanations.

P

Pranay Kothapalli

Jan 25, 2024

Read More
Software Engineeringsoftware-engineering
10 min read

Essential Software Engineering Principles Every Developer Should Know

Master the fundamental principles of software engineering that will make you a better developer. From SOLID principles to clean code practices, learn what separates good code from great code.

P

Pranay Kothapalli

Jan 22, 2024

Read More
1 min read

Getting Started with Algorithms: A Beginner's Guide

Learn the fundamentals of algorithms and why they're essential for every programmer. This comprehensive guide covers the basics you need to know.

P

Pranay Kothapalli

Jan 20, 2024

Read More
Developmenttypescript
6 min read

Mastering TypeScript: From Beginner to Advanced

A comprehensive guide to TypeScript, covering everything from basic types to advanced patterns and best practices.

Y

Your Name

Jan 20, 2024

Read More
Computer Sciencedata-structures
1 min read

Data Structures 101: Understanding the Building Blocks of Programming

Master the fundamental data structures that form the foundation of computer science. From arrays to trees, learn how to choose the right structure for your needs.

P

Pranay Kothapalli

Jan 15, 2024

Read More
4 min read

Getting Started with Next.js: A Complete Guide

Learn how to build modern web applications with Next.js, from setup to deployment.

Y

Your Name

Jan 15, 2024

Read More
1 min read

Hello, World!

Welcome to my blog, attempt number 700! I've experimented with Gatsby, endured the overpriced freelance plans of WordPress, dabbled in Medium, and toyed with React, Vue, and more. Finally, I've found my groove with Next.js and fallen in love with it.

P

Pranay Kothapalli

Apr 10, 2022

Read More