It would not pass c++ interview. The method is restricted to int arrays only. The interface is not c++, but c. Using signed integers for array length and indices is wrong. ChatGPT should use std::search