摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to count the total strobog 阅读全文
posted @ 2017-12-18 13:09 逸朵 阅读(311) 评论(0) 推荐(0)
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are o 阅读全文
posted @ 2017-12-18 12:57 逸朵 阅读(227) 评论(0) 推荐(0)
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number i 阅读全文
posted @ 2017-12-18 12:21 逸朵 阅读(239) 评论(0) 推荐(0)
摘要: This is a follow up of Shortest Word Distance. The only difference is now you are given the list of words and your method will be called repeatedly ma 阅读全文
posted @ 2017-12-18 10:37 逸朵 阅读(335) 评论(0) 推荐(0)
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example,Assume that words = 阅读全文
posted @ 2017-12-18 10:33 逸朵 阅读(219) 评论(0) 推荐(0)
摘要: Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For example, given [0, 阅读全文
posted @ 2017-12-18 10:11 逸朵 阅读(128) 评论(0) 推荐(0)
摘要: Given two strings S and T, determine if they are both one edit distance apart. 阅读全文
posted @ 2017-12-18 09:45 逸朵 阅读(190) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For example, Given s = “eceba”, T is "ece" whi 阅读全文
posted @ 2017-12-18 08:21 逸朵 阅读(127) 评论(0) 推荐(0)
摘要: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2017-12-18 07:54 逸朵 阅读(180) 评论(0) 推荐(0)
摘要: The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2017-12-18 07:41 逸朵 阅读(155) 评论(0) 推荐(0)
摘要: Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2017-12-18 06:56 逸朵 阅读(233) 评论(0) 推荐(0)
摘要: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-empty word 阅读全文
posted @ 2017-12-18 04:05 逸朵 阅读(502) 评论(0) 推荐(0)
摘要: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2017-12-18 02:15 逸朵 阅读(238) 评论(0) 推荐(0)
摘要: Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: 阅读全文
posted @ 2017-12-18 01:28 逸朵 阅读(266) 评论(0) 推荐(0)