- 博客(2)
- 收藏
- 关注
原创 《Scala编程实战》笔记 1 字符串
字符串查找 创建正则匹配表达式,在正则表达式字符串后加 .r val numPattern = "[0-9]".r val str = "1a2b" numPattern.findFirstIn(str).getOrElse(0) numPattern.findAllIn(str).toArray numPattern.findFirstIn(str).foreach(println) findFirstIn返回一个 Option 对象,处理方式一般有 取值 getOrElse 使用模式匹配对 Opti
2020-10-08 11:59:18
89
原创 461. Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, y < 231.Exa...
2018-03-23 01:37:57
94
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅