摘要: 题目: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others a 阅读全文
posted @ 2019-04-21 23:24 silentteller 阅读(278) 评论(0) 推荐(0)
摘要: 题目: Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: 分析: 给定一个数组,返回其中三个元素乘积的最大 阅读全文
posted @ 2019-04-21 00:55 silentteller 阅读(325) 评论(0) 推荐(0)
摘要: 题目: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 分析: 题目很好理解,就是求二叉树每一层的 阅读全文
posted @ 2019-04-21 00:12 silentteller 阅读(227) 评论(0) 推荐(0)
摘要: 题目: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontall 阅读全文
posted @ 2019-04-21 00:01 silentteller 阅读(301) 评论(0) 推荐(0)
摘要: 题目: Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 分析: 给定一个7进制数,求十进 阅读全文
posted @ 2019-04-18 00:09 silentteller 阅读(231) 评论(0) 推荐(0)
摘要: 题目: You are given a string representing an attendance record for a student. The record only contains the following three characters: A student could b 阅读全文
posted @ 2019-04-18 00:00 silentteller 阅读(240) 评论(0) 推荐(0)
摘要: 题目: Given an integer array nums, find the sum of the elements between indices iand j (i ≤ j), inclusive. Example: Note: 分析: 题目的意思很简单,给定一个数组,使用sumRange 阅读全文
posted @ 2019-04-17 00:31 silentteller 阅读(224) 评论(0) 推荐(0)
摘要: 题目: Print a binary tree in an m*n 2D string array following these rules: Example 1: Example 2: Example 3: Note: The height of binary tree is in the ra 阅读全文
posted @ 2019-04-16 23:59 silentteller 阅读(499) 评论(0) 推荐(0)
摘要: 题目: Given an array of 2n integers, your task is to group these integers into npairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum 阅读全文
posted @ 2019-04-15 00:19 silentteller 阅读(173) 评论(0) 推荐(0)
摘要: 题目: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original d 阅读全文
posted @ 2019-04-14 23:27 silentteller 阅读(209) 评论(0) 推荐(0)