Skip to content

RaviCoderWallah/Problem-Solving-Question

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Problem Solving Question — JavaScript DSA Practice

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


📌 Project Structure

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 liye
  • script.js / solution.js — Problems ka code aur solutions

📅 Day-Wise Topics & Problems

🔢 Day 1 — Number Problems

  • 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

🔀 Day 2 — Condition & Logic

  • 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

⭐ Day 3 — Star Pattern Printing

  • Right-Angled Star Triangle
  • Inverted Right-Angled Triangle
  • Pyramid Pattern
  • Inverted Pyramid Pattern
  • Hollow Square
  • Hollow Pyramid
  • Alternating Binary Triangle (0/1 pattern)

🔟 Day 4A — Decimal Number System

  • 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

🔟 Day 4B — Decimal Number System (Advanced)

  • Palindrome Number Check
  • Armstrong Number Check
  • Homework: Sum of Digits, Average of Digits, Largest & Smallest Digit, Strong Number, Automorphic Number, Digit Frequency, Harshad Number

➗ Day 5 — Factors & Multiples

  • Print All Factors of a Number (Optimized with √N)
  • Print All Multiples up to a Limit
  • HCF (Highest Common Factor)
  • LCM (Least Common Multiple)

🌀 Day 6 — Fibonacci & Prime Problems

  • 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

🧮 Day 7 — Prime Factorization

  • Prime Factorization of a Number (Divisor, Dividend, Quotient approach)

📝 Day 8 — String Problems

  • 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)

🔍 Day 9 — Sub-String Problems

  • 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

📦 Day 10 — Array Problems

  • 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 concat or 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

📦 Day 11 — Medium Array Problems

  • Find Missing Number from 1 to N (Loop + Sum Formula approach)
  • Move All Zeros to End (Stable, O(n))
  • Find First Repeating Element

🫧 Day 12 — Bubble Sort

  • 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

🎯 Day 13 — Selection Sort

  • 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

📥 Day 14 — Insertion Sort

  • Sort Ascending Order
  • Sort Descending Order
  • Insert Value into Already Sorted Array

🔎 Day 15 — Linear Search

  • 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

🔎 Day 16 — Binary Search

  • Find an Element Using Binary Search
  • Return -1 if Element Not Found

🔄 Day 17 — Recursion (Basics)

  • 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

🔄 Day 18 — Recursion on Array & String

  • 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

🔄 Day 19 — Recursion on Objects

  • 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

🌳 Day 20 — Tree Data Structure

  • 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

🌲 Day 21 — Binary Search Tree (BST)

  • BST Node Class with Insert Method
  • BST Search Method
  • Build a BST from Values

🛠️ How to Run

  1. Clone the repository:

    git clone https://github.com/RaviCoderWallah/Problem-Solving-Question.git
  2. Navigate to any day's folder:

    cd "Day1-Number Problems"
  3. Open index.html in a browser to see the output in console, OR run with Node.js:

    node script.js

🗺️ Topics Covered

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

📊 Total Problems Solved

  • 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)

🤝 Contributing

Agar aap koi naya solution ya better approach add karna chahte ho, toh pull request zaroor bhejo!

  1. Fork the repo
  2. Apna branch create karo (git checkout -b feature/new-solution)
  3. Changes commit karo (git commit -m 'Add new solution')
  4. Push karo (git push origin feature/new-solution)
  5. Pull Request open karo

📄 License

This project is open-source and available for learning purposes.


Made with ❤️ by RaviCoderWallah — Keep Learning, Keep Coding! 🚀

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors