Ad
  • Custom User Avatar

    While this solution is easier to implement (which is genius, to be honest), it's not feasible based on time complexity.

    You can use this code to compare this function with other implementations for comparison:

    const runPrimePerformance = (...arguments) => 
    {
        for (let i=0; i < arguments.length; i++) {
            console.time(arguments[i].name);
            arguments[i](/*insert matrix here*/);
            console.timeEnd(arguments[i].name);
        }
    }
    runPrimePerformance(snail1, snail2);