摘要:
今天手残,碰了一道leetcode HARD难度题目,果然来着不善,花了不少时间,题目很简单,求平面内一些离散点中,最大共线点的数量。最直接的思路就是通过斜率判断,但是考虑到斜率很可能是小数,比较小数的大小会有误差,因此我们不做除法,取横纵坐标差值的最大公约数,然后横纵坐标分别除以最大公约数即可,这 阅读全文
摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文