Algorithm Blog
Dive deep into computer science concepts with interactive visualizations, step-by-step explanations, and hands-on examples.
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.
Pranay Kothapalli
Oct 21, 2024
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.
Pranay Kothapalli
Oct 21, 2024
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.
Pranay Kothapalli
Oct 21, 2024
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).
Pranay Kothapalli
Oct 21, 2024
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.
Pranay Kothapalli
Oct 21, 2024
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.
Pranay Kothapalli
Oct 21, 2024
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.
Pranay Kothapalli
Aug 02, 2024
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.
Pranay Kothapalli
Aug 01, 2024
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.
Pranay Kothapalli
Aug 01, 2024
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.
Pranay Kothapalli
Jul 29, 2024
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.
Pranay Kothapalli
Jul 29, 2024
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.
Pranay Kothapalli
Jul 28, 2024
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.
Pranay Kothapalli
Jul 26, 2024
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.
Pranay Kothapalli
Jul 26, 2024
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.
Pranay Kothapalli
Jul 23, 2024
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.
Pranay Kothapalli
Jul 23, 2024
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.
Pranay Kothapalli
Jul 16, 2024
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.
Pranay Kothapalli
Jul 14, 2024
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.
Pranay Kothapalli
Jul 14, 2024
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.
Pranay Kothapalli
Jul 13, 2024
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.
Pranay Kothapalli
Jul 12, 2024
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.
Pranay Kothapalli
Jul 12, 2024
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.
Pranay Kothapalli
Jul 12, 2024
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.
Pranay Kothapalli
Jul 12, 2024
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.
Pranay Kothapalli
Jul 11, 2024
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.
Pranay Kothapalli
Jul 11, 2024
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.
Pranay Kothapalli
Jul 11, 2024
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.
Pranay Kothapalli
Jul 10, 2024
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.
Pranay Kothapalli
Jul 10, 2024
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.
Pranay Kothapalli
Jan 30, 2024
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.
Pranay Kothapalli
Jan 25, 2024
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.
Pranay Kothapalli
Jan 25, 2024
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.
Pranay Kothapalli
Jan 22, 2024
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.
Pranay Kothapalli
Jan 20, 2024
Mastering TypeScript: From Beginner to Advanced
A comprehensive guide to TypeScript, covering everything from basic types to advanced patterns and best practices.
Your Name
Jan 20, 2024
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.
Pranay Kothapalli
Jan 15, 2024
Getting Started with Next.js: A Complete Guide
Learn how to build modern web applications with Next.js, from setup to deployment.
Your Name
Jan 15, 2024
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.
Pranay Kothapalli
Apr 10, 2022