摘要:
Description Description Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos w 阅读全文
摘要:
Description Description Given a 32-bit signed integer, reverse digits of an integer. Example Example 1: Input: 123 Output: 321 Example 2: Input: -123 阅读全文
摘要:
Description Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input w 阅读全文
摘要:
Description Description Given a string and an offset, rotate string by offset. (rotate from left to right) Example Given "abcdefg". offset=0 => "abcde 阅读全文
摘要:
Description Description Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serializa 阅读全文
摘要:
Description Description Merge two given sorted integer array A and B into a new sorted integer array. Example A=[1,2,3,4] B=[2,4,5,6] return [1,2,2,3, 阅读全文
摘要:
Description Description Find K-th largest element in an array. Example In array [9,3,2,4,8], the 3rd largest element is 4. In array [1,2,3,4,5], the 1 阅读全文
摘要:
Description Description Ugly number is a number that only havefactors 2, 3 and 5. Design an algorithm to find the nth ugly number. The first 10 ugly n 阅读全文
摘要:
Description Description Count the number of k's between 0 and n. k can be 0 - 9. Example if n = 12, k = 1 in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 阅读全文
摘要:
Description Description Write an algorithm which computes the number of trailing zeros in n factorial. Example 11! = 39916800, so the out should be 2 阅读全文