You are given an array of strings words. For each index i in the range [0, words.length - 1], perform the following steps:

Return an array answer, where answer[i] is the length of the longest common prefix between the adjacent pairs after removing the element at index i. If no adjacent pairs remain or if none share a common prefix, then answer[i] should be 0.

 

Example 1:

Input: words = ["jump","run","run","jump","run"]

Output: [3,0,0,3,3]

Explanation:

Example 2:

Input: words = ["dog","racer","car"]

Output: [0,0,0]

Explanation:

 

Constraints: