[LeetCode C++实现]1030. Matrix Cells in Distance Order
leetcode 1030
学习c++ sort的基本用法之后,这道题还是比较easy.
Beginners guide to the std::sort() function
解法一:
class Solution {
public:
vector<vector<int>> allCellsDistOrder(int R, int C, int r0, int c0) {
vector<vector<int>> res(R*C,vector<int>(3));
int num=0;
for(int i=0;i<......