Ad
  • Custom User Avatar

    The reason why its timing out is because of the time complexity of O(n^2). If you read the description it tells you that there will be some really long arrays. You should try another solution