We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 150fc37 commit bcc6c47Copy full SHA for bcc6c47
src/days/day10.rs
@@ -60,19 +60,15 @@ fn part_2(input: &Vec<Vec<char>>) -> usize {
60
'[' => stack.push(']'),
61
'{' => stack.push('}'),
62
'<' => stack.push('>'),
63
- x if *x == stack[stack.len() - 1] => {
+ x if x == stack.last().unwrap() => {
64
stack.pop();
65
}
66
_ => {
67
return Vec::new();
68
69
70
71
- if stack.is_empty(){
72
- Vec::new()
73
- } else {
74
- stack
75
- }
+ stack
76
})
77
.filter(|completion| !completion.is_empty())
78
.map(|completion| {
0 commit comments