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/lc1512/code.rs from Gax-c/VeriContest_Lite: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1512/code.rs
- Command line
-
hf download hf://datasets/Gax-c/VeriContest_Lite/leetcode/lc1512/code.rs
-
curl -L -o code.rs https://huggingface.co/datasets/Gax-c/VeriContest_Lite/resolve/main/leetcode/lc1512/code.rs
442 Bytes
| impl Solution { | |
| pub fn num_identical_pairs(nums: Vec<i32>) -> i32 { | |
| let n = nums.len(); | |
| let mut count: i64 = 0; | |
| let mut i: usize = 0; | |
| while i < n { | |
| let mut j: usize = i + 1; | |
| while j < n { | |
| if nums[i] == nums[j] { | |
| count = count + 1; | |
| } | |
| j += 1; | |
| } | |
| i += 1; | |
| } | |
| count as i32 | |
| } | |
| } | |