MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / permute_add_basic

Function permute_add_basic

46. Permutations/src/main.rs:53–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52 #[test]
53 fn permute_add_basic() {
54 let mut input = vec![vec![]];
55 Solution::permute_add(&mut input, 1);
56 assert_eq!(
57 input,
58 vec![
59 vec![1],
60 ]
61 );
62 Solution::permute_add(&mut input, 2);
63 assert_eq!(
64 input,
65 vec![
66 vec![2,1],
67 vec![1,2],
68 ]
69 );
70 Solution::permute_add(&mut input, 3);
71 input.sort();
72 assert_eq!(
73 input,
74 vec![
75 vec![1,2,3],
76 vec![1,3,2],
77 vec![2,1,3],
78 vec![2,3,1],
79 vec![3,1,2],
80 vec![3,2,1]
81 ]
82 );
83 }
84}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected