- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 Leetcode-258-Add Digits
题目要求: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. 给定一个非负的整型数,重复加其每位,知道结果是一位数。 例:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. S
2016-09-28 13:11:37 247
原创 Leetcode-371-Sum of Two Intergers
题目要求:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. 求两个整型数的和,但是不可使用+和-运算符 例:Given a = 1 and b = 2, return 3. 解题思路:1.既然不能使用“+”“-”运算符,就考虑位运算 2.例如13+1,
2016-09-22 16:37:11 253
原创 Leetcode-292-Nim Game
题目要求:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be
2016-09-20 10:35:37 274
原创 Leetcode-350-Intersection of Two Arrays II
题目要求:Given two arrays, write a function to compute their intersection. 求两个数组的并集 例:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. 注意:所求得的数组中有重复元素。 解题思路:1,函数compare():将输入的两个数组按升序排列
2016-09-18 15:09:33 213
原创 Leetcode-349-Intersection of Two Array
题目要求:Given two arrays, write a function to compute their intersection. 求两个数组的并集 例:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. 注意:所取得的并集中的元素无重复元素 解题思路:1.分别将两个数组中的重复元素剔除 2.求两个数组
2016-08-25 09:57:02 222
原创 Leetcode-345-Reverse Vowels of a String
题目要求:Write a function that takes a string as input and reverse only the vowels of a string 写一个函数具备以下功能:仅仅反转字符串中的元音字母(元音字母:a、e、i、o、u、A、E、I、O、U) 例:Given s = "hello", return "holle" Given s = "leet
2016-08-23 21:10:05 274
《笨方法学Python》
2017-08-31
林锐-高质量C编程
2017-03-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人