Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. ///
  2. /// let input = [0, 1, 2, 3];
  3. /// let expected_output = [3, 2, 1, 0];
  4. /// assert_eq!(&reverse(&input), &expected_output)
  5. ///
  6. fn reverse(forward: &[u8]) -> Vec<u8> {
  7. forward.iter().cloned().rev().collect()
  8. }
  9.  
  10. fn main () {
  11. let input = [0, 1, 2, 3];
  12. let expected_output = [3, 2, 1, 0];
  13. assert_eq!(&reverse(&input), &expected_output)
  14. }
Add Comment
Please, Sign In to add comment