400-110=290
動(dòng)態(tài)規(guī)劃捧杉,還有棧
搞定之后岂却,大約是130
還有270道驱证、萌庆、一天兩道外加上復(fù)盤、搬设、
JVM问麸、 ~~~~~~~~~
mysql伙判、
微服務(wù) ~~~~~~~~~~~~~圖靈
Spring尽狠、衔憨、
八股總結(jié)、袄膏、践图、、
項(xiàng)目沉馆、底層源碼码党、德崭、、揖盘、
92眉厨、反轉(zhuǎn)鏈表二
class Solution {
public ListNode reverseBetween(ListNode head, int left, int right) {
if(head==null || head.next==null) return head;
ListNode preHead=new ListNode(-1,head),pre=preHead,cur=head,temp=head,node1=head;
int count=0;
while (cur!=null){
count++;
if(count==left){
node1=cur;
while (count<=right){
temp=cur.next;
cur.next=pre.next;
pre.next=cur;
cur=temp;
count++;
}
node1.next=temp;
if(left==1) return preHead.next;
return head;
}else {
pre=cur;
cur=cur.next;
}
}
return head;
}
}
206. 反轉(zhuǎn)鏈表
class Solution {
public ListNode reverseList(ListNode head) {
ListNode preHead=new ListNode(-1,null),pre=preHead,cur=head,temp=head;
while (cur!=null){
temp=cur.next;
cur.next=pre.next;
pre.next=cur;
cur=temp;
}
return pre.next;
}
}