__________________________________________________________________________________________________
//runtime: 0ms, memory: 2.1MB

impl Solution {
    pub fn reverse(x: i32) -> i32 {
        let mut temp = x;
        let mut s: i32 = 0;
        while temp != 0 {
            match s.checked_mul(10) {
                None => return 0,
                Some(tem) => match tem.checked_add(temp % 10) {
                    None => return 0,
                    Some(tem1) => s = tem1,
                }
            }
            temp /= 10;
        }
        s
    }
}
__________________________________________________________________________________________________

__________________________________________________________________________________________________
