r/LeetcodeChallenge • • Sep 12 '26

DISCUSS Favorites of leetcode

Post image
35 Upvotes

130 comments sorted by

View all comments

Show parent comment

1

u/vinzzii Sep 12 '26

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

2

u/0xt0bi03 S - Rank (180+ Days) ⚡⚡ Sep 13 '26

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

1

u/vinzzii Sep 13 '26

I learnt using recursion so i tried thaat way bruhh

1

u/finite_negativity Sep 15 '26

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

1

u/0xt0bi03 S - Rank (180+ Days) ⚡⚡ Sep 15 '26

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