A structured 21-day problem-solving journey covering Data Structures & Algorithms using JavaScript. Each day focuses on a specific topic with class questions and homework problems — from basic number problems to Trees and Binary Search Trees.
Creator: RaviCoderWallah Language: JavaScript (Vanilla JS) Inspired by: ProCodrr YouTube Channel
Problem-Solving-Question/
│
├── Day1-Number Problems/
├── Day2-Conditon-and-Logic/
├── Day3-Prints-Star-Patterns/
├── Day4A-Decimal-Number-System/
├── Day4B-Decimal-Number-System/
├── Day5 - Factors-And-Multiples/
├── Day6-Fibonacci-Problems/
├── Day7-Prime-Factorization/
├── Day8-String-Problems/
├── Day9-Sub-String-Problems/
├── Day10-Array-Problems/
├── Day11-Medium-Array-Problems/
├── Day12-Bubble-Sort/
├── Day13-Selection-Sort/
├── Day14-Insertion-Sort/
├── Day15-Linear-Search/
├── Day16-Binary-Search/
├── Day17-Recursion/
├── Day18-Recursion-on-Array-and-String/
├── Day19-Recursion-on-Objects/
├── Day20-Tree/
├── Day21-Binary-Search-Tree/
└── README.md
Har ek day ke folder mein yeh files hain:
index.html— Browser mein output dekhne ke liyescript.js/solution.js— Problems ka code aur solutions
- Print Numbers from 1 to N (While Loop & For Loop)
- Print Numbers from N to 1
- Print All Even Numbers from 1 to N (Optimized: N/2 iterations)
- Sum of First N Natural Numbers (Formula vs Loop approach)
- Factorial of N
- Sum of All Even Numbers up to N
- Print Squares of Numbers from 1 to N
- Homework: Divisible by 3 & 5, Sum of Odd Numbers, Cubes of Numbers
- Find Maximum of Three Numbers
- Check Positive / Negative / Zero
- Calculate Electricity Bill (Slab-wise pricing)
- Vowel or Consonant Checker
- Leap Year Check
- Homework: Character Type Detection (Uppercase/Lowercase/Digit/Special), Triangle Type by Sides
- Right-Angled Star Triangle
- Inverted Right-Angled Triangle
- Pyramid Pattern
- Inverted Pyramid Pattern
- Hollow Square
- Hollow Pyramid
- Alternating Binary Triangle (0/1 pattern)
- Convert Digits Array to Number (with Reverse)
- Split Number into Digits Array
- Remove Decimal Point Mathematically
- Separate Whole and Fractional Parts
- Count Whole and Fractional Digits Separately
- Generate Decimal Number from Whole & Fraction Digit Arrays
- Palindrome Number Check
- Armstrong Number Check
- Homework: Sum of Digits, Average of Digits, Largest & Smallest Digit, Strong Number, Automorphic Number, Digit Frequency, Harshad Number
- Print All Factors of a Number (Optimized with √N)
- Print All Multiples up to a Limit
- HCF (Highest Common Factor)
- LCM (Least Common Multiple)
- Print Fibonacci Series (N terms)
- Find Nth Fibonacci Number
- Check if a Number belongs to Fibonacci Series
- Homework: Print All Primes up to N, Sum of All Primes, Twin Primes Check, Fibonacci up to Limit, Fibonacci within Range, Sum of Even Fibonacci Numbers, Consecutive Fibonacci Sum is Prime Check
- Prime Factorization of a Number (Divisor, Dividend, Quotient approach)
- Reverse a String (Manual method)
- Palindrome String Check (Normal + Two-Pointer method)
- Reverse Words in a Sentence
- Find the Longest Word in a Sentence
- Count Number of Words (Manual without split)
- Check if One String is a Substring of Another (Manual method)
- Find Index of Substring (Custom
indexOf) - Check if One String is Rotation of Another
- Find Maximum and Minimum Element
- Reverse an Array (Manual + Two-Pointer method)
- Check if Array is Sorted (Ascending)
- Remove All Duplicates (using Filter)
- Merge Two Arrays Without
concator Spread - Homework: Second Largest Element, Rotate Array by K Steps, Check Two Arrays Equality, Count Even/Odd Numbers, Unique Pairs with Target Sum, Left Shift by One, Element Frequency Count
- Find Missing Number from 1 to N (Loop + Sum Formula approach)
- Move All Zeros to End (Stable, O(n))
- Find First Repeating Element
- Sort Ascending Order
- Sort Descending Order
- Sort String Alphabetically
- Sort with Swap Count
- Homework: Sort Objects by Age, Sort with Zeros at End, Track Comparisons Count, Case-Insensitive Char Sort, Sort 2D Array by First Element, Stop After K Passes, Sort Only Even Numbers, Sort Strings by Length
- Sort Ascending Order
- Sort Descending Order
- Find Kth Smallest Element
- Track Minimum Index per Pass
- Sort Array of Objects by Name
- Homework: K Largest Elements, Sort 2D Array by Second Element
- Sort Ascending Order
- Sort Descending Order
- Insert Value into Already Sorted Array
- Find Element Index in Array
- Find First Occurrence
- Find Last Occurrence
- Count Element Appearances
- Find All Indexes of Element
- Linear Search in Array of Objects
- Homework: Search in 2D Array, Find Min/Max Value, First Element Greater Than X, Check Strictly Increasing Array, Find First String by Starting Character
- Find an Element Using Binary Search
- Return -1 if Element Not Found
- Print Numbers from 1 to N (handles positive & negative)
- Print Numbers from N to 1
- Factorial using Recursion
- Sum of First N Natural Numbers
- Calculate Power (aⁿ) using Recursion
- Print All Array Elements using Recursion
- Sum of All Array Elements
- Check if Array is Sorted (Recursive)
- Reverse a String using Recursion
- Palindrome Check using Recursion
- Homework: String Length, Count Vowels, First/Last Occurrence of Element, Count Character Appearances, Replace All Occurrences of a Character, Check if All Elements are Even
- Print All Values in Nested Object
- Count Total Keys in Nested Object
- Sum of All Numeric Values in Nested Object
- Homework: Convert All Strings to Uppercase, Count Key Appearances, Find Depth of Nested Object, Check if Value Exists, Replace a Value
- Print All Node Names (DFS — Depth-First Search)
- Count Total Number of Nodes
- Print Only Leaf Nodes
- DOM: Print All Tag Names (DFS on HTML)
- DOM: Count Total Number of Elements
- Homework: Check if a Folder/File Exists in the Tree
- BST Node Class with Insert Method
- BST Search Method
- Build a BST from Values
-
Clone the repository:
git clone https://github.com/RaviCoderWallah/Problem-Solving-Question.git
-
Navigate to any day's folder:
cd "Day1-Number Problems"
-
Open
index.htmlin a browser to see the output in console, OR run with Node.js:node script.js
| Category | Days | Topics |
|---|---|---|
| Basics | Day 1–3 | Numbers, Conditions, Patterns |
| Number Systems | Day 4A, 4B | Decimal, Palindrome, Armstrong |
| Math | Day 5–7 | Factors, Fibonacci, Prime Factorization |
| Strings | Day 8–9 | String Manipulation, Substrings |
| Arrays | Day 10–11 | Array Operations, Medium Problems |
| Sorting | Day 12–14 | Bubble Sort, Selection Sort, Insertion Sort |
| Searching | Day 15–16 | Linear Search, Binary Search |
| Recursion | Day 17–19 | Basic Recursion, Arrays, Strings, Objects |
| Trees | Day 20–21 | Tree Traversal, Binary Search Tree |
- 100+ problems across 21 days
- Har problem ke saath Class Question aur Homework Question dono hain
- Multiple approaches diye gaye hain (e.g., Brute Force vs Optimized, Two-Pointer, Formula-based)
Agar aap koi naya solution ya better approach add karna chahte ho, toh pull request zaroor bhejo!
- Fork the repo
- Apna branch create karo (
git checkout -b feature/new-solution) - Changes commit karo (
git commit -m 'Add new solution') - Push karo (
git push origin feature/new-solution) - Pull Request open karo
This project is open-source and available for learning purposes.
Made with ❤️ by RaviCoderWallah — Keep Learning, Keep Coding! 🚀