Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
competitive-programming
code-generation
specification-generation
proof-generation
verification
rust
License:
Download leetcode/lc1342/code.rs from Gax-c/VeriContest_Lite: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1342/code.rs
- Command line
-
hf download hf://datasets/Gax-c/VeriContest_Lite/leetcode/lc1342/code.rs
-
curl -L -o code.rs https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1342/code.rs
319 Bytes
| impl Solution { | |
| pub fn number_of_steps(num: i32) -> i32 { | |
| let mut n = num; | |
| let mut steps = 0i32; | |
| while n > 0 { | |
| if n % 2 == 0 { | |
| n = n / 2; | |
| } else { | |
| n = n - 1; | |
| } | |
| steps = steps + 1; | |
| } | |
| steps | |
| } | |
| } | |