摘要:
题目: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 解答:这个题目超级无敌简单,就是把一个stri 阅读全文
摘要:
题目: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each 阅读全文
摘要:
题目: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occur 阅读全文
摘要:
题目: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? 题目解答:本题是不 阅读全文
摘要:
题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin 阅读全文
摘要:
题目:Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2-> 阅读全文
摘要:
题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipe 阅读全文
摘要:
题目:Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For 阅读全文
摘要:
题目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 阅读全文
摘要:
题目:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read 阅读全文