摘要: Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)*(nums[j]-1). 很简 阅读全文
posted @ 2020-06-28 23:07 whatyouthink 阅读(62) 评论(0) 推荐(0) 编辑
摘要: On a plane there are n points with integer coordinates points[i] = [xi, yi]. Your task is to find the minimum time in seconds to visit all points. You 阅读全文
posted @ 2020-06-28 22:51 whatyouthink 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Given an array nums of integers, return how many of them contain an even number of digits. 就是给一个数组,求数组里面每个数字的位数是偶数的个数。 对每个数不停除10得到每个数的位数,然后判断一下是否是偶数。 阅读全文
posted @ 2020-06-28 22:45 whatyouthink 阅读(62) 评论(0) 推荐(0) 编辑
摘要: Given two arrays of integers nums and index. Your task is to create target array under the following rules: Initially target array is empty. From left 阅读全文
posted @ 2020-06-28 22:40 whatyouthink 阅读(57) 评论(0) 推荐(0) 编辑
摘要: We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [freq, val] = [n 阅读全文
posted @ 2020-06-28 21:48 whatyouthink 阅读(50) 评论(0) 推荐(0) 编辑
摘要: Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the num 阅读全文
posted @ 2020-06-28 21:40 whatyouthink 阅读(40) 评论(0) 推荐(0) 编辑
摘要: Given an integer n and an integer start. Define an array nums where nums[i] = start + 2*i (0-indexed) and n == nums.length. Return the bitwise XOR of 阅读全文
posted @ 2020-06-28 21:16 whatyouthink 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has. For each kid check if th 阅读全文
posted @ 2020-06-28 21:13 whatyouthink 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. class So 阅读全文
posted @ 2020-06-28 21:08 whatyouthink 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. 求数组的前缀和 class Soluti 阅读全文
posted @ 2020-06-28 20:44 whatyouthink 阅读(88) 评论(0) 推荐(0) 编辑