2018年3月22日

leetCode刷题(使用链表做加法)

摘要: Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8 Explanation: 342 + 465 = 807.关键是获取最后一个node节点 /** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * ... 阅读全文

posted @ 2018-03-22 16:02 杨龙飞 阅读(135) 评论(0) 推荐(0) 编辑

leetCode刷题(找出数组里的两项相加等于定值)

摘要: 最近被算法虐了一下,刷一下leetcode,找找存在感 如题: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assu 阅读全文

posted @ 2018-03-22 13:53 杨龙飞 阅读(153) 评论(0) 推荐(0) 编辑

导航

Fork me on GitHub