Given social network posts in the following format:
[
{"date": "12.10.2019",
"text": "I love trouts!",
"likes": [1, 2, 3, 4]},
{"date": "17.10.2019",
"text": "Hello world!",
"likes": [1, 2, 3, 4]}б
...
]
likes
is a list of user ids that liked a post
And given users in the following format
[
{"id": 1
"name": "John"},
...
]
Find the names of the users, that liked all posts. Example:
// posts
[
{"date": "21.12.2019",
"text": "Fish!",
"likes": [1, 2]},
{"date": "21.12.2019",
"text": "Apples :((",
"likes": [1, 2, 3]}
]
//users
[
{"id": 1,
"name": "John"},
{"id": 2,
"name": "Mary"},
{"id": 3,
"name": "Jane"},
]
The result should be:
["Mary", "John"]
Any questions are welcome!
- You can use https://github.com/dakrone/cheshire to parse json files