摘要:
You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
摘要:
We want to use quad trees to store an N x N boolean grid. Each cell in the grid can only be true or false. The root node represents the whole grid. Fo 阅读全文
摘要:
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 题目大意: 给定两个非负整数,用字符串表示。计算两个整数的和。 理 解: 涉及到大数 阅读全文
摘要:
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 complexi 阅读全文
摘要:
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 阅读全文
摘要:
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This 阅读全文
摘要:
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: Example 1: Example 2: 阅读全文
摘要:
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents 阅读全文
摘要:
Find the sum of all left leaves in a given binary tree. Example: 题目大意: 求所有左叶子节点的和。 理 解: 判断某个节点是否位左叶子节点:当前节点的左子节点非空,左子节点左右子树为空。 递归根节点的左右子树,累加所有左子节点的和。 阅读全文
摘要:
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi 阅读全文