首页 > 学院 > 开发设计 > 正文

No520DetectCapital

2019-11-08 02:27:49
字体:
来源:转载
供稿:网友

Leetcode Contest做的这道题

思路

当场思路: 我自己的思路本来想用bit做, 觉得一定能做, 但后来发现用++更快, 就变成了当场的思路. 事后一直想用Bit: 但是只能检测从第三位数字起, 后面数字是否全为Upper或者全为Lower 没必要用&了因为会直接跳出循环. 这是Brute Force的方法呀! 巧用自带method: https://discuss.leetcode.com/topic/79911/simple-java-solution-o-n-time-o-1-space array1.equals(array2) is the same as array1 == array2is it the same array. Arrays.equals(array1, array2) compares the contents of the arrays.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表