[EPIJ 10/17 version]

Can the solution to 17.4 variant 2 perform better than O(k^(k-1)) time complexity (where k is the number of elements to sum)? Thanks!

[EPIJ 10/17 version]

Can the solution to 17.4 variant 2 perform better than O(k^(k-1)) time complexity (where k is the number of elements to sum)? Thanks!

0 Likes

@tsunghsienlee

I have an idea that I think would achieve `O(n^ceil(k/2))`

.

But you wrote `O(k^ceil(k/2))`

, which has `k`

as the base. Whereas I have `n`

as the base.

Any chance you actually meant `O(n^ceil(k/2))`

, not `O(k^ceil(k/2))`

?

0 Likes

Sorry, it is a typo, definitely O(n^ceil(k/2)) as I was thinking. I was confused by your writing. You wrote O(k^ceil(k/2)).

0 Likes

Can you enlighten the idea please? I am trying to find the solution of this variant.

0 Likes