From: Rabbi Moshe Sofer
To: Rabbi Chaim Baruch
An emissary from Eretz Yisrael asks why a single day's presence suffices for Megillah obligations when other halachos require 30 days of residence. The Chasam Sofer distinguishes grammatically between 'yoshvei ha'ir' (a status title requiring 30 days) and 'ha-yoshvim b'arei' (describing mere presence).
Source: Shu"t Chasam Sofer OC §194