This repository contains solutions to various LeetCode problems, solved using Python. The solutions are designed to help understand different algorithmic approaches required to tackle these problems. The repository is maintained by Alejandro Acosta.
The repository includes Python solutions for several LeetCode problems, such as:
-
017. Letter Combinations of a Phone Number: This problem involves generating all possible letter combinations that the given number could represent on a phone keypad.
-
039. Combination Sum: Solves the problem of finding all unique combinations in a set of numbers where the chosen numbers sum to a target.
-
046. Permutations: This script computes all permutations of a given list of numbers.
-
101. Symmetric Tree: The implementation checks whether a binary tree is symmetric around its center.
-
103. Binary Tree Zigzag Level Order Traversal: Outputs the values of nodes in a binary tree in a zigzag (spiral) level order.
-
139. Word Break: Determines if a word can be segmented into a space-separated sequence of dictionary words.
-
215. Kth Largest Element in an Array: Finds the kth largest element in a non-sorted array.
-
228. Summary Ranges: Provides a summary of continuous ranges in an array.
-
238. Product of Array Except Self: Computes an array such that each element is the product of all the other elements of the input array.
-
283. Move Zeroes: Rearranges an array so that all zeroes are moved to the end while maintaining the order of non-zero elements.
Each solution is implemented as a Python script, which can be executed directly with a Python interpreter. The scripts typically include a print statement at the end for testing purposes, which you can run and modify to test different input cases.
For example, to run the solution for the "Letter Combinations of a Phone Number" problem, execute:
python 017-letter-combinations-phone-number-dialpad.pyContributions to improve the solutions or to add solutions for more problems are welcome. Please follow the typical GitHub workflow (fork, modify, pull request) for contributions.
All solutions are provided by Alejandro Acosta. For questions or suggestions, feel free to reach out through GitHub.
This project does not specify a license. Please contact the owner for details on usage rights.