mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-04-24 14:29:38 +00:00
[PR #1485] Add O(1) optimized solution for Project Euler Problem 6 #hacktoberfest #2087
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/1485
State: closed
Merged: No
Description
This PR adds an O(1) optimized solution for Project Euler Problem 6 in C.
It uses the mathematical formulas:
Changes
o(1)sol.cinproject_euler/problem_6/Example
Input:
100
Output:
25164150
Notes
long longto avoid overflow for larger values ofnThank you for reviewing this contribution 🚀