The Torah says that the sea formed a wall to the left and right of the Jews. The Midrash clarifies that it became a solid wall.

The Chasam Sofer, to resolve a different issue, says that since the Jews were surrounded by walls, there was no prohibition of techumin.

I could understand this if they were literally surrounded by walls, but according to my understanding having a wall to the left and right isn't called enclosed. Why would this suffice to avoid the prohibition of techumin? There was a breach in front of them and behind them. I recall there's an opinion somewhere that the sea split to form a semi circle, but I don't think that would help.

a sharp turn in a road disqualifies it from being a public thoroughfare and with walls is a reshus hayachid deoraisa, but the rabbis instituted a beam or a lechi. iruvin were instituted by Shlomo hamelech after krias Yam suf It could be according to the Rambam pirkei avos chapter 5 they went in a U shape that turned sharply which was a reshus hayachid in those days
– user15464Apr 4 '18 at 23:57

@user15464 why not post that as an answer? But to clarify: when you say a road with a sharp turn and walls, you mean two walls?
– robevApr 5 '18 at 0:03

Don't know if this helps but someone told me there's a Midrash that the sea wasn't split all the way, rather just until in front of the Jews. This would make them enclosed on three sides.
– robevApr 5 '18 at 2:57

I don't know how deep the Yam Suf was at the time or how steep the walls were. (Perhaps this guy does.) And I'm also not well enough versed in eruvei t'chumin to know if the same m'chitza rules apply to it as to chatzeros. But if it was and if they do, perhaps the banks constituted the "front" and "back" walls according to the Chasam Sofer.
– WAFJun 22 '18 at 6:31