marcosfede / algorithms Goto Github PK
View Code? Open in Web Editor NEWSolved algorithms and data structures problems in many languages
License: GNU General Public License v3.0
Solved algorithms and data structures problems in many languages
License: GNU General Public License v3.0
Each solution should have a comment stating the time (and maybe the space) complexity of the solution
We need to improve the comments explaining the main ideas / insights of the solution
I'd like to build a static site where you could preview the solutions for each problem in each of the languages.
We could use something like Gatsby.js to parse the files and build the pages dynamically.
May I add Java solution to this repo?
We should standarize the way we write test cases across problems and across languages.
It would also be nice to have some sort of CI Pipeline and make the code run the tests to make sure solutions are functional
Could C++ solutions be added?
6 syntax errors in Python and 19 syntax errors in legacy Python...
$ python3 -m flake8 . --count --select=E9 --show-source --statistics
./tree/pretty_print.py:14:17: E999 SyntaxError: invalid syntax
print key, # comma prevents a newline character
^
./bit/add_without_operator.py:14:11: E999 SyntaxError: invalid syntax
print x
^
./linkedlist/copy_random_pointer.py:11:3: E999 IndentationError: expected an indented block
def copyRandomList(self, head):
^
./dp/combination_sum.py:64:8: E999 SyntaxError: invalid syntax
print dp[4]
^
./string/breaking_bad.py:39:18: E999 SyntaxError: invalid syntax
print match_symbol(chemicals, symbols)
^
./string/make_sentence.py:34:15: E999 SyntaxError: invalid syntax
print count ^
6 E999 SyntaxError: invalid syntax
$ python2 -m flake8 . --count --select=E9 --show-source --statistics
./googlecodejam/Bathroom Stalls/bathroom_stalls.py:53:40: E999 SyntaxError: invalid syntax
print(f'CASE #{case}: {mx} {mn}')
^
./googlecodejam/Oversized Pancake Flipper/oversized_pancake_flipper.py:5:23: E999 SyntaxError: invalid syntax
def subsets(collection: List[int]):
^
./googlecodejam/Fashion Show/fashion_show.py:98:56: E999 SyntaxError: invalid syntax
print(f'CASE #{case}: {score} {len(insertions)}')
^
./googlecodejam/Tidy Numbers/tidy_numbers.py:51:41: E999 SyntaxError: invalid syntax
print(f'CASE #{case}: {solution}')
^
./array/plus_one/plus_one.py:4:20: E999 SyntaxError: invalid syntax
def plus_one(digits: List[int]):
^
./array/longest_non_repeat/longest_non_repeat.py:4:25: E999 SyntaxError: invalid syntax
def longest_non_repeat(s: str) -> int:
^
./array/two_sum/two_sum.py:4:17: E999 SyntaxError: invalid syntax
def two_sum(nums: List[int], target: int)->List[int]:
^
./array/garage/garage.py:6:27: E999 SyntaxError: invalid syntax
def __init__(self, arr: List[int]) -> None:
^
./backtrack/letter_combination.py:10:31: E999 SyntaxError: invalid syntax
def letter_combinations(digits:"str")->"List[str]":
^
./backtrack/generate_parenthesis.py:16:22: E999 SyntaxError: invalid syntax
def gen_parenthesis(n:"int")->"List[str]":
^
./backtrack/anagram/anagram.py:17:14: E999 SyntaxError: invalid syntax
yield from (l + x for i, l in enumerate(word) for x in perm(word[:i] + word[i + 1:])) if len(word) > 1 else word
^
./linkedlist/add_two_numbers.py:21:25: E999 SyntaxError: invalid syntax
def add_two_numbers(left:"Node", right:"Node")->"Node":
^
./linkedlist/copy_random_pointer.py:11:3: E999 IndentationError: expected an indented block
def copyRandomList(self, head):
^
./linkedlist/swap_in_pairs.py:20:20: E999 SyntaxError: invalid syntax
def swap_pairs(head:"Node")->"Node":
^
./string/breaking_bad.py:82:2: E999 SyntaxError: invalid syntax
>>> ('[am]azon', 'mi[cro]soft', 'goog[le]')
^
./string/roman_to_int.py:7:19: E999 SyntaxError: invalid syntax
def roman_to_int(s:"str")->"int":
^
./string/multiply_strings.py:15:18: E999 SyntaxError: invalid syntax
def multiply(num1:"str", num2:"str")->"str":
^
./stack/valid_parenthesis.py:11:15: E999 SyntaxError: invalid syntax
def is_valid(s:"str")->"bool":
^
./matrix/rotate_image.py:17:15: E999 SyntaxError: invalid syntax
def rotate(mat:"List[List[int]]"):
^
19 E999 SyntaxError: invalid syntax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.