{"ScriptPreparationCode":"let arr = [{\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 1\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 2\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 3\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 4\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 20,\r\n id: 5\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 30,\r\n id: 6\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 40,\r\n id: 7\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 50,\r\n id: 8\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 9\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 10\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 11\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 12\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 60,\r\n id: 13\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 70,\r\n id: 14\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 80,\r\n id: 15\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 90,\r\n id: 16\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 17\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 18\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 19\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 20\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 100,\r\n id: 21\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 110,\r\n id: 22\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 120,\r\n id: 23\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 130,\r\n id: 24\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 25\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 26\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 27\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 28\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 140,\r\n id: 29\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 150,\r\n id: 30\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 160,\r\n id: 31\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 170,\r\n id: 32\r\n }\r\n];","TestCases":[{"Name":"Lodash","Code":"let arr = [{\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 1\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 2\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 3\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 4\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 20,\r\n id: 5\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 30,\r\n id: 6\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 40,\r\n id: 7\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 50,\r\n id: 8\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 9\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 10\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 11\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 12\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 60,\r\n id: 13\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 70,\r\n id: 14\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 80,\r\n id: 15\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 90,\r\n id: 16\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 17\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 18\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 19\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 20\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 100,\r\n id: 21\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 110,\r\n id: 22\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 120,\r\n id: 23\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 130,\r\n id: 24\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 25\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 26\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 27\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 28\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 140,\r\n id: 29\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 150,\r\n id: 30\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 160,\r\n id: 31\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 170,\r\n id: 32\r\n }\r\n];\r\nlet gr = [];\r\nlet uniqNames = _.uniq(_.map(arr,\u0027name\u0027));\r\nfor(let nm of uniqNames){\r\n \tlet filt = _.filter(arr,[\u0027name\u0027,nm]);\r\n\tlet o = {name: nm, ages: []};\r\n let uniqAge = _.uniq(_.map(filt,\u0027age\u0027));\r\n \tfor(let ag of uniqAge){\r\n \tlet fil = _.filter(filt,[\u0027age\u0027,ag]);\r\n \tlet aObj = {age:ag,list:fil};\r\n \t\to.ages.push(aObj);\r\n }\r\n \tgr.push(o);\r\n}","IsDeferred":false},{"Name":"JS","Code":"let arr = [{\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 1\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 2\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 3\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 4\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 20,\r\n id: 5\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 30,\r\n id: 6\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 40,\r\n id: 7\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 50,\r\n id: 8\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 9\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 10\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 11\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 12\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 60,\r\n id: 13\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 70,\r\n id: 14\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 80,\r\n id: 15\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 90,\r\n id: 16\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 17\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 18\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 19\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 20\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 100,\r\n id: 21\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 110,\r\n id: 22\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 120,\r\n id: 23\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 130,\r\n id: 24\r\n },\r\n {\r\n name: \u0027a\u0027,\r\n age: 10,\r\n id: 25\r\n },\r\n {\r\n name: \u0027b\u0027,\r\n age: 10,\r\n id: 26\r\n },\r\n {\r\n name: \u0027c\u0027,\r\n age: 10,\r\n id: 27\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 10,\r\n id: 28\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 140,\r\n id: 29\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 150,\r\n id: 30\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 160,\r\n id: 31\r\n },\r\n {\r\n name: \u0027d\u0027,\r\n age: 170,\r\n id: 32\r\n }\r\n];\r\nlet gr = [];\r\nfor(let i of arr){\r\n \tlet a = _.find(gr,{\u0027name\u0027:i.name});\r\n \tif(a){\r\n \tlet b = _.find(a.ages,{\u0027age\u0027:i.age});\r\n \tif(b){\r\n \tb.list.push(a);\r\n } else {\r\n \tlet c = {age: i.age, list: [i]};\r\n \ta.ages.push(c);\r\n } \t\r\n } else {\r\n \t\tlet o = {name: i.name, ages: [{age: i.age, list: []}]};\r\n gr.push(o);\r\n }\r\n}","IsDeferred":false}]}