Skip to content

Instantly share code, notes, and snippets.

View rafaelrcamargo's full-sized avatar
🦀
Borrow checking

rafael r. camargo rafaelrcamargo

🦀
Borrow checking
View GitHub Profile
pub fn is_balanced(s: &str) -> bool {
let mut stack = Vec::new();
for c in s.chars() {
match c {
'(' | '[' | '{' => stack.push(c),
symbol @ (')' | ']' | '}') if stack.pop() != reverse(symbol) => return false,
_ => (),
}
}
@rafaelrcamargo
rafaelrcamargo / ANSI.md
Created September 30, 2023 03:29 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27