Skip to content

LeetCode第七题Reverse-Integer #266

Open
@certram

Description

@certram

题目明确指出不能用64位存储了,leetcode官方给出的代码返回值应该是int32才对。我了解到int类型是根据你的操作系统的位数决定的,而且按照作者您写的代码,if条件判断的时候是已经超出了不要,才返回0。而用int32,根本不能超出,否则会溢出,变随机数了。参考leetcode官方题解。用了math.Min32/10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions