摘要:
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O 阅读全文
2018年10月20日
2018年10月19日
摘要:
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: 阅读全文
摘要:
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
2018年10月18日
摘要:
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
摘要:
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
2018年10月14日
摘要:
Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and o 阅读全文
2018年10月13日
摘要:
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 data. 阅读全文
摘要:
Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the numbe 阅读全文
2018年10月12日
摘要:
Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
摘要:
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文