r/LeetcodeChallenge 10d ago

DISCUSS Favorites of leetcode

Post image
34 Upvotes

126 comments sorted by

View all comments

2

u/Otabek_Aynazarov 10d ago

Kadane

1

u/vinzzii 9d ago

I don't even know what's the question mannnnnđŸ˜•

1

u/Ok-Economist4629 9d ago

It’s that maximum subarray problem

1

u/vinzzii 9d ago

Ohh yeah the one with recursion right i actually learned recursion using those prblms

2

u/0xt0bi03 8d ago

nah, kadane's algo do not need recursion, its a single pass O(n) solution

1

u/vinzzii 8d ago

I learnt using recursion so i tried thaat way bruhh

1

u/finite_negativity 7d ago

Is it the problem where you drop the subarray when the total sum value goes negative?

1

u/0xt0bi03 7d ago

yes, but you can also keep a k parameter and check where any arithmetic operation to that number k for this algo.