π Coding Challenges in Multiple Languages
Welcome to the Coding Challenges Repository! π This project is designed to help developers practice problem-solving, improve coding skills, and learn how to implement the same challenge in different programming languages.
Whether youβre a beginner looking to strengthen fundamentals or an experienced developer revisiting core concepts, this repository will guide you through a wide range of challenges.
π Repository Structure
The repository is organized by language and challenge:
coding-challenges/ β βββ python/ β βββ challenge1.py β βββ challenge2.py β βββ ... β βββ javascript/ β βββ challenge1.js β βββ challenge2.js β βββ ... β βββ java/ β βββ Challenge1.java β βββ Challenge2.java β βββ ... β βββ cpp/ β βββ challenge1.cpp β βββ challenge2.cpp β βββ ... β βββ README.md
π Challenges Covered
Some of the challenges currently included:
Reverse a String
Check Palindrome
FizzBuzz
Factorial Calculation
Find Largest Number in an Array
Prime Number Check
Fibonacci Series
Two Sum Problem
Anagram Checker
Sorting Algorithms (Bubble, Quick, Merge, etc.)
(More challenges will be added regularly.)
β‘ Example Solutions
- Reverse a String Python def reverse_string(s): return s[::-1]
print(reverse_string("Hello")) # Output: olleH
JavaScript function reverseString(str) { return str.split("").reverse().join(""); }
console.log(reverseString("Hello")); // Output: olleH
Java public class Challenge1 { public static String reverseString(String str) { return new StringBuilder(str).reverse().toString(); }
public static void main(String[] args) {
System.out.println(reverseString("Hello")); // Output: olleH
}
}
- FizzBuzz Python for i in range(1, 21): if i % 3 == 0 and i % 5 == 0: print("FizzBuzz") elif i % 3 == 0: print("Fizz") elif i % 5 == 0: print("Buzz") else: print(i)
JavaScript for (let i = 1; i <= 20; i++) { if (i % 3 === 0 && i % 5 === 0) { console.log("FizzBuzz"); } else if (i % 3 === 0) { console.log("Fizz"); } else if (i % 5 === 0) { console.log("Buzz"); } else { console.log(i); } }
JavaScript (Node.js required) cd javascript node challenge1.js
Java cd java javac Challenge1.java java Challenge1
C++ cd cpp g++ challenge1.cpp -o challenge1 ./challenge1
π οΈ Requirements
Python β₯ 3.7
Node.js β₯ 14.x
Java β₯ JDK 11
g++ (for C++)
π± Contribution Guidelines
We welcome contributions! Hereβs how you can help:
Fork the repository
Create a new branch:
git checkout -b feature/add-new-challenge
Add your solution in the respective language folder.
Update the README.md if necessary.
Commit your changes:
git commit -m "Added new challenge: "
Push to your fork and submit a Pull Request.
β Support
If you find this repository helpful:
Star β the repo
Share it with your friends
Contribute new challenges
Letβs grow together by solving problems in multiple languages π