dwi
banner
dwipasca.bsky.social
dwi
@dwipasca.bsky.social
Software developer | Konoha citizen ✨
Solution with optimal solution:

- Search vertically for rows that have the potential to hold the target value using binary search
- check if the target is not in the matrix vertically then return false
- Look for the target in the line that has been found

time complexity:
O(log(m*n))
May 1, 2025 at 5:55 AM
Solution with brute force:

We can solve this problem by checking the values ​​one by one in the 2-dimensional matrix

time complexity:
O(n^2)
May 1, 2025 at 5:54 AM