添加 problem 19

This commit is contained in:
YDZ
2019-02-21 03:02:37 +08:00
parent 7b236b56b6
commit cf77cced8a
4 changed files with 134 additions and 32 deletions

View File

@@ -77,35 +77,3 @@ func Test_Problem2(t *testing.T) {
}
fmt.Printf("\n\n\n")
}
// // convert *ListNode to []int
// func L2s(head *ListNode) []int {
// res := []int{}
// for head != nil {
// res = append(res, head.Val)
// head = head.Next
// }
// return res
// }
// // convert []int to *ListNode
// func S2l(nums []int) *ListNode {
// if len(nums) == 0 {
// return nil
// }
// res := &ListNode{
// Val: nums[0],
// }
// temp := res
// for i := 1; i < len(nums); i++ {
// temp.Next = &ListNode{
// Val: nums[i],
// }
// temp = temp.Next
// }
// return res
// }