LintCode:快乐数
来源:互联网 发布:手机修改mac地址软件 编辑:程序博客网 时间:2024/05/29 18:38
LintCode:快乐数
Python代码
class Solution: # @param {int} n an integer # @return {boolean} true if this is a happy number or false n_list = [] def isHappy(self, n): # Write your code here if n==1: return True elif n in self.n_list: return False else: self.n_list.append(n) n1 = 0 for i in str(n): n1 += int(i)*int(i) return self.isHappy(n1)
0 0
- LintCode-简单-快乐数
- LintCode-快乐数
- LintCode:快乐数
- LintCode之快乐数
- lintcode,快乐数
- LintCode 快乐数
- lintcode--快乐数
- LintCode之快乐数
- lintcode:快乐数
- LintCode 488快乐数
- [Lintcode] #488 快乐数
- 快乐数-LintCode
- [LintCode 488] 快乐数 (Python)
- Lintcode快乐数问题解析
- lintcode python代码 488 快乐数
- 快乐数
- 快乐数
- 快乐数
- session和cookie的区别
- java基础--Class.forName()、Class.forName().newInstance() 、New 三者区别!
- 淘宝notify-消息中间件(1)
- Js解析多重Json
- jz2440(mini2440)led驱动测试过程(环境搭建d)
- LintCode:快乐数
- 范范(5)
- 常见操作系统知识整理
- 编译libfdk-aac 库,使用根目录下的android.mk直接包含所有子目录下的android.mk文件
- 如何编译UE4的NXGI引擎
- 利用WebBrowser控件实现百度自动搜索
- 详细了解SQLITE 优缺点 性能测试
- 数据条数过大时,分片采集
- iOS中ProtocolBuffer2.2的安装及google/protobuf/message.cc:130:60错误解决办法