Skip to content

Commit d7fb25b

Browse files
📝 Add docstrings to auto-fix-missing-headers-20260408
Docstrings generation was requested by @tkzzzzzz6. The following files were modified: * `hello.cpp` * `leetcode/Study Plan/3432. 统计元素和差值为偶数的分区方案/1.cpp`
1 parent e6da64e commit d7fb25b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

  • leetcode/Study Plan/3432. 统计元素和差值为偶数的分区方案

hello.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#include <iostream>
22
using namespace std;
33

4+
/**
5+
* @brief Writes a fixed greeting to standard output and exits.
6+
*
7+
* Prints the string "Hello, Algorithm_beginner_learning_notes!" followed by a newline to stdout.
8+
*
9+
* @return int `0` on successful program termination.
10+
*/
411
int main() {
512
cout << "Hello, Algorithm_beginner_learning_notes!" << endl;
613
return 0;

leetcode/Study Plan/3432. 统计元素和差值为偶数的分区方案/1.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#include <numeric>
33
class Solution {
44
public:
5+
/**
6+
* @brief Compute a partition-count value determined by whether the sum of `nums` is odd or even.
7+
*
8+
* @param nums Input vector of integers whose elements are summed.
9+
* @return int `0` if the total sum of `nums` is odd; otherwise `nums.size() - 1` (which is `-1` for an empty vector).
10+
*/
511
int countPartitions(vector<int>& nums) {
612
int sum = reduce(nums.begin(),nums.end());
713
return sum % 2 ? 0 : nums.size() - 1;

0 commit comments

Comments
 (0)