随笔分类 - LeetCode
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron
阅读全文
摘要:Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion? 判断给定整数是否是3的某次
阅读全文
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 程
阅读全文
摘要:Write a function that takes a string as input and reverse only the vowels(元音字母) of a string. Example 1:Given s = "hello", return "holle". Example 2:Gi
阅读全文
摘要:Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? 递归的办法: /** * Definition
阅读全文

浙公网安备 33010602011771号