wisdompeak / LeetCode

This repository contains the solutions and explanations to the algorithm problems on LeetCode. Only medium or above are included. All are written in C++/Python and implemented by myself. The problems attempted multiple times are labelled with hyperlinks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

327题数据范围变动

mingyEx opened this issue · comments

commented

327题可能更新了数据范围,导致原有的做法不能通过,建议加一个0

commented

顺便一问: grandyang的做法1为何会超时

谢谢提醒,已改正。
对于另一个问题,因为sums是个multiset,里面distance的计算其实是靠迭代器的亲自移动得到的,而不是像vector一样直接算内存地址之差。所以那个解法的本质就是N^2.