在 Ruby 中,我有一个如下所示的数组数组:
[["2011-12-03 01:21:31", "Closed", ""],
["2011-11-11 00:42:40", "", "Smith, Bob"],
["2011-11-11 00:42:40", "Escalated", ""],
["2011-11-10 21:36:11", "", "ABC Team"],
["2011-11-10 21:36:11", "Escalated", ""],
["2011-11-10 18:42:19", "", "Smith, Bob"],
["2011-11-10 18:42:19", "Escalated", ""],
["2011-11-09 22:55:01", "", "Global Design"],
["2011-11-09 22:55:01", "Escalated", ""],
["2011-09-28 18:56:32", "", "Jones, Fred"],
["2011-09-28 18:56:32", "Escalated", ""],
["2011-09-28 07:19:28", "", ""],
["2011-09-28 07:19:28", "", ""],
["2011-09-28 07:19:28", "", ""],
["2011-09-28 07:19:28", "", ""],
["2011-09-28 07:19:28", "", "Finance"],
["2011-09-28 07:19:28", "Escalated", ""]]
我想根据时间戳将条目混合在一起。我希望得到的数组看起来像:
[["2011-12-03 01:21:31", "Closed", ""],
["2011-11-11 00:42:40", "Escalated", "Smith, Bob"],
["2011-11-10 21:36:11", "Escalated", "ABC Team"],
["2011-11-10 18:42:19", "Escalated", "Smith, Bob"],
["2011-11-09 22:55:01", "Escalated", "Global Design"],
["2011-09-28 18:56:32", "Escalated", "Jones, Fred"],
["2011-09-28 07:19:28", "Escalated", "Finance"]]
任何关于在 Ruby 中实现这一目标的有效方法的想法?