摘要: Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything 阅读全文
posted @ 2018-11-05 15:14 bernieloveslife 阅读(129) 评论(0) 推荐(0)
摘要: Implement the following operations of a queue using stacks. push(x) Push element x to the back of queue. pop() Removes the element from in front of qu 阅读全文
posted @ 2018-11-05 15:14 bernieloveslife 阅读(119) 评论(0) 推荐(0)
摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Input: "hello" Output: "holle" Example 2: Input: "le 阅读全文
posted @ 2018-11-05 15:14 bernieloveslife 阅读(108) 评论(0) 推荐(0)
摘要: In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or repla 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(216) 评论(0) 推荐(0)
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(110) 评论(0) 推荐(0)
摘要: There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(113) 评论(0) 推荐(0)
摘要: Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia: In a complete binary tree every le 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(110) 评论(0) 推荐(0)
摘要: Given a string S of digits, such as S = "123456579", we can split it into a Fibonacci like sequence [123, 456, 579]. Formally, a Fibonacci like sequen 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(189) 评论(0) 推荐(0)
摘要: Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(173) 评论(0) 推荐(0)
摘要: In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as 阅读全文
posted @ 2018-11-05 15:13 bernieloveslife 阅读(128) 评论(0) 推荐(0)