随笔分类 -  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 阅读全文
posted @ 2017-02-17 10:40 不思蜀 阅读(238) 评论(0) 推荐(0)
摘要: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的某次 阅读全文
posted @ 2017-02-16 17:07 不思蜀 阅读(163) 评论(0) 推荐(0)
摘要: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: 程 阅读全文
posted @ 2016-12-29 10:43 不思蜀 阅读(194) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2016-12-19 15:39 不思蜀 阅读(153) 评论(0) 推荐(0)
摘要:Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? 递归的办法: /** * Definition 阅读全文
posted @ 2016-12-15 10:46 不思蜀 阅读(222) 评论(0) 推荐(0)