you want build n new building city the new building build line label 1 nHowever city restriction height new buildingsthe height building nonnegative integerthe height building 0the height difference adjacent building exceed 1additionally city restriction maximum height specific building these restriction give 2d integer array restriction restrictionsi idi maxHeighti indicate build idi height equal maxheightiit guarantee building appear restriction build 1 restrictionsreturn maximum possible height tall building Example 1input n 5 restriction 2141output 2explanation the green area image indicate maximum allow height buildingwe build building height 01212 tall building height 2example 2Input n 6 restriction output 5explanation the green area image indicate maximum allow height buildingwe build building height 012345 tall building height 5Example 3Input n 10 restriction 532574103output 5explanation the green area image indicate maximum allow height buildingwe build building height 0123344543 tall building height 5 Constraints2 n 1090 restrictionslength minn 1 1052 idi nidi unique0 maxheighti 109