mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 08:50:15 +08:00
链表相交文档结构格式化
This commit is contained in:
@ -101,8 +101,8 @@ public:
|
|||||||
|
|
||||||
## 其他语言版本
|
## 其他语言版本
|
||||||
|
|
||||||
|
Java:
|
||||||
|
|
||||||
### Java
|
|
||||||
```Java
|
```Java
|
||||||
public class Solution {
|
public class Solution {
|
||||||
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
|
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
|
||||||
@ -150,9 +150,9 @@ public class Solution {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Python
|
Python:
|
||||||
```python
|
|
||||||
|
|
||||||
|
```python
|
||||||
class Solution:
|
class Solution:
|
||||||
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
|
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
|
||||||
lenA, lenB = 0, 0
|
lenA, lenB = 0, 0
|
||||||
@ -179,7 +179,7 @@ class Solution:
|
|||||||
return None
|
return None
|
||||||
```
|
```
|
||||||
|
|
||||||
### Go
|
Go:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func getIntersectionNode(headA, headB *ListNode) *ListNode {
|
func getIntersectionNode(headA, headB *ListNode) *ListNode {
|
||||||
@ -240,7 +240,7 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### javaScript
|
JavaScript:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var getListLen = function(head) {
|
var getListLen = function(head) {
|
||||||
@ -352,6 +352,7 @@ ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
Scala:
|
Scala:
|
||||||
|
|
||||||
```scala
|
```scala
|
||||||
object Solution {
|
object Solution {
|
||||||
def getIntersectionNode(headA: ListNode, headB: ListNode): ListNode = {
|
def getIntersectionNode(headA: ListNode, headB: ListNode): ListNode = {
|
||||||
|
Reference in New Issue
Block a user