Skip to content

This repository consist of brute force , better and optimal solutions to leetcode problems

Notifications You must be signed in to change notification settings

C0deHungeR/LeetCode_Questions

Repository files navigation

LeetCode Solutions: Brute Force, Better, and Optimal Approaches

This repository contains my solutions to various LeetCode problems. Each problem is solved using three different approaches:

  • Brute Force: A straightforward but possibly inefficient approach.
  • Better Approach: A solution that improves on the brute force method.
  • Optimal Approach: The most efficient solution in terms of time and space complexity.

The goal is to demonstrate progression from basic problem-solving strategies to the most optimized solutions.

Repository Structure

Each problem has its own folder containing:

  • Brute force solution (brute_force.cpp)
  • Better solution (better_solution.cpp)
  • Optimal solution (optimal_solution.cpp)
  • A README file with a description of the problem, solution explanation, and time/space complexities.

How to Use This Repository

  • Each folder corresponds to a specific LeetCode problem.
  • In each folder, you’ll find three different solutions: brute force, better, and optimal.
  • Each folder also contains a README with a description of the problem and solution explanations.

Problem-Solving Approach

  • Brute Force: Simple approach focusing on solving the problem, typically with higher time complexity.
  • Better Solution: Optimizes either time or space complexity.
  • Optimal Solution: Leverages advanced techniques like dynamic programming, greedy algorithms, or efficient data structures to achieve the best possible time and space complexity.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests if you have better solutions or suggestions.

About

This repository consist of brute force , better and optimal solutions to leetcode problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages