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
阅读全文
摘要:"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
阅读全文
摘要:"Palindromic Substrings" Difficulty Medium tags iven a string, your task is to count how many palindromic substrings in this string. The substrings wi
阅读全文
摘要:"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
阅读全文
摘要:"Longest Palindrome" Difficulty Easy tags Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"Logger Rate Limiter" Difficulty Easy tags Design a logger system that receive stream of messages along with its timestamps, each message should be pr
阅读全文
摘要:"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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"Strobogrammatic Number" Difficulty Easy tags A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down
阅读全文
摘要:Unique Word Abbreviation Difficulty Medium tags string An abbreviation of a word follows the form . Below are some examples of word abbreviations: a)
阅读全文
摘要:"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
阅读全文
摘要:"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
阅读全文
摘要:"Zigzag Iterator" Difficulty Medium tags Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d v
阅读全文