The input array must be sorted in an ascending order for this algorithm to work. The logic compares the middle integer with the target integer, and relies on it be either equivalent, less or greater than the target to define the next search area by updating the left and right pointers. If it weren't sorted in ascending order, the pointers could be updated to an area of the array where the target does not exist, causing the while loop to terminate once left and right become equal.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence