Age | Commit message (Collapse) | Author |
|
Easy after Java version is done. I'm happy that I did this
in 3 languages (Java, Python, C++). I can really tell that
Python is more succinct, whereas Java is really verbose.
Fun stuff :)
|
|
Not too bad since I worked it out in Java first
|
|
Not too bad to convert Java to Python. Converting the for loop
and playing indexing is interesting, good exercise.
|
|
I was tricked by how to create a list of empty list. This line
solved the problem:
self.elems = [[] for i in range(n)]
|
|
|
|
Not too bad since I worked it out in Java. A bit surprised that
Python class is used in starter file, but I made it testable
and wrote test cases. All is well.
|
|
Not too bad since I worked it out in Java. Good practice of heapq module in Python! A lot of fun :)
|
|
Not too bad, since the Java version has been worked out.
|
|
It's not too bad, since I worked things out in Java first. 2
things are of note: 1. Java Deque's pop is Python Deque's
popleft. 2. I didn't use an iterator to remove items. It
seemed to work fine.
|
|
Fun exercise. Interesting to experience the mentality change
of creating classes in Python, after first creating it in Java.
I removed the parent property in Python class since it's not
used. Object aliasing caused a bug that took me a bit to figure out.
|
|
Strict TDD is not possible, at least the type I'm used to through Eclipse PyDev, where I write tests first, and rely on PyDev to generate files/function stubs. Bummer, but I decided to stick with PyCharm just to learn it.
|