After pushing a new change Paula has broken production. :/
- Paula was installing a new security monitoring package
- Turns out, this package, allowed remote access into the company network
- Italian Hackers entered the network and created some fake surveys
- The Italians created fake surveys in pairs
- For each pair the
name
fields on the survey are Semordnilaps of each other - Eg. for survey1 the
name
could bedog
and survey2 would begod
- Or
maps
andspam
- For each pair the
- Given a list of surveys of size
N
, return a list of tuples, containing the twotx_id
s for each pair of fake Italian surveys. - Each survey object has the attributes
tx_id
name
- A pair of surveys is considered to be fake, if there exists another survey in the list, who's name backwards is equal to the name of the survey (A Semordnilaps).
Consider the simple list with three surveys...
list = [
{
"tx_id": 123,
"name": "xxffllo"
},
{
"tx_id": 456,
"name": "random"
},
{
"tx_id": 789,
"name": "ollffxx"
}
]
The output should be [(123, 789)]
as the names for the first and last items are each other backwards (Semordnilaps).
- Names are unique, i.e no two names will be equal to each other
- If no fake survey pairs are found, return an empty list