Skip to content

Instantly share code, notes, and snippets.

View willww64's full-sized avatar

Will Wang willww64

View GitHub Profile
@willww64
willww64 / reverse_linked_list.py
Last active July 20, 2021 00:27
Reverse a linked list implemented in python3
#!/usr/bin/env python
# 反转一个单链表。示例:
# 输入: 1 --> 2 --> 3 --> 4 --> 5 --> None
# 输出: 5 --> 4 --> 3 --> 2 --> 1 --> None
from typing import Any, List, Optional
ListNode = Optional["Node"]
def isAuthenticated(User u) {
try {
return u.impersonate().isAuthenticated()
}
// Users pulled from SCM history e.a. are not GUI users
catch (org.acegisecurity.userdetails.UsernameNotFoundException xc) {
return false
}
}