Java Exception Handling Hackerrank Solution Python W3schools