
LeeCode题
林博弈
编程使我快乐~
展开
-
Leecode_找出两个数和
题目链接:Leetcode :167. Two Sum II - Input array is sorted (Easy)题目描述:在有序数组中找出两个数,使它们的和为 target。Input: numbers={2, 7, 11, 15}, target=9Output: index1=1, index2=2解package 双指针;/** * 题目描述:在有序数组中...原创 2019-09-11 20:24:31 · 219 阅读 · 0 评论 -
LeeCode_两数平方和
原文链接:Sum of Square Numbers (Easy)题目描述:判断一个数是否为两个数的平方和。Input: 5Output: TrueExplanation: 1 * 1 + 2 * 2 = 5/** * 2. 两数平方和 * Input: 5 * Output: True * Explanation: 1 * 1 + 2 * 2 = 5 * 判断一个数是...原创 2019-09-11 20:28:48 · 314 阅读 · 0 评论 -
LeeCode_反转字符串中的元音字符
原文链接:Reverse Vowels of a String (Easy)Given s = “leetcode”, return “leotcede”.思路:使用双指针指向待反转的两个元音字符,一个指针从头向尾遍历,一个指针从尾到头遍历。/** * 3. 反转字符串中的元音字符 * aeiou * Given s = "leetcode", return "leotce...原创 2019-09-11 20:31:34 · 144 阅读 · 0 评论 -
LeeCode_回文字符串
原文链接:Valid Palindrome II (Easy)Input: “abca”Output: TrueExplanation: You could delete the character ‘c’.题目描述:可以删除一个字符,判断是否能构成回文字符串。/** * Input: "abca" * Output: True * Explanation: You c...原创 2019-09-11 20:38:15 · 176 阅读 · 0 评论