This repository contains various algorithmic problems solved using JavaScript. The problems are categorized under different topics for easy reference.
The following problems related to arrays are solved and placed in the Arrays folder:
-
Maximum Subarray Sum
File:Arrays/maxSubArraySum.js
Description: Solves the problem of finding the maximum sum of a contiguous subarray in a given array using Kadane's algorithm. -
Find Beggar Outside Temple
File:Arrays/beggarOutsideTemple.js
Description: Solves the problem of distributing money across a series of positions and calculating prefix sums. -
Rainwater Trapping
File:Arrays/rainwaterTrapping.js
Description: Solves the problem of calculating the total amount of rainwater trapped between buildings after rainfall.
The following matrix-related problems are solved and placed in the Matrices folder:
-
Find Missing Number
File:Matrices/Find Missing Number.jsDescription: Identifies the smallest missing positive number in an unsorted array.-
Merge Sorted Intervals
File:Matrices/mergeSortedIntervals.jsDescription: Merges a given target interval with overlapping intervals in a sorted list of intervals. -
Merge Intervals at Middle
File:Matrices/mergeIntervalsAtMiddle.jsDescription: Merges overlapping intervals in a sorted list to produce a list of non-overlapping intervals.
-
-
Row-Wise Matrix Search
File:Matrices/rowWiseMatrixSearch.js
Description: Given a matrix where each row is sorted, find if a target value exists in the matrix. -
Find Row with Maximum Number of 1's
File:Matrices/rowWithMaxNumberOFones.js
Description: Given a binary matrix where each row is sorted, find the row with the maximum number of 1's. -
Print Spiral Matrix
File:Matrices/printSpiralMatrix.js
Description: Print the elements of a matrix in a spiral order. -
Find Sum of All Submatrices
File:Matrices/findSumOfAllSubMatrices.js
Description: Given a matrix, find the sum of all possible submatrices.
The following bit manipulation-related problems are solved and placed in the Bit Manipulation folder:
-
Find nth Magic Number
File:Bit Manipulation/findNthNumberMagicNumber
Description: A magic number is a sum of unique powers of 5, determined by the binary representation of an integer. -
Unset x bits from right
File:Bit Manipulation/Unsetxbitsfromright
Description: Given an integer A. Unset B bits from the right of A in binary. -
Unset i-th bit
File:Bit Manipulation/Unsetxbitsfromright
Description: You are given two integers A and B. If the B-th bit in A is set, make it unset. If the B-th bit in A is unset, leave it as it is. Return the updated A value.