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.
Better case is:
$this->assertSame(9199999999999999999, nextBigger(1999999999999999999));
i agree it will re execute the count in each iteration, but maybe he leave it like that to save 1 line of code at the cost of little eficiency.
A pleasure sir, it's always worth trying to formulate any constraints until you find a set that can be resolved.
Your testcase is wrong. The next bigger value of 1111111111111111119 is 1111111111111111191.
But your assumption is right: Searching for the solution iteratively is wasting lots of CPU, so this isn't qualifying as "clever" in the sense of "using an approach that is not brute-forcing it, but identifying the problem as what it truly is, and applying a very good solution to it".
But it might qualify for "clever" as in "applying a solution that isn't obvious".
This comment is hidden because it contains spoiler information about the solution
I write that because the description asks for 10 decimals... see the examples too.
You passed because your first ten decimals are correct and because I don't test the number of decimals.
Yeah, good point.