摘要: 题目 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Out 阅读全文
posted @ 2018-10-15 10:59 shinjia 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a binary tree, return all root to leaf paths. Note: A leaf is a node with no children. Example: Input: 1 / \ 2 3 \ 5 Output: ["1 2 5", "1 3"] 阅读全文
posted @ 2018-10-15 10:14 shinjia 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Exam 阅读全文
posted @ 2018-10-15 09:00 shinjia 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a non negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The 阅读全文
posted @ 2018-10-15 08:40 shinjia 阅读(86) 评论(0) 推荐(0) 编辑