
【LeetCode】
文章平均质量分 71
Anabel Chen
世上之事,只该难得,不该易得,易得之事易失去,难得之事难失去!
展开
-
【LeetCode】1313. Decompress Run-Length Encoded List(javascript版)
1313.Decompress Run-Length Encoded ListWe are given a list nums of integers representing a list compressed with run-length encoding.Consider each adjacent pair of elements [freq, val] = [nums[2*...原创 2020-03-25 17:12:41 · 343 阅读 · 0 评论 -
【LeetCode】905. Sort Array By Parity (javascript版)
905.Sort Array By ParityGiven an array A of non-negative integers, return an array consistingof all the even elements of A, followed by all the odd elements of A.You may return any answer array ...原创 2020-03-25 17:04:06 · 197 阅读 · 0 评论 -
【LeetCode】561. Array Partition 1(javascript版)
561.Array Partition 1Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i fr...原创 2020-03-25 16:13:10 · 273 阅读 · 0 评论 -
【LeetCode】26. Remove Duplicates from Sorted Array(javascript版)
26.Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for ...原创 2020-03-13 17:30:18 · 278 阅读 · 0 评论 -
[编程题]抛小球
编程题:抛小球小东和三个朋友一起在楼上抛小球,他们站在楼房的不同层,假设小东站的楼层距离地面N米,球从他手里自由落下,每次落地后反跳回上次下落高度的一半,并以此类推直到全部落到地面不跳,求四个小球一共经历了多少米?(数字都为整数)给定四个整数A,B,C,D,请返回所求结果。测试样例:100,90,80,70返回:1020解题要点:以为数字都为整数,所以存在N原创 2015-11-17 23:08:48 · 1697 阅读 · 2 评论 -
【LeetCode】1.TwoSum(两数之和)
1.TwoSumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not us...原创 2018-09-18 18:17:37 · 266 阅读 · 0 评论