in SAMM example at the end stack has 0,3 . this means both are faulty there is no closing for both
On Tue, Dec 20, 2011 at 10:53 PM, shady <sinv...@gmail.com> wrote: > ( ( ) ( ( ) ( ( ) ) ( ) for this SAMM faulty index is 0, because the > first bracket has itself found no matching.... > > @atul > ( ( ( () ) ) for this first bracket is faulty as it couldn't find a > closing bracket, , , > you can keep a stack with map as element > stack< map<int, char> > > > map<int, char> where integer is the index of the bracket, which is stored > as char > idea is similar to don's. > > > On Tue, Dec 20, 2011 at 10:42 PM, atul anand <atul.87fri...@gmail.com>wrote: > >> there are multiple mismatch or only one mis-match in the input string. >> >> if the given string as below :- >> >> ( ( ( () ) ) -> for this is missing match is for 1st , 2nd or 3rd >> bracket. >> >> what would be the answer for this. >> >> On Tue, Dec 20, 2011 at 8:10 PM, zeroByZero <shri.nit...@gmail.com>wrote: >> >>> In a given string arrary arr[] = "((()())" or any other string return >>> index for which no match is found as for this example is index 0 and >>> for "()()()(()" is index 6 >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.