Data Structured62_q1b_grandfather
Grandfather
d15a9abf-6581-4046-b8c4-b304a77532e7.cppC++
1// Loading code...Selected Submission
100 / 100
0.11s
13120 KB
HashMapOther
Time Comp.
O(R + I * G)
Space Comp.
O(R + I * G)
Readability
7/10
"The code utilizes maps to store relationships between people (father-son) and their grandparents. Sets are used to store the grandparents of each person and to find the intersection of grandparent sets for two individuals."
History
| Attempt | Points | Time ↓ |
|---|---|---|
| Try #5 | 100 | 8/20/2024 |
| Try #4 | 60 | 8/20/2024 |
| Try #3 | 60 | 8/20/2024 |
| Try #2 | 30 | 8/20/2024 |
| Try #1 | 0 | 8/20/2024 |