Please solve the programming task below using a self-contained code snippet in a markdown code block.

A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself).
Given a string s, return the longest happy prefix of s. Return an empty string "" if no such prefix exists.
 
Please complete the following python code precisely:
```python
class Solution:
    def longestPrefix(self, s: str) -> str:
```