Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 73f782b

Browse files
authoredApr 5, 2025··
Refactor dfs function to use auto
1 parent fca121d commit 73f782b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎solution/1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public:
287287
int subsetXORSum(vector<int>& nums) {
288288
int n = nums.size();
289289
int ans = 0;
290-
function<void(int, int)> dfs = [&](int i, int s) {
290+
auto dfs = [&](this auto&& dfs, int i, int s) {
291291
if (i >= n) {
292292
ans += s;
293293
return;

‎solution/1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Solution {
33
int subsetXORSum(vector<int>& nums) {
44
int n = nums.size();
55
int ans = 0;
6-
function<void(int, int)> dfs = [&](int i, int s) {
6+
auto dfs = [&](this auto&& dfs, int i, int s) {
77
if (i >= n) {
88
ans += s;
99
return;

0 commit comments

Comments
 (0)
Please sign in to comment.