ARTS 第 拾 期

Algorithm

class Solution {
public:
int minimumArea(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
int xmin = 1e9, xmax = -1, ymin = 1e9, ymax = -1;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (grid[i][j]) {
xmin = min(xmin, i);
xmax = max(xmax, i);
ymin = min(ymin, j);
ymax = max(ymax, j);
}
}
}
return (ymax - ymin + 1)*(xmax - xmin + 1);
}
};


Review

https://arxiv.org/pdf/2310.08710
Waymax, a multi-agent simulator for autonomous driving.

waymo 开发的用于自动驾驶的多代理模拟器。

Tip

➜  ~ git-clang-format --help
usage: git clang-format [OPTIONS] [<commit>] [<commit>|--staged] [--] [<file>...]

If zero or one commits are given, run clang-format on all lines that differ
between the working directory and <commit>, which defaults to HEAD.  Changes are
only applied to the working directory, or in the stage/index.

Examples:
To format staged changes, i.e everything that's been git added:
git clang-format

To also format everything touched in the most recent commit:

If you're on a branch off main, to format everything touched on your branch:
git clang-format main

If two commits are given (requires --diff), run clang-format on all lines in the
second <commit> that differ from the first <commit>.

The following git-config settings set the default of the corresponding option:
clangFormat.binary
clangFormat.commit
clangFormat.extensions
clangFormat.style

positional arguments:
<commit>              revision from which to compute the diff
<file>...             if specified, only consider differences in these files

options:
-h, --help            show this help message and exit
--binary BINARY       path to clang-format
--commit COMMIT       default commit to use if none is specified
--diff                print a diff instead of applying the changes
--diffstat            print a diffstat instead of applying the changes
--extensions EXTENSIONS
comma-separated list of file extensions to format,
excluding the period and case-insensitive
-f, --force           allow changes to unstaged files
-p, --patch           select hunks interactively
-q, --quiet           print less information
--staged, --cached    format lines in the stage instead of the working dir
--style STYLE         passed to clang-format
-v, --verbose         print extra information
--diff_from_common_commit
diff from the last common commit for commits in
separate branches rather than the exact point of the
commits

1.财务自由
2.健康自由
3.时间自由
4.关系自由