题解 | #从尾到头打印链表#
从尾到头打印链表
http://www.nowcoder.com/practice/d0267f7f55b3412ba93bd35cfa8e8035
func printListFromTailToHead ( _ head: ListNode?) -> [Int] {
        // write code here
    var listArr:[Int] = [];
    var tmp:ListNode? = head;
    while (tmp != nil){
        listArr.insert(tmp!.val, at: 0);
        tmp = tmp!.next;
    }
   return listArr; }
两个点:1.判断好边界条件  2.遍历链表时每次插入组头,
why:swift耗时要这么久?
