From fca121da33aba9b1b253bdff661f4e42c34b3ac9 Mon Sep 17 00:00:00 2001 From: Libin YANG Date: Sat, 5 Apr 2025 09:40:27 +0800 Subject: [PATCH 1/2] Update README.md --- solution/1800-1899/1863.Sum of All Subset XOR Totals/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/1800-1899/1863.Sum of All Subset XOR Totals/README.md b/solution/1800-1899/1863.Sum of All Subset XOR Totals/README.md index f22b4aa19c6d9..96eec9eb4ae9d 100644 --- a/solution/1800-1899/1863.Sum of All Subset XOR Totals/README.md +++ b/solution/1800-1899/1863.Sum of All Subset XOR Totals/README.md @@ -286,7 +286,7 @@ public: int subsetXORSum(vector& nums) { int n = nums.size(); int ans = 0; - function dfs = [&](int i, int s) { + auto dfs = [&](this auto&& dfs, int i, int s) { if (i >= n) { ans += s; return; From 73f782b1fb25c11dea02fe1e66e469dc9bc947a9 Mon Sep 17 00:00:00 2001 From: Libin YANG Date: Sat, 5 Apr 2025 09:41:28 +0800 Subject: [PATCH 2/2] Refactor dfs function to use auto --- .../1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md | 2 +- .../1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solution/1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md b/solution/1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md index bc3a6bf834e85..bbc8e7d1a9cb7 100644 --- a/solution/1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md +++ b/solution/1800-1899/1863.Sum of All Subset XOR Totals/README_EN.md @@ -287,7 +287,7 @@ public: int subsetXORSum(vector& nums) { int n = nums.size(); int ans = 0; - function dfs = [&](int i, int s) { + auto dfs = [&](this auto&& dfs, int i, int s) { if (i >= n) { ans += s; return; diff --git a/solution/1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp b/solution/1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp index 3f311df23a871..1c2c039239d82 100644 --- a/solution/1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp +++ b/solution/1800-1899/1863.Sum of All Subset XOR Totals/Solution2.cpp @@ -3,7 +3,7 @@ class Solution { int subsetXORSum(vector& nums) { int n = nums.size(); int ans = 0; - function dfs = [&](int i, int s) { + auto dfs = [&](this auto&& dfs, int i, int s) { if (i >= n) { ans += s; return;