The sample space (universal set) is
{HHHH,HHHT,HHTH,HHTT,HTHH,HTHT,HTTH,HTTT,THHH,THHT,THTH,THTT,TTHH,TTHT,TTTH,TTTT}
We are looking in that sample space for the event which is the subset where
the last three are the same. That's this event [subset of the sample space
(universal set)]:
{HHHH,HTTT,THHH,TTTT}
That's the answer.
Edwin