Longest subsequence with non negative prefix sum at each position
Given an array arr[] consisting of N integers, the task is to find the longest subsequence such that the prefix sum at each position of the subsequence is non-negative. Examples: Input: arr[] = {4, -4, 1, -3, 1, -3}Output: 5Explanation:Consider the subsequence as {4, 1, -3, 1, -3}. Now, the prefix s