摘要: Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than  阅读全文
posted @ 2018-08-29 15:10 轻风舞动 阅读(1037) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 求两数相除,不能用乘法,除法和取余操作。 解法:位操作Bit Operati 阅读全文
posted @ 2018-08-29 05:25 轻风舞动 阅读(403) 评论(0) 推荐(0) 编辑
摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: 给一个字符串按照字符出现的频率来排序。 Java: Python: P 阅读全文
posted @ 2018-08-29 04:56 轻风舞动 阅读(809) 评论(0) 推荐(0) 编辑
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2018-08-29 04:49 轻风舞动 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. 阅读全文
posted @ 2018-08-29 04:20 轻风舞动 阅读(3234) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total 阅读全文
posted @ 2018-08-29 03:45 轻风舞动 阅读(332) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2018-08-29 03:16 轻风舞动 阅读(340) 评论(0) 推荐(0) 编辑
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping way: Beyond that, now the encoded string can also contai 阅读全文
posted @ 2018-08-29 03:04 轻风舞动 阅读(634) 评论(0) 推荐(0) 编辑