Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. fn main() {
  2. let input = [-1, -1, -1, 0, 0, 0, 1, 1, 1];
  3.  
  4. let mut neg_one_locations = Vec::new();
  5. let mut zero_locations = Vec::new();
  6. let mut pos_one_locations = Vec::new();
  7.  
  8. for i in input.iter() {
  9. match input[i] {
  10. -1 => neg_one_locations.push(i),
  11. 0 => zero_locations.push(i),
  12. 1 => pos_one_locations.push(i),
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement