500. Keyboard Row
来源:互联网 发布:java数组怎么输入值 编辑:程序博客网 时间:2024/06/05 20:28
原题链接
这道题如果是自己做的话,应该就是遍历了。
但是在discuss区有个非常巧妙的做法,这里就贴上来
public class P500 { public String[] findWords(String[] words) { return Stream.of(words).filter(s -> s.toLowerCase().matches("[qwertyuiop]*|[asdfghjkl]*|[zxcvbnm]*")).toArray(String[]::new); }}
注:
- 流的使用
- 正则表达式
阅读全文
0 0
- Leetcode-500. Keyboard Row
- 【Leetcode】500. Keyboard Row
- 500. Keyboard Row
- 500. Keyboard Row
- 【LeetCode】500. Keyboard Row
- 500. Keyboard Row
- LeetCode 500. Keyboard Row
- 500. Keyboard Row
- 500. Keyboard Row
- LeetCode 500. Keyboard Row
- 500. Keyboard Row
- 500. Keyboard Row (E)
- 500. Keyboard Row
- 500. Keyboard Row
- leetcode 500. Keyboard Row
- 500. Keyboard Row
- [LeetCode]500. Keyboard Row
- 500. Keyboard Row
- Caffe源码
- Nutz 设计模式应用 --- Facade 模式
- 测试栈空间的大小
- JDBC事务与ORM事务管理的差异与联系
- Oracle Database Transactions and Locking Revealed.pdf 英文原版 免费下载
- 500. Keyboard Row
- 分分钟用上C#中的委托和事件
- 新开博客,记录成长
- CS229学习笔记之生成学习算法
- PlexCoin创始人获罪入狱
- Beginning Objective-C.pdf 英文原版 免费下载
- 遇到了http 400
- 法国批准通过区块链技术交易非上市证券
- Python自学之路第九步——用户输入和while循环