上一页 1 2 3 4 5 6 7 8 9 ··· 37 下一页
摘要: International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a"maps to ".-", "b" maps 阅读全文
posted @ 2018-06-07 09:29 immjc 阅读(124) 评论(0) 推荐(0) 编辑
摘要: A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com 阅读全文
posted @ 2018-06-07 09:15 immjc 阅读(162) 评论(0) 推荐(0) 编辑
摘要: We are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1. Return the same tree where every subtree 阅读全文
posted @ 2018-06-06 15:49 immjc 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means t 阅读全文
posted @ 2018-06-06 15:32 immjc 阅读(102) 评论(0) 推荐(0) 编辑
摘要: In a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any n 阅读全文
posted @ 2018-06-06 15:18 immjc 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2018-06-06 11:50 immjc 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2018-06-06 11:35 immjc 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 小Q正在给一条长度为n的道路设计路灯安置方案。 为了让问题更简单,小Q把道路视为n个方格,需要照亮的地方用'.'表示, 不需要照亮的障碍物格子用'X'表示。 小Q现在要在道路上设置一些路灯, 对于安置在pos位置的路灯, 这盏路灯可以照亮pos - 1, pos, pos + 1这三个位置。 小Q希 阅读全文
posted @ 2018-06-05 11:53 immjc 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 小Q得到一个神奇的数列: 1, 12, 123,...12345678910,1234567891011...。 并且小Q对于能否被3整除这个性质很感兴趣。 小Q现在希望你能帮他计算一下从数列的第l个到第r个(包含端点)有多少个数可以被3整除。 遍历从a到b。如果该值可以除3余1,说明该数不能被整除 阅读全文
posted @ 2018-06-05 11:42 immjc 阅读(151) 评论(0) 推荐(0) 编辑
摘要: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2018-06-04 12:09 immjc 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 37 下一页