摘要: Problem: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process 阅读全文
posted @ 2016-10-23 02:04 SillyVicky 阅读(154) 评论(0) 推荐(0)
摘要: Problem: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 阅读全文
posted @ 2016-10-23 02:01 SillyVicky 阅读(152) 评论(0) 推荐(0)
摘要: Problem: Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear runtime com 阅读全文
posted @ 2016-10-23 02:00 SillyVicky 阅读(170) 评论(0) 推荐(0)
摘要: Problem: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Summary: 不使用+和-符号,计算两个整型数之和。 Analysis: XOR相当于 阅读全文
posted @ 2016-10-23 01:59 SillyVicky 阅读(133) 评论(0) 推荐(0)
摘要: Problem: 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 f 阅读全文
posted @ 2016-10-23 01:57 SillyVicky 阅读(168) 评论(0) 推荐(0)