My Python Learning Quizzes
这个仓库记录了我学习 Python 过程中的练习题。
已完成题目
- Paren Chunks: 将括号字符串拆分为独立的闭合块。 in fact i can use battle == 0 to identify if the () has been closed, but i think this one is my first inspiratin, so i just finished based on this, and actually it doesnt have difference in efficiency except the lines of code can be less.
- Inverse Permutation: 检查列表是否为排列并生成逆映射字典。
learning outcomes:I have mastered the use of Python set() for membership testing, achieving a constant time complexity of
$O(1)$ , which is significantly more efficient than lists. I’ve gained a deep understanding of how sets utilize hashing to locate elements in a single step and learned the underlying mechanics of collision resolution—specifically how Python's algorithm finds the next available slot when hash values (remainders) collide.