Ad
  • Default User Avatar

    what if it takes than 100 steps to get out of the array? If you have input an array with 200 items and all are 1 ... [1,1,1,....,1,1]. This function will return -1 though it should return 201