Category: c / c++
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in …
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: Output: 3 Explanation: The first two digits or the last three digits …
Find the sum of all left leaves in a given binary tree. There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24. …
Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of …
Question: Write a function to compute the number of bits required to convert a integer to another. For example, Input 29 (or 11101), 15 (or 01111) the output is …