There were 20 green eyed people and they will commit suicide on 20th day altogether. See, There is atleast one green-eyed man. So let's take the case if there was only one gree-eyed man. than that man could've seen the colour of all other blued-eyed people and commit suicide on the very first day. if there were two of them, then these two guys can see each other as green-eyed guy, they wait for a day , on the second day they realize that there must be one more green-wyed guy other than than that guy . so it goes like that , and using same iteration we can see if there are n green-eyed people , they will all commit suicide altogether on n-th day.
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.