MSpace Solutions interview question

Debug the python code to analyse the seperate obstacles in path.