We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The Maximum Subarray
The Maximum Subarray
Sort by
recency
|
494 Discussions
|
Please Login in order to post a comment
`Java: Simple Code for Beginner:
public static List maxSubarray(List arr) {
} `
Java code
public static List maxSubarray(List arr) { if (arr.size() == 1) { return List.of(arr.get(0), arr.get(0)); }
C#
java8
O(n)