fn arrangements(ns: &Vec<u32>, n: u32, i_next: usize) -> u32 {
if i_next >= ns.len() {
return 1;
}
let mut arr = 0;
for i in i_next..i_next+3 {
if i < ns.len() && ns[i] - n <= 3 {
assert!(i+1 > i_next);
arr += arrangements(ns, ns[i], i+1);
}
}
arr
}
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
97 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
98 102
99 102
100 102
101 102
102 102
94 102
95 102
96 102
97 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
97 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
98 102
99 102
100 102
101 102
102 102
93 102
94 102
95 102
96 102
97 102
98 102
99 102
100 102
101 102
102 102
99 102
100 102
101 102
102 102
98 102
;