My code for Leetode online judge using Java