摘要: Given an integer, convert it to a roman numeral. The number is guaranteed to be within the range from 1 to 3999. 4 -> IV 12 -> XII 21 -> XXI 99 -> XCI 阅读全文
posted @ 2016-03-22 17:22 哥布林工程师 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Implement a trie with insert, search, and startsWith methods. 阅读全文
posted @ 2016-03-22 16:55 哥布林工程师 阅读(158) 评论(0) 推荐(0) 编辑
摘要: As the title described, you should only use two stacks to implement a queue's actions. The queue should support push(element), pop()and top() where po 阅读全文
posted @ 2016-03-22 13:21 哥布林工程师 阅读(124) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2016-03-22 13:16 哥布林工程师 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given an integer array, heapify it into a min-heap array. Given [3,2,1,4,5], return [1,2,3,4,5] or any legal heap array. 阅读全文
posted @ 2016-03-22 13:07 哥布林工程师 阅读(170) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
posted @ 2016-03-22 12:02 哥布林工程师 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list ofundirected edges (each edge is a pair of nodes), write a function to check whether these edges make 阅读全文
posted @ 2016-03-22 11:44 哥布林工程师 阅读(155) 评论(0) 推荐(0) 编辑