我有一个具有父/子关系的对象数组:
implementation "com.google.firebase:firebase-perf:12.0.1"
implementation "com.google.android.gms:play-services-ads:12.0.1"
implementation "com.google.firebase:firebase-messaging:12.0.1"
implementation "com.google.firebase:firebase-config:12.0.1"
implementation "com.google.firebase:firebase-invites:12.0.1"
implementation "com.google.firebase:firebase-core:12.0.1"
implementation "com.crashlytics.sdk.android:crashlytics:2.9.5"
implementation "com.google.firebase:firebase-ml-vision:18.0.2"
在这些父/子关系中,有些具有多级关系:
Rickard> Eddard> Sansa
Tywin> Jaime> Myrcella
如何遍历数据并仅生成顶级父母(即Rickard和Tywin)的数组?