you give 2D integer array item itemsi pricei beautyi denote price beauty item respectivelyYou give 0indexed integer array query for queriesj want determine maximum beauty item price equal queriesj if item exist answer query 0return array answer length query answerj answer jth query Example 1input item 1232245635 query 123456output 245566explanation for queries01 12 item price 1 hence answer query 2 for queries12 item consider 12 24 the maximum beauty 4 for queries23 queries34 item consider 12 32 24 35 the maximum beauty 5 for queries45 queries56 item consider hence answer maximum beauty item ie 6example 2input item 12121314 query 1output 4explanation the price item equal 1 choose item maximum beauty 4 note multiple item price andor beauty example 3input item 101000 query 5output 0explanationno item price equal 5 item chosenhence answer query 0 Constraints1 itemslength querieslength 105itemsilength 21 pricei beautyi queriesj 109