Counting Special Positions in Binary Matrix

#day327 of #1001daysofcode problem statement (1582): Special Positions in a Binary Matrix -First counted the number of 1s in each row and column, then identified positions where both counts were exactly one. -Brute force tc=O(m*n*(m+n)), sc=O(1) -Reduced repeated checks and brought the solution down to O(m × n) but it costs some space. sc=O(m+n) #1001DaysOfCode #DSA #Java #LeetCode #ProblemSolving Shivam Mahajan #leetcode

  • text

To view or add a comment, sign in

Explore content categories