Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You should get running algo to get answers, or calculate it somehow.
And its good solution to hardcode something like this in production.
Thats very good.
Be very carefull with eval. Basically you should not do it. And if you do - sanitize input.
PHP 8.0.
"class MyTestCases extends TestCase { "
gives error -
"Test class name must end with 'Test' for test runs".
Changing class name for MyTest solves the case.
Thats nice.
This didnt divide number, but check if last bit of it is one.
So must work faster and require less resources.
Inputs are strings, not necessery words. So can trigger false positive.
a1 = ['test test'];
a2 = ['test','test'];
I love that feeling of stupid overenginering after seeng what best practices is
your formula is for seeking N fibonacci number, when you do math with every.
its good, but not best. You count sqrt(5) and phi every time, but can just use variables for it. Math is good, but you do pow 2 times, when can do just one.
You dont need to calc both numbers. Defenetly dont need to count $f0*$f1 every time. Count sqrt($prod) once and seek, is it between $f1 and $f2.
PS your formula is for finding Nth number of fibonacci, when you do math with every, not so effective.