Prashant Basnet, a software engineer at Unisala.com, focuses on software development and enjoys building platforms to share knowledge. Interested in system design, data structures, and is currently learning NLP

Author avatar
Prashant Basnet
title
              unisala image

Signature of Prashant Basnet

Author avatar
Prashant Basnet5 days ago
You Thought Arrays Were Simple? Think Again

Arrays are where we start as devs. But what if I told you arrays secretly stack superpowers?Let's go beginner → expert: mastering arrays, stacks, monotonic stac

6 min read·General
Article cover
Author avatar
Prashant BasnetMay 17, 2025
Think Like an Engineer: Optimize Swaps with Cycle Insight | Sort Array | Moving Items to Empty Space

You are given an integer array nums of size n containing each element from 0 to n - 1 (inclusive). Each of the

4 min read·General
Article cover
Author avatar
Prashant BasnetMay 17, 2025
Matrix Rotation: A Must-Know for Devs & ML Engineers

🧠 Why Learn This?Matrix rotation isn't just a coding interview favorite It's used in AI, ML, and image processing to manipulate data efficiently.Think:Rotating

3 min read·General
Article cover
Author avatar
Prashant BasnetMay 17, 2025
From Brute Force to Optimal: Subarray Ranges Explained via Monotonic Stacks 🔥

You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest element in the

5 min read·General
Article cover
Author avatar
Prashant BasnetMay 9, 2025
Largest Color Value in a Directed Graph

🔁 Problem Restatement (in simpler terms)You are given:A directed graph with n nodes.Each node i has a color, colors[i] ∈ {a-z}.Each path from one node to anoth

4 min read·General
Article cover
Author avatar
Prashant BasnetApr 29, 2025
Decode String Problem: Mastering Stacks for Nested String Parsing

1️⃣ Understanding the ProblemThe Decode String problem asks us to decode a string like 3[a2[c]] into accaccaccFormat: k[encoded_st

4 min read·General
Article cover
Author avatar
Prashant BasnetApr 24, 2025
Shortest Unsorted Continuous Subarray

The Problem:Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non-decreasing orde

3 min read·General
Article cover
Author avatar
Prashant BasnetApr 22, 2025
Building a Resilient Task Queue System 📨 with RabbitMQ, Flask & Python 🐍

🐇 What is RabbitMQ?In real world systems, services fail, crash, restart, or scale dynamically. You can't afford tight coupling between them. RabbitMQ ensures n

4 min read·General
Article cover
Author avatar
Prashant BasnetApr 22, 2025
Finding the Number of Visible Mountains

🌍 The Why?Event Timeline Visibility:Think of mountains as tasks, events, or ads that want to be seen. Only those not completely covered by others are visible.U

5 min read·General
Article cover
Author avatar
Prashant BasnetApr 7, 2025
Loop Order in 2D Arrays | The Case of the Slow Matrix: A Developer’s Mystery 🔍

Chapter 1: The Mysterious SlowdownAlex, a junior engineer at a fast-paced AI startup, was proud of their latest code. It processed massive datasets for a new re

3 min read·General
Article cover
Author avatar
Prashant BasnetMar 27, 2025
The Greedy Gardener: A Simple Tale of Algorithms

Once upon a time, in a village of coders, there lived a gardener named Prashant. He had two ways of planting flowers in his garden Greedy and Non

3 min read·General
Article cover
Author avatar
Prashant BasnetMar 26, 2025
Minimum Weight Arborescence | CSCE 500 | Project 5

🧠 Why Are You Learning This?The minimum-weight arborescence (MWA) problem is a fundamental problem in graph theory with applications in:Network desig

5 min read·General
Article cover
Author avatar
Prashant BasnetMar 25, 2025
Solving All Variations of the Lowest Common Ancestor (LCA) Problem in Binary Trees

Let me walk you through the different variations of the LCA problem and how to solve each one with slight modifications to the core algorithm.1. Basic LCA Probl

3 min read·General
Article cover
Author avatar
Prashant BasnetMar 25, 2025
How to Identify Greedy Problems?

Greedy algorithms:The class of algorithms that make locally optimal choices at each step with the hope that these choices will lead to a globally optimal soluti

13 min read·General
Article cover
Author avatar
Prashant BasnetMar 25, 2025
Make Array Zero by Subtracting Equal Amounts

You are given a non-negative integer array nums. In one operation, you must:Choose a positive integer x such that x is less than or equ

3 min read·General
Author avatar
Prashant BasnetMar 23, 2025
Thread: Understanding the 132 Pattern Problem | Monotonic Stack | N^3 -> N Complexity

1. What Are We Talking About?The 132 pattern is a problem where we need to find a subsequence of three numbers in an array (nums[i], nums[j],&nbs

4 min read·General
Article cover
Author avatar
Prashant BasnetMar 22, 2025
Finding the Single Non-Duplicate Element in a Sorted Array: A Binary Search

Situation:You are given a sorted array of integers where every element appears exactly twice, except for one element that appears only once.

4 min read·General
Article cover
Author avatar
Prashant BasnetMar 19, 2025
Hamiltonian Cycles: The Problem That Could Win You $1 Million

In the world of computer science and mathematics, some problems are deceptively simple to describe but incredibly challenging to solve.One such problem is the&n

7 min read·General
Article cover
Author avatar
Prashant BasnetMar 18, 2025
Greedy Algorithm | Dijkstra Algorithm

Greedy algorithm only applies to the optimization problem.Greedy algorithm makes the decision at every point choosing the local minimum or maximum depending on

4 min read·General
Article cover
Author avatar
Prashant BasnetMar 1, 2025
The Universal Framework for solving 5 Interval Problems | Greedy Algorithm

Imagine this: You’re in a coding interview at your dream company. The interviewer slides you a problem about scheduling meetings or merging overlapping interval

5 min read·General
Article cover
Author avatar
Prashant BasnetFeb 23, 2025
Deep Beliefs Network

If you stack several restricted Boltzmann machine on the top of each other then we form a deep belief networkInput layers -> suplied to 1st RBM -> inputs

1 min read·General
Article cover
Author avatar
Prashant BasnetFeb 20, 2025
Feature Development Update
1 min read·General
Article cover
Author avatar
Prashant BasnetFeb 19, 2025
Dynamic Programming: One Solution for Multiple Problems

In this thread we will see how a single dynamic programming (DP) approach can be adapted to solve multiple seemingly different problems. By understand

5 min read·General
Article cover
Author avatar
Prashant BasnetFeb 12, 2025
Singleton Design Pattern: The Key to Efficient and Maintainable Code

A Singleton is a design pattern that ensures a class has only one instance (object) throughout the entire application and provides a global point to access it.L

4 min read·General
Article cover
Author avatar
Prashant BasnetFeb 12, 2025
Bayes' Rule | Deep learnings

Bayes' Rule:A fundamental concept in probability theory. It allows us to update our belief about an event based on new evidence.probability of an event A, given

6 min read·General
Article cover