← Back to Python Study Repository
This folder contains Python code problems that are commonly asked during technical interviews. The problems are designed to help you practice and strengthen your Python programming skills.
- Variety of Problems: Covers a range of problem types, including algorithmic challenges, data structure manipulations, and coding puzzles.
- Structured Solutions: Each problem includes a well-documented solution to help you understand the approach and logic.
- Modular Code: The code is written modularly, making it easier to read, run, and reuse.
- Reverse String: Reverses a given string.
- Check Palindrome: Checks if a given string is a palindrome.
- Find Duplicates: Finds duplicate elements in a list.
- Generate Fibonacci Numbers: Generates the first
nFibonacci numbers. - Calculate Factorial: Calculates the factorial of a number.
- Check Anagram: Checks if two strings are anagrams.
- Merge Sorted Arrays: Merges two sorted arrays into one.
- Find Missing Number: Finds the missing number in a list of integers.
- Maximum Subarray Sum: Finds the maximum sum of a contiguous subarray.
- Count Vowels: Counts the number of vowels in a string.
- Binary Search: Performs binary search to find a target in a sorted array.
- Check Prime Number: Checks if a number is prime.
- Rotate Matrix: Rotates a matrix 90 degrees clockwise.
- Longest Common Prefix: Finds the longest common prefix among a list of strings.
- Validate Parentheses: Validates if a string contains valid parentheses.
- Binary Search: Performs binary search on a sorted array.
- Breadth-First Search (BFS): Searches for a node in a graph using BFS.
- Depth-First Search (DFS): Searches for a node in a graph using DFS.
- Binary Tree Search: Searches for a value in a binary search tree.
- Bubble Sort: Sorts a list using the Bubble Sort algorithm.
- Insertion Sort: Sorts a list using the Insertion Sort algorithm.
- Merge Sort: Sorts a list using the Merge Sort algorithm.
- Quick Sort: Sorts a list using the Quick Sort algorithm.
- Binary Sort: Sorts a list using the Binary Sort algorithm (uses a Binary Search Tree).
- Assign Heights to Land and Water Cells: Assigns heights to cells in a matrix following specific rules, ensuring the maximum height is maximized while satisfying constraints.
-
Clone the repository:
git clone https://github.com/smaruf/python-study.git -
Navigate to the
code-runfolder:
cd python-study/src/code-run -
Run the Python scripts:
python example_problem.pyExample:
python fibonacci.py -
Explore the solutions to understand different approaches.
- Python: Ensure you have Python 3.x installed on your system. You can download it from python.org.
- Dependencies: Install any required libraries using:
pip install -r requirements.txt
Contributions are welcome! If you have any new problems or more optimized solutions, feel free to submit a pull request.
- Add detailed comments and explanations for new problems or solutions.
- Ensure the code follows PEP 8 standards.
- Update the
requirements.txtfile if new dependencies are introduced.
This project is licensed under the MIT License. For more details, see LICENSE.
If you encounter any issues, please open an issue in the GitHub repository.
Currently, this folder focuses on Python problems. Contributions in other programming languages can be added to respective folders in the repository.
Check out the official Python documentation and other online platforms like LeetCode and HackerRank.
Would you like me to assist in committing this updated README file to your repository?