Construct The Array Hackerrank Solution Sql