Alright as you asked for PERFORMANCE here it is the best solution you can have for this:
titles = {
{5, "Private First Class"},
{13, "Specialist"},
{25, "Corporal"},
{33, "Sergeant"},
{47, "Staff Sergeant"},
{100, "Sergeant First Class"}
}
function binarysearch(t, v, l...