【Leetcode】整数反转

 

题解参考:https://leetcode-cn.com/problems/reverse-integer/solution/zheng-shu-fan-zhuan-by-leetcode/code

 

 

复杂度分析blog

时间复杂度:O(log(x)),x中大约有 log10(x) 位数字。
空间复杂度:O(1)。leetcode

 

本题知识点:io

1)检查反转后的数据是否溢出;im

2)除法 / 和求余 % 的区别;数据

3)除法和求余带“负号”运算,其结果的正负号取值;db

相关文章
相关标签/搜索