![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript--leetcode
文章平均质量分 80
考拉要coding
这个作者很懒,什么都没留下…
展开
-
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 · 292 阅读 · 0 评论 -
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 · 238 阅读 · 0 评论 -
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 · 225 阅读 · 0 评论 -
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 · 290 阅读 · 0 评论 -
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 · 270 阅读 · 0 评论 -
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 · 265 阅读 · 0 评论