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

You are given a string word and an array of strings forbidden.
A string is called valid if none of its substrings are present in forbidden.
Return the length of the longest valid substring of the string word.
A substring is a contiguous sequence of characters in a string, possibly empty.
 
Please complete the following python code precisely:
```python
class Solution:
    def longestValidSubstring(self, word: str, forbidden: List[str]) -> int:
```