leetcode
NJU_CAIBANG
这个作者很懒,什么都没留下…
展开
-
leetcode189 Rotate Array
leetcode 189Given an array, rotate the array to the right by k steps, where k is non-negative.方法一开辟新数组,使用取余求下标的方法class Solution { public void rotate(int[] nums, int k) { int[] temp=new...原创 2019-04-15 20:04:26 · 157 阅读 · 0 评论 -
leetcode217 Contains Duplicate
leetcode 217Given an array of integers, find if the array contains any duplicates.Your function should return true if any value appears at least twice in the array, and it should return false if eve...原创 2019-04-15 20:44:04 · 156 阅读 · 0 评论 -
leetcode136 Single Number
Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usin...原创 2019-04-15 21:10:15 · 177 阅读 · 0 评论