Hhimanshuinblogs-himanshu.hashnode.devDay 20 - Search in Rotated Sorted ArrayQuestion You are given an array of length n which was originally sorted in ascending order. It has now been rotated between 1 and n times. For example, the array nums = [1,2,3,4,5,6] might become: [3Just now·3 min read
KMKaushal Mauryainkaushalm.hashnode.devTop K Frequent Elements — When HashMaps Start Earning Their SalaryGiven an integer array nums and an integer k, return the k most frequent elements within the array. The test cases are generated such that the answer is always unique. Example 1: Input: nums = [1,2,2,1d ago·2 min read
SSSk Shoyebinskshoyebjavascript.hashnode.devRat In A Maze Problem SolvedJavaScript BacktrackingIn this article we will solve Rat in a maze problem with backtracking. The rat start point is (0,0) and exit point is (n-1, n-1). The rat can move to 1 and 0 is blocked. Diagram Code class Solution 1d ago·3 min read
SSSk Shoyebinskshoyebjavascript.hashnode.devAll String Permutations - Backtracking Method - JavaScript SolutionIn this article we will solve the all string permutation problem with javascript by backtracking method. We will generate the solution tree and write the code accordingly, Solution Tree Code class 3d ago·2 min read
ANAvinash Negiindsawithpython.hashnode.devGraphs: I Was Right — It Was Going to Be Hard Day 20 of my DSA journey. Before starting graphs, I had a feeling. Not excitement. Not curiosity. A quiet dread. This one is going to be hard. I was right. What Is a Graph? A graph is a collection of4d ago·6 min read
JRJaya Rani YSinjayalloyd.hashnode.devHow I Used Karumanchi’s DSA Book to Build a Strong Java FoundationWhy I Chose This Book While preparing Data Structures and Algorithms using Java, I wanted a resource that was structured, logic-focused, and not just interview-pattern based. That’s when I picked 4d ago·2 min read
MSMuppidi Srinivasinsrinivastechblog.hashnode.devMastering Fenwick Tree for Competitive ProgrammingWhile reading, don’t overthink or get stuck. Just follow along with the flow—you’ll understand everything step by step as we go. Given ArrayIndex : 0 1 2 3 4 5 6Array : 3 2 4d ago·11 min read
Hhimanshuinblogs-himanshu.hashnode.devDay 19 - Find Minimum in Rotated Sorted ArrayQuestion You are given an array of length n which was originally sorted in ascending order. It has now been rotated between 1 and n times. For example, the array nums = [1,2,3,4,5,6] might become: [34d ago·3 min read
Hhimanshuinblogs-himanshu.hashnode.devDay 18 - Koko Eating BananasQuestion You are given an integer array piles where piles[i] is the number of bananas in the ith pile. You are also given an integer h, which represents the number of hours you have to eat all the ban5d ago·3 min read
MSMuppidi Srinivasinsrinivastechblog.hashnode.devMo’s Algorithm – Step by Step GuideMo’s Algorithm is a technique used to answer range queries efficiently on arrays You are given : An array A Many queries: [L, R] Each query asks something like : sum of elements number of dis6d ago·10 min read