Verizon interview question

Valid parenthesis and finding nth smallest/largest values in an array,