Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut papers = vec![4, 3, 0, 1, 5];
- papers.retain(|h| *h > 0);
- dbg!(&papers);
- let mut h_indices = Vec::new();
- for o_citations in &papers {
- let mut h = 0;
- for citation in &papers {
- if citation >= o_citations {
- h += 1;
- }
- }
- indices.push(h);
- }
- dbg!(indices);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement