Community RSS Feed
http://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Challenges sorted by activeIssues with Wolfram Challenges website and platform
http://community.wolfram.com/groups/-/m/t/1413604
For Wolfram Challenge, I am struggling more with your mistakes than with the challenges themselves.
You have problem with solved counter. If someone sends "wrong" solutions to the task before sending the correct solution - your counter counts all attempts, not only the right solution. Here is an example of two unsuccessful attempts at a solution plus one correct.
![enter image description here][1]
You have problems with the algorithm that compares the speed score. How do I know this? Simple, by testing.
![enter image description here][2]
And there is no doubt here. If you want, you can show your users a quicker solution than that. Put score 56.09 out of 100 on a pre-calculated solution which hardly makes any calculations...is a bit confident on your part.
PrimeGap[gap_ /;
EvenQ[gap] && gap > 0] := {{3, 5}, {7, 11}, {23, 29}, {89,
97}, {139, 149}, {199, 211}, {113, 127}, {1831, 1847}, {523,
541}, {887, 907}, {1129, 1151}, {1669, 1693}, {2477, 2503}, {2971,
2999}, {4297, 4327}, {5591, 5623}, {1327, 1361}, {9551,
9587}, {30593, 30631}, {19333, 19373}, {16141, 16183}, {15683,
15727}, {81463, 81509}, {28229, 28277}, {31907, 31957}, {19609,
19661}, {35617, 35671}, {82073, 82129}, {44293, 44351}, {43331,
43391}, {34061, 34123}, {89689, 89753}, {162143, 162209}, {134513,
134581}, {173359, 173429}, {31397, 31469}, {404597,
404671}, {212701, 212777}, {188029, 188107}, {542603,
542683}, {265621, 265703}, {461717, 461801}, {155921,
156007}, {544279, 544367}, {404851, 404941}, {927869,
927961}, {1100977, 1101071}, {360653, 360749}, {604073,
604171}, {396733, 396833}}[[gap/2]]
You have some crazy time limit of 3000 milliseconds for task. You definitely have time-consuming challenges. Even "Prime Gap" for my non-optimized code take near 11 sec = 11000 milliseconds
PrimeGap[gap_ /; EvenQ[gap] && gap > 0] := Module[
{pgFind = False, pgCounter = 1, pgResult = {}},
While[pgFind == False,
pgCounter++;
If[(Prime[pgCounter] - Prime[pgCounter - 1]) == gap,
pgResult = {Prime[pgCounter - 1], Prime[pgCounter]};
pgFind = True
, Nothing]
];
pgResult
]
![enter image description here][3]
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=WolframSolvedCounter.png&userId=1404950
[2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=WolframSpeedScore.png&userId=1404950
[3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=WolframMilliseconds.png&userId=1404950Emil Enchev2018-08-19T05:14:41Z