code https://ide.codingblocks.com/s/238647
Used Top Down approach , working fine in example test case .
SUPW Run Error Java
@ranaabhinav50
You’re initialising values for index 0, 1 and 2
What if N is less than 3 ?
Then you’re accessing region beyond array size
Try to fix that once