Question: Please help complete the following code for lines 24-28 Braces You are designing a compiler for a C++program and need to check that braces in
Please help complete the following code for lines 24-28





Braces You are designing a compiler for a C++program and need to check that braces in any given file are balanced Braces in a string are considered to be balanced if the following criteria are met All braces must be closed. Braces come in pairs of the form 0.0 and . The left brace opens the pair, and the right one closes it In any set of nested braces, the braces between any pair must be closed For example, K)l is a valid grouping of braces but[X) is not Function Description Complete the function braces in the editor below. The function must return an array of strings where the string at each index i denotes whether or not the braces were balanced in a values, The array should consist of strings "YES" or "NO" aligned with their indexes in values. below The function must returm-as "or NO' aligned with thein braces has the following parameter(s): values(valueso.valuesn-1: an array of strings to analyze Constraints .1sns 15 1 s length of values,s 100 It is guaranteed that each values, consists of (,).. and Jonly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
