SHARE
TWEET

Untitled

a guest Jul 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top