do you mean something different from the worst case or what?

Yeah, I messed it up. I calculated the repeated string concatenation as T(n) = n^2 as in the worst case, but comparisons as T(n) = 1 as in "more realistic" scenario (i.e. you're unlikely to deal with GigaByte-sized strings, and the constant factor is so low, the O(n) comparsion can be negligible). This particular solution is indeed O(n^3)

What is n?

In the worst scenario all the inputs' sizes are inifinitely big, so both the string and the list will be n, no?

to be honest, this should've been 8kyu

nope ~~ I refer to the official one ~~

Lol, did you write a script?

Python new test framework should be used with 3.8 enabled

7 kyu that's timing out isn't really 7 kyu is it?

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

Ranks cannot be changed, but I totally agree, it's a bit too easy for a 6 kyu. A small bit of math would do the trick well.

Yeah, I messed it up. I calculated the repeated string concatenation as

`T(n) = n^2`

as in the worst case, but comparisons as`T(n) = 1`

as in "more realistic" scenario (i.e. you're unlikely to deal with GigaByte-sized strings, and the constant factor is so low, the`O(n)`

comparsion can be negligible). This particular solution is indeed`O(n^3)`

In the worst scenario all the inputs' sizes are inifinitely big, so both the string and the list will be

`n`

, no?With hashing a newly created string - yes.

Looks correct to me for the worst case.

Only if the hashes are already calculated and cached; otherwise

`len(l[i])`

has to be somewhere as well.What is

`n`

? And do you mean something different from the worst case or what? Arbitrary strings can't be compared in O(1).That's not how

`O`

works, and your reasoning is wrong too. This solution is`O(n^2)`

, and there's no asymptotically better algorithm for this task.This comment is hidden because it contains spoiler information about the solution

I'm enlightened. Thank you very much.

didn't know they had python back then!

This is too easy for 6 kyu

## Loading more items...