Ad
  • Custom User Avatar

    as i64 is error-prone for u64. Consider to use i64::try_from alternative.

  • Custom User Avatar

    consider to replace unconditional n as i64; by i64::try_from(n).unwrap();.
    See

  • Custom User Avatar

    my haskell code doesn't pass a test

    should support finding peaks, but should ignore peaks on the edge of the array
    
    expected: PickedPeaks {pos = [2], peaks = [3]}
     but got: PickedPeaks {pos = [2,4], peaks = [3,2]}
    

    Unfortunately the test input doesn't appear and I couldn't reproduce it. Actually neither of the edges of the input array could appear in output of my implementation because they will be removed explicitly.

    Does anyone have a hint with regard to the test input?

  • Custom User Avatar

    Is there a particular reason you are using read . return in digits?
    Why not digitToInt