<div dir="ltr">After analysing the method declaration carefully I realized some bugs in the code:<div><ol><li> the if condition on seeing min length as less than 0 returns out of memory error with a message that "required length is too large" which is contradictory to what we are checking in the condition.</li><li>We should actually return the out of memory error when it exceeds the SOFT_ARRAY_MAX_LENGTH </li><li>Moreover we are returning minLength in the third condition when we actually shouldn't because it exceeds the limit </li></ol><div>Kindly verify this.</div></div></div>