i have been trying to solve this problem lately.. http://www.spoj.com/problems/HERDING/ i am trying to find out the total no. of connected components for the given grid..but i am getting wrong answer for that.can someone tell me why am i getting wrong answer ??.and what would be the correct approach for it..
↧