..F....... [ZBX-8424] re-factored code to find max array key