Peak Element In Array Using Function