Ad
Code
Diff
  • summ = lambda *x: sum(x)
    • summ = lambda *x : sum([i for i in x])
    • summ = lambda *x: sum(x)
Fundamentals
Games
Code
Diff
  • riddle=lambda w:w.index("?")
    • def riddle(w):
    • return w.index("?")
    • riddle=lambda w:w.index("?")
Code
Diff
  • fn foo()->i32{1}
    • fn foo() -> i32 {
    • 1
    • }
    • fn foo()->i32{1}

This u64 does not need to be a reference, it implements Copy...
I have to keep it though because it's in the tests >~<

Code
Diff
  • fn flip_the_number(x: &u64) -> u64 {
        x.to_string().chars().rev().collect::<String>().parse().unwrap()
    }
    • fn flip_the_number(x: &u64) -> u64 {
    • let mut x = *x;
    • let mut y = 0;
    • while x != 0 {
    • y = y * 10 + x % 10;
    • x /= 10;
    • }
    • y
    • x.to_string().chars().rev().collect::<String>().parse().unwrap()
    • }

Why was this i32 mutable?
Also, you don't need to turn this into an iterator...

Code
Diff
  • fn solution(x: i32) -> bool {
        x.to_string().contains('3')
    }
    • fn solution(mut x: i32) -> bool {
    • match x.to_string().chars().into_iter().position(|s| s == '3') {
    • Some(_t) => true,
    • _e => false,
    • }
    • fn solution(x: i32) -> bool {
    • x.to_string().contains('3')
    • }
Algorithms

I don't know why a u64 of all things was marked as mutable, so I removed it.
I also made use of strings, which I think is probably better practice here.

Code
Diff
  • fn digits(n: u64) -> usize {
        n.to_string().len()
    }
    • fn digits(mut n: u64) -> usize {
    • std::iter::from_fn(|| { n = n / 10; Some(n) }).
    • take_while(|n| *n > 0)
    • .count() + 1
    • fn digits(n: u64) -> usize {
    • n.to_string().len()
    • }