How to construct Neyman Pearson statistic to detect discrete signal in AWGN with unknown location?
I'd suggest trying to get rid of the $p$ index. You can write $\mathcal H_1$ as $Y_i = W_i + A$, then you can do the detection on each sample. You put the self-study tag, so I'll let you do the math but it'll come down to detecting the pulse if $y_i &gt; \frac{A}{2}$. This will only work, if you know $A$ of course. You'll need a fairly high SNR for this to work well though. If the pulse is more obscured by the noise, you can try the next approach.
Another way to approach this problem, is to use filtering. Since you know you're looking for a rectangular pulse of length $100$, you can run the noisy data through a matched filter which will at least give you some processing gain (https://ccrma.stanford.edu/~jos/sasp/Processing_Gain.html). If you plot the samples after the filtering, you'll see a peak somewhere. Since the matched filter will have some delay, the start of the pulse is $\text{Peak Index}-\text{Pulse length}+1$. This is another way to do the processing, especially if you are able to gather a batch of data then do the processing.
Edit
The first approach requires a single scan through the input data stream leading to $10^5$ comparisons, $\mathcal{O}(N)$ operations where $N$ is the length of the input data.
The second approach involves using a FIR filter which can be done in $\mathcal{O}(NM)$, where $M$ is the length of the filter.
The second approach can also be implemented using FFT filtering which can be done in $\mathcal{O}(N\text{ log}N)$ operations.