Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting

  • Custom User Avatar

    It looks like many solutions here are O(n^2) ones, but here complexity is just more obvious.
    Do you count yours solution as o(n)? For me it seems to be O(n * log(n)), cause "counts[ch] = (counts[ch] || 0) + 1" should have at least O(log(n)) complexity when the size of 'counts' grows.

    exuse me for necroposting