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.
lowercase 'a' should have been an uppercase 'A'
This comment is hidden because it contains spoiler information about the solution
Why even use fill?
It can be solved in O(n), in a single passage.
uggh i rushed this. i have a better refactored answer submitted
uggh i've refactpred twice. look for my newest version
i should have done more refactoring once i saw that it worked. still new at javascript so didn't occur to use filter or other array functions
i like the test for zero problems and a shift before the for loop. wish i had thought of that
write a simple swap function. also, dont make calls to IndexOf twice in a row for same thing
take a look at my code and see if it helps you
your swapping solution is what i did. take a look at my solution
not clean or maintainable by other team members. clever to cram everything together and i also think the big O performance of this solution will be terrible
but then the check of the 3x3 subgrids will not total 45 they they have to
no need to filter for zeros at the end. you know they are zeros. just pad out the filtered non-zero array with zeros
This comment is hidden because it contains spoiler information about the solution
the filter for the zeros seems wastefull. looks cool but you could have just aray.fill'ed the tail end of zeros.
the details for assignment was to trim the trailing end. you trimmed the leading and trailing end. this would mess up and lines of text that started with spaces
Loading more items...