• + 1 comment

    My OCaml code works fine with the first 3 TC, but on #3 it starts to break... First I get a list of prime factors, I generate a Set of factors and intersect them with each other so the (Prime, Exponent) lists can have the same length and items. Then I count each number in the common set and make a List of (Prime, Exponent). Last, I get the least Exponent and multiply to get the total number and apply the modulo operation.

    The result given in the output is a negative number, so I guess I ran out of Int64 values while multiplying...

    I'm running into a lot of timeout/memory issues with these kinds of exercises and OCaml, should I be using another language?