Skip to content

Conversation

@michaelkamau
Copy link
Member

@michaelkamau michaelkamau commented Sep 6, 2018

Solution Number: 20

Checklist:

  • Created binary in src/bin
  • Written Documentation
  • Written Tests

What

https://projecteuler.net/problem=20

closes #20

How

  1. Computes the the factorial of 100. Since the result is a huge number, this solution makes use of the num-bigint crate to store the big numbers.
  2. Convert the result to a String and iterate through the characters, converting each to a number. Sum all the values in the iterator.

src/bin/20.rs Outdated
extern crate num_traits;

use num_bigint::BigUint;
use num_traits::FromPrimitive;
Copy link
Contributor

@mattgathu mattgathu Sep 13, 2018

Choose a reason for hiding this comment

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

@michaelkamau FromPrimitive is unused. Maybe remove? Otherwise 🏅 🏅

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the CI to deny warnings. Hopefully it will make it easier to catch this in future.

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.

Factorial digit sum

2 participants