- Keep an counter for first stuck number(0/1)
   - increment it, if you stuck on other number, start decrementing  it
   - if the counter becomes zero,note that seq
   - finally take the longest seq

Hope this could solve the problem.

On Sat, Aug 13, 2011 at 1:56 PM, vicky S <[email protected]> wrote:

> Given a string which oly has 0's and 1's . Find the maximum largest
> substring which have equal no of 0's and 1's and give the length of the
> substring .
> whether it can be solved in DP ?? or any other soln ?
> for example :
> given string : 0010000101000
> output :0101
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Thanks and Regards,
Raghavan KL

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to