I'm using polynomial O(n^2) runtime to find all 1s. However, this approach would suffer if my 2 dimensional grow real big. It's going to eat up time. What algorithm should be used and can you refactor the code?I'm using polynomial O(n^2) runtime to find all