iteratively count unqiue pahts in obstacle grid with bottom up