For tactical ttrpgs such as Pf2e. Is the GM obligated to build encounters that don't take advantage of the party's build?

To elaborate lets say the players build a party that is all melee or all range and vice versa. Is it incumbent on the GM to basically build encounters that 90% of the time enable those build regardless of the setting, campaign premise, lore and so on?