Given a list of records (each an array of strings) and a query array of strings, return the records that contain all of the query strings. Example: records [John, Bob, Alice, Tony], [Mark, Will, Lee, Edgar], [Edgar, Pam, Alice, John]; query [John, Alice] -> first and third records. Solve using C++.
Asked in the online assessment stage.
query_terms.record_id, record_name.record_id ascending.| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique identifier for a record |
| record_name | VARCHAR(100) | Display name of the record |
| Column | Type | Description |
|---|---|---|
| record_string_idPK | INT | Unique identifier for a record string |
| record_id | INT | Record containing the string |
| value | TEXT | String contained in the record |
| Column | Type | Description |
|---|---|---|
| term_idPK | INT | Unique identifier for a query term |
| term | TEXT | String that every returned record must contain |