楼主: Fanyare
跳转到指定楼层
上一主题 下一主题
收起左侧

[CareerCup] [第二轮] 2/18-2/24 CareerCup 1.3

🔗
youling_tong 2013-2-22 03:35:42 | 只看该作者
全局:
本帖最后由 youling_tong 于 2013-2-22 03:36 编辑

看了1.1大家的解答之后学会了用bitmap

https://github.com/ltongrc/CareerCup/blob/master/1.3.java
回复

使用道具 举报

🔗
willians512 2013-2-22 12:25:46 | 只看该作者
全局:
https://gist.github.com/bigteeth/5010720

the same idea used in the first question. this reminds me of another question related to this.  find all the permutations of given string. anyone interested?
回复

使用道具 举报

🔗
ThunderXu 2013-2-23 10:03:09 | 只看该作者
全局:
https://gist.github.com/ThunderXu/5017976
创建一个256大小的int数组,初始化为0,对第一个string的每个char在数组中对应的位置+1,对第二个string的每个char在数组中对应的位置-1,最后再判断数组中是否都为0。
缺点是只能兼容那256个ASCII码。
有个问题:如果这个string包含中文该怎么办?因为中文会占两个ASCII吗,所以只是换成hashmap好像还会出问题吧
回复

使用道具 举报

🔗
qiaobao 2013-2-25 05:47:01 | 只看该作者
全局:
Assume all characters are in 8-bit ASCII table.
Use the idea of bitmap.

https://gist.github.com/Andy1989/c5a2a7fce9a01ef823b9
回复

使用道具 举报

🔗
sjtuzyt 2013-2-25 18:26:10 | 只看该作者
全局:
回复

使用道具 举报

🔗
yzl232 2013-2-26 10:39:09 | 只看该作者
全局:
本帖最后由 yzl232 于 2013-2-26 10:49 编辑

https://gist.github.com/yzl232/5035366

运用了2楼的算法。 冒泡排序后比较。 语言用了Python



我觉得27楼的真好。。
回复

使用道具 举报

🔗
cjsp 2013-2-28 20:11:51 | 只看该作者
全局:
https://gist.github.com/flatlight/5056304
真正面试时候是不是不能借助hashtable, hashset。而是自己用数组模拟?
回复

使用道具 举报

🔗
season 2013-3-2 15:22:20 | 只看该作者
全局:
this is my solution

https://gist.github.com/ShaneLittleton/5070038
回复

使用道具 举报

🔗
voiding 2013-5-16 12:06:02 | 只看该作者
全局:
https://gist.github.com/mogutou1214/5589307
my solution.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表