Java code - Kandane longest and shortest sub seq

Java code - Kandane longest and shortest sub seq