Longest Non-negative Transaction Subsequence

Asked at DocuSign · Coding Questions · Difficulty: Medium

Given an array `transactions`, find the longest subsequence of transactions such that when executed in order (by summing), your account balance never becomes negative. The balance starts at `0`, and a subsequence preserves the original relative order but need not be contiguous.

Loading the problem…