- 博客(4)
- 收藏
- 关注
原创 LeetCode 18.4Sum
题目描述Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the su...
2018-09-14 14:55:48 93
原创 LeetCode 15. 3Sum
题目描述**Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must ...
2018-09-14 10:28:55 81
原创 LeetCode 260. Single Number III
题目描述Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.Example:Input: ...
2018-09-03 10:59:18 66
原创 LeetCode 137. Single Number II
LeetCode 137.Single Number ||题目如下: *给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现了三次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗?*代码分析 方法1: 这个方法的思路是,模拟三进制进行操作,对nums[i] 进行累加,在不包括那个只出现1次的数的情况下,每一个位...
2018-08-31 19:26:36 118
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人