Skip to content

【126-week2】学习总结 #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
suncen0505 opened this issue Apr 25, 2019 · 1 comment
Open

【126-week2】学习总结 #302

suncen0505 opened this issue Apr 25, 2019 · 1 comment

Comments

@suncen0505
Copy link

suncen0505 commented Apr 25, 2019

242题起初想用循环写出来,但是发现循环对比,各种测试用例都有可能漏掉,后来用一个hashmap存储key,value,循环另一个,再去hashmap里相应的减操作;这样提交代码后,性能并不好,翻看别人的代码,巧用26个字母去操作,太神了。当时想到了数组存储,但是没有想到拿26个字母索引来,这块省掉了map的key
同学在周四分享的时候,找到倒数第n个节点 的其中一个方法,挺神奇,k=n-len; 第二遍k=0的时候就找到。

字符串对比的题,巧用hashmap,数组存储,如果是字符,巧用字符-a的值

@renzhongxing
Copy link

死磕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants