Leetcode
呆呆侠
这个作者很懒,什么都没留下…
展开
-
LeetCode169 投票算法
class Solution { public int majorityElement(int[] nums) { int ans = nums[0]; int cnt = 1; for(int i = 1 ;i < nums.length ; i++){ if(cnt == 0) ans = nums[i];...原创 2019-12-01 13:13:25 · 192 阅读 · 0 评论 -
LeetCode刷题注意点(JAVA)
1.用append来代替 += 来进行字符串的连接 StringBuilder s = new StringBuilder(address);原创 2019-08-30 18:00:02 · 393 阅读 · 0 评论