Ad
  • Custom User Avatar

    I love how you created the blocks and used array's 'every' method. I troubled over traversing blocks for a little bit and love how you were able to organize them. Moreover, I didn't know about array's every method. Thanks for positing.

    By chance do you know the time complexity of your solution ? just trying to understand time complexity more. It does doesn't matter since the input will never be massive, but am interested for learning. initially my thought is that organizing the data takes n^2 (n rows with n items). js' sorting algoritm takes n log n, I believe. it's done three times for n array. n^2 + (n log n * 3n) => n^2 log n ?

    any feedback appreciated!