@simontiger/

todo_queue

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.2369454221191376","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"Y2xhc3MgTm9kZToNCiAgZGVmIF9faW5pdF9fKHNlbGYsIGRhdGEsIG5leHRfKToNCiAgICBhc3NlcnQgaXNpbnN0YW5jZShuZXh0XywgTm9kZSkgb3IgbmV4dF8gPT0gTm9uZQ0KICAgIHNlbGYuZGF0YSA9IGRhdGENCiAgICBzZWxmLm5leHQgPSBuZXh0Xw0KDQpjbGFzcyBMaW5rZWRMaXN0Og0KICBkZWYgX19pbml0X18oc2VsZik6DQogICAgc2VsZi5oZWFkID0gTm9uZQ0KICANCiAgZGVmIHVuc2hpZnQoc2VsZiwgZGF0YSk6DQogICAgc2VsZi5pbnNlcnQoZGF0YSwgMCkNCg0KICBkZWYgaW5zZXJ0KHNlbGYsIGRhdGEsIGlkeCk6DQogICAgaWYgbm90IHNlbGYuaGVhZDoNCiAgICAgIA=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Node:
  def __init__(self, data, next_):
    assert isinstance(next_, Node) or next_ == None
    self.data = data
    self.next = next_

class LinkedList:
  def __init__(self):
    self.head = None
  
  def unshift(self, data):
    self.insert(data, 0)

  def insert(self, data, idx):
    if not self.head: