[letcode] 832 Flipping an Image

vector<vector<int>> flipAndInvertImage(vector<vector<int>>& A) {
        for (auto & row : A) reverse(row.begin(), row.end());
        for (auto & row : A) for (int & i: row) i^=1;
        return A;
}

 

posted @ 2018-05-16 00:00  Mr.Struggle  阅读(132)  评论(0编辑  收藏  举报