07 2017 档案

摘要:"Island Perimeter" Diffculty Easy tags You are given a map in form of a two dimensional integer grid where 1 represents land and 0 represents water. G 阅读全文
posted @ 2017-07-29 16:58 whensean 阅读(100) 评论(0) 推荐(0)
摘要:"Set Mismatch" Difficulty Easy tags The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in 阅读全文
posted @ 2017-07-23 17:34 whensean 阅读(117) 评论(0) 推荐(0)
摘要:"Palindromic Substrings" Difficulty Medium tags iven a string, your task is to count how many palindromic substrings in this string. The substrings wi 阅读全文
posted @ 2017-07-23 17:24 whensean 阅读(99) 评论(0) 推荐(0)
摘要:"Maximum Length of Pair Chain" Difficulty Medium tags You are given n pairs of numbers. In every pair, the first number is always smaller than the sec 阅读全文
posted @ 2017-07-23 17:08 whensean 阅读(442) 评论(0) 推荐(0)
摘要:"Longest Palindrome" Difficulty Easy tags Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes 阅读全文
posted @ 2017-07-21 22:24 whensean 阅读(99) 评论(0) 推荐(0)
摘要:"Nth Digit" Difficulty Easy tags Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note: n is positive and wi 阅读全文
posted @ 2017-07-20 13:38 whensean 阅读(83) 评论(0) 推荐(0)
摘要:"Game of Life" Difficulty Medium tags According to the "Wikipedia's article" : "The Game of Life , also known simply as Life , is a cellular automaton 阅读全文
posted @ 2017-07-19 10:56 whensean 阅读(124) 评论(0) 推荐(0)
摘要:"Closest Binary Search Tree Value" Difficulty Easy tags Given a non empty binary search tree and a target value, find the value in the BST that is clo 阅读全文
posted @ 2017-07-19 10:55 whensean 阅读(184) 评论(0) 推荐(0)
摘要:"UTF 8 Validation" Difficulty Medium tags A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: 1. For 1 byte character 阅读全文
posted @ 2017-07-18 11:29 whensean 阅读(165) 评论(0) 推荐(0)
摘要:"Binary Watch" Difficulty Easy tags A binary watch has 4 LEDs on the top which represent the hours (0 11) , and the 6 LEDs on the bottom represent the 阅读全文
posted @ 2017-07-18 11:26 whensean 阅读(112) 评论(0) 推荐(0)
摘要:"Find the Difference" Difficulty Easy tags Given two strings s and t which consist of only lowercase letters. String t is generated by random shufflin 阅读全文
posted @ 2017-07-17 21:53 whensean 阅读(88) 评论(0) 推荐(0)
摘要:"3Sum Smaller" Difficulty Medium tags `sum problem` Given an array of n integers nums and a target, find the number of index triplets with `0 = target 阅读全文
posted @ 2017-07-17 21:51 whensean 阅读(114) 评论(0) 推荐(0)
摘要:"Number of Islands" Difficulty Medium tags Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded b 阅读全文
posted @ 2017-07-16 15:32 whensean 阅读(116) 评论(0) 推荐(0)
摘要:"Paint Fence" Difficulty Easy tags 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 s 阅读全文
posted @ 2017-07-16 15:25 whensean 阅读(103) 评论(0) 推荐(0)
摘要:"Wiggle Sort" Difficulty Medium tags `array` Given an unsorted array nums, reorder it in place such that `nums[0] = nums[2] &nums, int lo, int hi) { i 阅读全文
posted @ 2017-07-15 12:40 whensean 阅读(158) 评论(0) 推荐(0)
摘要:"Logger Rate Limiter" Difficulty Easy tags Design a logger system that receive stream of messages along with its timestamps, each message should be pr 阅读全文
posted @ 2017-07-15 12:39 whensean 阅读(154) 评论(0) 推荐(0)
摘要:"Flip Game" Difficulty Easy tags You are playing the following Flip Game with your friend: Given a string that contains only these two characters: and 阅读全文
posted @ 2017-07-14 15:22 whensean 阅读(92) 评论(0) 推荐(0)
摘要:Number of Islands II Difficulty Hard tags union find A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand o 阅读全文
posted @ 2017-07-14 14:56 whensean 阅读(81) 评论(0) 推荐(0)
摘要:Counting Bits Difficulty Medium tags bit mask Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the numb 阅读全文
posted @ 2017-07-13 16:27 whensean 阅读(108) 评论(0) 推荐(0)
摘要:"Android Unlock Patterns" Difficulty Medium tags `bit mask` Given an Android 3x3 key lock screen and two integers m and n , where 1 ≤ m ≤ n ≤ 9, count 阅读全文
posted @ 2017-07-13 16:26 whensean 阅读(174) 评论(0) 推荐(0)
摘要:"Reverse Vowels of a String" Difficulty Easy tags Write a function that takes a string as input and reverse only the vowels of a string. Example 1 : G 阅读全文
posted @ 2017-07-12 10:46 whensean 阅读(165) 评论(0) 推荐(0)
摘要:"Encode and Decode Strings" Difficulty Medium tags `encode` Design an algorithm to encode a list of strings to a string . The encoded string is then s 阅读全文
posted @ 2017-07-12 10:45 whensean 阅读(111) 评论(0) 推荐(0)
摘要:"Strobogrammatic Number" Difficulty Easy tags A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down 阅读全文
posted @ 2017-07-11 21:04 whensean 阅读(151) 评论(0) 推荐(0)
摘要:Unique Word Abbreviation Difficulty Medium tags string An abbreviation of a word follows the form . Below are some examples of word abbreviations: a) 阅读全文
posted @ 2017-07-11 20:59 whensean 阅读(172) 评论(0) 推荐(0)
摘要:"Plus One" Difficulty Easy tags `array` Given a non negative integer represented as a non empty array of digits, plus one to the integer. You may assu 阅读全文
posted @ 2017-07-07 14:06 whensean 阅读(115) 评论(0) 推荐(0)
摘要:"Bomb Enemy" Difficulty Medium tags Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum e 阅读全文
posted @ 2017-07-07 11:44 whensean 阅读(146) 评论(0) 推荐(0)
摘要:三个版本的二分搜索 阅读全文
posted @ 2017-07-05 14:46 whensean 阅读(416) 评论(0) 推荐(0)
摘要:"Zigzag Iterator" Difficulty Medium tags Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d v 阅读全文
posted @ 2017-07-05 10:30 whensean 阅读(109) 评论(0) 推荐(0)