All test case are showing run error . but sample case is running


here is my code . may please rectify my code

This is the corrected code, please go through it. You need to use long for area as it can cross the max value for int. Also since you’re passing stack as a parameter in the function, you don’t need to create a new stack inside the function (from the sample code given on hackerblocks).

on the submissin compiler , there is a pregenerted code. may you please explain how can i use that code.

Yes exactly, you just need to write the function for finding max area where the function has been defined. You don’t need to paste the rest of the code such as stack implementation etc. And you don’t even need to take input from user. Just implement the function.

its shows some .class expected in return ans[];( error )…

thanx for help. it’s resolved now .

1 Like