Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. fn main() {
  2. let mut papers = vec![4, 3, 0, 1, 5];
  3.  
  4. papers.retain(|h| *h > 0);
  5.  
  6. dbg!(&papers);
  7.  
  8. let mut h_indices = Vec::new();
  9.  
  10. for o_citations in &papers {
  11. let mut h = 0;
  12.  
  13. for citation in &papers {
  14. if citation >= o_citations {
  15. h += 1;
  16. }
  17. }
  18.  
  19. indices.push(h);
  20. }
  21.  
  22. dbg!(indices);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement