随笔分类 -  Level 2

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2016-08-01 23:23 北叶青藤 阅读(192) 评论(0) 推荐(0)
摘要:Count the number of prime numbers less than a non-negative number, n 阅读全文
posted @ 2016-07-31 11:27 北叶青藤 阅读(177) 评论(0) 推荐(0)
摘要:Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen 阅读全文
posted @ 2016-07-29 12:04 北叶青藤 阅读(283) 评论(0) 推荐(0)
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2016-07-28 06:43 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: A move is guaranteed to be valid and 阅读全文
posted @ 2016-07-27 21:01 北叶青藤 阅读(179) 评论(0) 推荐(0)
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-07-27 05:49 北叶青藤 阅读(220) 评论(0) 推荐(0)
摘要:Calculate the a^n % b where a, b and n are all 32bit integers. Calculate the a^n % b where a, b and n are all 32bit integers. Calculate the a^n % b wh 阅读全文
posted @ 2016-07-23 04:57 北叶青藤 阅读(260) 评论(0) 推荐(0)
摘要:Check Power of 2 Using O(1) time to check whether an integer n is a power of 2. Check Power of 2 Using O(1) time to check whether an integer n is a po 阅读全文
posted @ 2016-07-23 02:59 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va 阅读全文
posted @ 2016-07-22 10:59 北叶青藤 阅读(170) 评论(0) 推荐(0)
摘要:The structure of Expression Tree is a binary tree to evaluate certain expressions.All leaves of the Expression Tree have an number string value. All n 阅读全文
posted @ 2016-07-22 07:53 北叶青藤 阅读(452) 评论(0) 推荐(0)
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2016-07-21 23:00 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Given a (decimal - e.g. 3.72) number that is passed in as a string, return the binary representation that is passed in as a string. If the fractional 阅读全文
posted @ 2016-07-21 13:29 北叶青藤 阅读(288) 评论(0) 推荐(0)
摘要:Given a directed graph, design an algorithm to find out whether there is a route between two nodes. Have you met this question in a real interview? Ye 阅读全文
posted @ 2016-07-20 04:16 北叶青藤 阅读(220) 评论(0) 推荐(0)
摘要:Spiral Matrix I Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. Example Given n = 3, You should retur 阅读全文
posted @ 2016-07-18 11:44 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Find Minimum in Rotated Sorted Array I Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 阅读全文
posted @ 2016-07-17 22:15 北叶青藤 阅读(181) 评论(0) 推荐(0)
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2016-07-17 20:10 北叶青藤 阅读(179) 评论(0) 推荐(0)
摘要:Given an absolute path for a file (Unix-style), simplify it. Have you met this question in a real interview? Yes Example "/home/", => "/home" "/a/./b/ 阅读全文
posted @ 2016-07-17 01:02 北叶青藤 阅读(218) 评论(0) 推荐(0)
摘要:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
posted @ 2016-07-16 11:21 北叶青藤 阅读(199) 评论(0) 推荐(0)
摘要:Print numbers from 1 to the largest number with N digits by recursion. Notice It's pretty easy to do recursion like: recursion(i) { if i > largest num 阅读全文
posted @ 2016-07-16 01:37 北叶青藤 阅读(240) 评论(0) 推荐(0)
摘要:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Have you met this question in a real interview? Yes Exam 阅读全文
posted @ 2016-07-15 23:22 北叶青藤 阅读(187) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 下一页