Cody

Problem 44784. Project Euler: Problem 14 Longest Collatz sequence(harder version)

Solution 2523488

Submitted on 11 Jun 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assessFunctionAbsence({'tic','toc','pause','etime','clock','now','str2num','timer'},'FileName','euler014_v2.m') 2

ans = 2

2   Fail
N = 2e8; num_correct = 169941673; len_correct = 954; tic [num, len] = euler014_v2(N); t=toc assert(t>1); assert(isequal(num, num_correct)); assert(isequal(len, len_correct)); 3

Error using euler014_v2 Too many output arguments. Error in Test2 (line 5) [num, len] = euler014_v2(N);

3   Fail
N = 4e8; num_correct = 268549803; len_correct = 965; tic [num, len] = euler014_v2(N); t=toc assert(t>1); assert(isequal(num, num_correct)); assert(isequal(len, len_correct));

Error using euler014_v2 Too many output arguments. Error in Test3 (line 5) [num, len] = euler014_v2(N);

Suggested Problems

More from this Author17

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!