Sure. Write a function that iterates through the list, building a reference list of IDs found in the list. If any ID appears in one of its sub-lists, you have infinite nesting.
Maintain the list of "ancestor" IDs and recur on each element that's a list.
Can you do the coding now?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…