HTMLify
Home
Log in
Register
Dashboard
Frames
API
Q258_Add_Digits.rs
Views: 169 | Author:
djdj
impl
Solution
{
pub
fn
add_digits
(
num
:
i32
)
->
i32
{
if
(
num
==
0
){
return
0
;
}
return
(
num
-
1
)
%
9
+
1
;
}
}
Share this file:
Copy
Short Link
View Raw
Download File
(145 B)
Embed Code
Clone
Comments
Comment