Hi divyaa for this you need to do looping over this cdt array using a!foreach()
Where during each iteration you need to use wherecontains() to check whether this current cdt object id is present as parentid to some other cdt or not, if yes, store it…