Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Similar as "Majority Element". There are at most 2 such elements, for > floor(n/3), and every non-hit element will decrease count of EACH hit element.

https://leetcode.com/discuss/42769/o-n-time-and-in-o-1-space-c-solution

posted on 2015-06-29 23:21  Tonix  阅读(132)  评论(0编辑  收藏  举报