新农上路
- 积分
- 99
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2012-8-2
- 最后登录
- 1970-1-1
|
本帖最后由 zuohr 于 2013-2-17 22:57 编辑
ryancooper 发表于 2013-2-17 15:13 ![]()
Wow, so quick! If we can not use additional data structures, then it seems we have to do t ...
Implementing the idea of ryancooper, which uses a bitmap boolean[] to mark the occurance of each character.
Time complexity O(N), space complexity O(N).
https://gist.github.com/anonymous/4971778
|
|