We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d20e460 commit 24d99a8Copy full SHA for 24d99a8
1 file changed
src/alfred/data_structure/cartesian.hpp
@@ -16,8 +16,7 @@ std::vector<std::pair<int, int>> cartesian(std::vector<T> a, Comp comp) {
16
lst = stk.back(), stk.pop_back();
17
}
18
if (!stk.empty()) ans[stk.back()].second = i;
19
- if (lst != -1) ans[i].first = lst;
20
- stk.push_back(i);
+ ans[i].first = lst, stk.push_back(i);
21
22
return ans;
23
0 commit comments