Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

test #6

wants to merge 1 commit into from

Conversation

voodoozhang
Copy link

No description provided.

@@ -0,0 +1 @@
test No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the code review

  1. The code given is just a single line of code- "test". It doesn't seem to be a valid code.
  2. It looks like the code is trying to add something, but it's not clear what it is and how it works.
  3. It is possible that there could be bugs in this code if it is not properly tested, so testing should be done before deploying the code.
  4. To improve the code, it might be helpful to provide more context about what it is trying to do and how it works. This will make it easier for others to understand and review the code.

return 0;
}
};
//leetcode submit region end(Prohibit modification and deletion)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code review

  1. The class Solution should be public, and the function countSubarrays should be declared as public.
  2. The function find_1 and find_0 should have a return type of int.
  3. The code should use proper indentation and spacing.
  4. In the function countSubarrays, it should use a for loop to iterate the nums vector instead of using the map data structure.
  5. The for loops in the functions find_1 and find_0 should use the size()-1 instead of the size().
  6. The code should use descriptive variables names for better understanding.
  7. There should be a check for an empty array.
  8. The code should have comments describing the purpose of each line of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant