Hi guys,
i have been having some problems parsing a list of strings.
lets say i have a list that has the following strings
List<String> list = new ArrayList<String>();
list.add("Process A Started");
list.add("Process B Started");
list.add("Process B Finished");
list.add("Process A Started");
list.add("Process C Started");
list.add("Process D Started");
list.add("Process C Finished");
list.add("Process A Finished");
list.add("Process B Started");
list.add("Process D Finished");
list.add("Process A Started");
...
what i need is to come up with the logic that would check whether the process A/B/C/D.. has started and has it finished. if it started and not finished that means it failed. The following would be the logic required:
- If process started it has to finish
- Process can not start again if it already started.
- if a process started other process can run and finish before the specific process finished
please help me on sorting this out, suggestions, pseudo codes actual code :) or any other help would be appreciated.
Thanks You.