Skip to content

Instantly share code, notes, and snippets.

View MiyaPapaya's full-sized avatar

Miya MiyaPapaya

  • San Francisco CA
View GitHub Profile
@MiyaPapaya
MiyaPapaya / balanced_braces.rb
Last active January 2, 2016 03:49
Balanced Braces: Given a string of opening and closing parentheses, check whether it’s balanced. We have 3 types of parentheses: round brackets: (), square brackets: [], and curly brackets: {}. Assume that the string doesn’t contain any other character than these, no spaces words or numbers. Just to remind, balanced parentheses require every ope…
def check_braces(expressions)
individuals = []
test_set = []
expressions.each do |string|
string.chars.each do |brace|
if brace == '(' || brace == '[' || brace == '{'
individuals << brace
elsif brace == ')' || brace == ']' || brace == '}'
test_set << individuals.pop
@MiyaPapaya
MiyaPapaya / index.html
Last active December 27, 2015 06:49 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>