随笔分类 - [LeetCode]
摘要:Problem:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Analysis:This problem actually requi...
阅读全文
摘要:Problem:Implement pow(x,n).Analysis:This problem inherently is very easy and simple.Don't try to treat a problem as difficult problem, even the myster...
阅读全文
摘要:Problem:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorte...
阅读全文
摘要:Problem:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums...
阅读全文
摘要:Problem:Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For exampl...
阅读全文
摘要:Problem:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is l...
阅读全文
摘要:Problem:Write a program to find then-th ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For example,1, 2, 3, 4,...
阅读全文
摘要:Problem:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. F...
阅读全文
摘要:Problem:Description:Count the number of prime numbers less than a non-negative number,n.Analysis:The idea to test if a number is prime.Reference:https...
阅读全文
摘要:Problem:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thank...
阅读全文
摘要:Problem:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 3...
阅读全文
摘要:Problem:Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word o...
阅读全文
摘要:Problem:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be...
阅读全文
摘要:Problem:Given two words (beginWordandendWord), and a dictionary, find the length of shortest transformation sequence frombeginWordtoendWord, such that...
阅读全文
摘要:Problem:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner a...
阅读全文
摘要:Problem:Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.Analysis:This...
阅读全文
摘要:Problem:Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequential...
阅读全文
摘要:Problem:There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have...
阅读全文
摘要:Problem:There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have...
阅读全文
摘要:Problem:Given an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two el...
阅读全文

浙公网安备 33010602011771号