250702

lililllilillll·2025년 7월 2일

개발 일지

목록 보기
220/350

✅ What I did today


  • LeetCode


⚔️ LeetCode


7. Reverse Integer

    int reverse(int x) {
        int res = 0;
        if (numeric_limits<int>::min() == x) return 0;
        while(abs(x) > 0)
        {
            if (numeric_limits<int>::max() / 10 < res) return 0;
            if (numeric_limits<int>::min() / 10 > res) return 0;
            res *= 10;
            res += x % 10;
            x /= 10;
        }
        return res;
    }
profile
너 정말 **핵심**을 찔렀어

0개의 댓글