Skip to content

Conversation

@MeloveGupta
Copy link

This PR adds the implementation of the Running Sum of 1D Array problem in Python.
The algorithm computes a running (prefix) sum where each element at index i is the sum of all previous elements up to that index.

Key Details:

Algorithm Used: Prefix Sum

Time Complexity: O(n)

Space Complexity: O(n)

Approach:

Initialize an array ans of the same size as nums.

Set the first element of ans equal to nums[0].

Iterate from the second element onward, updating ans[i] = ans[i-1] + nums[i].

Return the resulting list as the running sum.

Files Added:

running_sum_1d_array.py → Main implementation with docstrings and inline examples.

@github-actions
Copy link

🎉 Welcome to Hacktoberfest 2025, @MeloveGupta! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Failed
  • 🧪 Compilation Tests: Failed

📋 Next Steps

⚠️ Action needed: Please fix the compilation errors and push your changes.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link

🤖 Automated PR Status

🔍 Code Validation

Failed - Please check file naming conventions and directory structure.

🧪 Compilation Tests

Failed - Please fix compilation errors and try again.

📋 Overall Status

⚠️ Needs Work - Please address the issues above.
💡 Push new commits to automatically re-run these checks.


This comment was generated automatically. Checks will re-run when you push new commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant