摘要:
题目: 小明同学学习了不同的进制之后,拿起了一些数字做起了游戏。小明同学知道,在日常生活中我们最常用的是十进制数,而在计算机中,二进制数也很常用。现在对于一个数字x,小明同学定义出了两个函数f(x)和g(x)。 f(x)表示把x这个数用十进制写出后各个数位上的数字之和。如f(123)=1+2+3=6 阅读全文
摘要:
题目: 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的: “水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+3^3。 现在要求输出所有在m和n范围内的水仙花数。输入描述:输入数据有多组,每组占一行,包括两个整数m和n(100 阅读全文
摘要:
题目描述: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others 阅读全文
摘要:
题目描述: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot * makes a circle, which means it moves back t 阅读全文
摘要:
题目描述: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 思路: 判断一个链表是否有环。 * 同个时间Faster走的比Slo 阅读全文