Skip to content

Commit e466cb5

Browse files
author
Amogh Singhal
authored
Update find_m_to_last_llist.py
1 parent abf715a commit e466cb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

find_m_to_last_llist.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Given a linked list, this method
2+
# will return m'th element to the last
3+
# 2->3->4->8->5; m=2 will return 8
4+
# since 8 is second to last
5+
16
def findMToLast(l_list, m):
27
current = l_list.head
38
count = 0

0 commit comments

Comments
 (0)