관리 메뉴

솜씨좋은장씨

[leetCode] 2119. A Number After a Double Reversal (Python) 본문

Programming/코딩 1일 1문제

[leetCode] 2119. A Number After a Double Reversal (Python)

솜씨좋은장씨 2022. 2. 2. 02:02
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 leetCode의 2119번 A Number After a Double Reversal 입니다.

 

A Number After a Double Reversal - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

👨🏻‍💻 코드 ( Solution )

class Solution:
    def isSameAfterReversals(self, num: int) -> bool:
        answer = False
        
        reverse_num_01 = int(str(num)[::-1])
        reverse_num_02 = int(str(reverse_num_01)[::-1])
        
        if num == reverse_num_02:
            answer = True
            
        return answer

 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments