An internal report collects a list of records and returns a read-only snapshot. Currently, changes to the original objects after the call are unexpectedly visible in the already obtained result.
ReportBuilder#build method must return a new array of hashes that does not share nested objects with the input.:meta field in the result must be an independent copy of the original hash.:tags field in the result must be an independent copy of the array, and the strings inside must be separate objects.build must not change an already returned snapshot.:tags, use an empty array that is not shared between records.Exactly one line should be printed:
snapshot=[{"id":1,"meta":{"owner":"alice"},"tags":["blue"]},{"id":2,"meta":{"owner":"bob"},"tags":[]}]
After subsequent changes to the input data, the already obtained snapshot must remain unchanged.
ruby main.rbClick a line and write what it prints. Explanation is optional.