C++ 12ms wildness way using STL, 3 lines


  • 0
    L
    for (int i = 0; i < matrix.size(); i++)
        if (binary_search(matrix[i].begin(), matrix[i].end(), target))return true;
    return false;

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.