Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->
自己寫的一個一個字符匹配的while循環是什么辣雞玩意,根本就過不了一些特殊測試集,哎,看官解吧。class Solution:def strStr(self, haystack, needle):&
You are given two linked lists representing two non-negative numbers. The digits are stored in rever
1.Given an array of integers, return indices of the two
這兩道題若是不使用官方題解的雙指針做法,就會涉及到淺復制,深復制的問題,可參考如下https://blog.csdn.net/qq_32907349/article/details/52190796
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct
32. Longest Valid ParenthesesGiven a string containing just the characters '(' and ')
54. Spiral MatrixGiven a matrix of m x n elements (m rows, n colu
53. Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) wh
206. Reverse Linked ListReverse a singly linked list.反轉鏈表:1)對于空鏈表或者一個節點鏈表無需反轉,返回即可。設計思路:1)首先把當前節點外的剩