摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n]
阅读全文
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo
阅读全文
摘要:绘制渐变背景图 第一种:大神的想法,摘抄 background-image: -webkit-linear-gradient(left, blue, red 25%, blue 50%, red 75%, blue 100%);使用CSS3的渐变绘制图像,从左到右。需要注意的是颜色是 0到49%的颜
阅读全文
摘要:function sum(arr) { var len = arr.length; var sum = 0; if(len == 0){ sum = 0; }else{ for(var i = 0;i < len;i++){ sum += arr[i]; } } return sum;} funct
阅读全文