Restaurant

Problem at https://www.hackerrank.com/challenges/restaurant/problem Martha is interviewing at Subway. One of the rounds of the interview requires her to cut a bread of size  into smaller identical pieces such that each piece is a square having maximum possible side length with no left over piece of bread. Input Format The first line contains an integer .  lines follow. EachContinue reading “Restaurant”

Balanced Brackets

A bracket is considered to be any one of the following characters: (, ), {, }, [, or ]. Two brackets are considered to be a matched pair if the an opening bracket (i.e., (, [, or {) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched pairs of brackets: [], {}, and (). A matching pair ofContinue reading “Balanced Brackets”

Design a site like this with WordPress.com
Get started