summaryrefslogtreecommitdiff
path: root/comp
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-05-01 12:07:41 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-05-01 12:07:41 +0000
commit10d3793dd58f5c85e9a1be331afc3a08922c0f38 (patch)
treebdee1f883b6d03abbba8a79260422267c2fa1f15 /comp
parent32b9a010a24570a131cc5c9521b8e76102e9cd38 (diff)
woowwwwwwwwwwwwwwwwww
Diffstat (limited to 'comp')
-rw-r--r--comp/work/55/rle.py28
-rw-r--r--comp/work/56/starter25
2 files changed, 30 insertions, 23 deletions
diff --git a/comp/work/55/rle.py b/comp/work/55/rle.py
index c2c43da..a8c88ea 100644
--- a/comp/work/55/rle.py
+++ b/comp/work/55/rle.py
@@ -1,30 +1,12 @@
def rle(s):
- en = ""
- c = s[0]
- cc = 0
+ en, c, cc = "", s[0], 0
for i in s:
if i == c: cc += 1
else:
- en += (c if (cc == 1) else str(cc) + c)
- c = i
- cc = 1
- en += (c if (cc == 1) else str(cc) + c)
+ en += (c if (cc == 1) else c + str(cc))
+ c, cc = i, 1
+ en += (c if (cc == 1) else c + str(cc))
return en
-def rld(s):
- de = ""
- cc = ""
- c = ''
- for i in s:
- if i.isdigit(): cc += i
- else:
- c = i
- if not cc.isdigit(): cc = "1"
- de += c * int(cc)
- cc = ""
-
- return de
-
-
-print(rld(rle("abbbcccd")))
+print(rle("abbbcccd"))
diff --git a/comp/work/56/starter b/comp/work/56/starter
new file mode 100644
index 0000000..7915931
--- /dev/null
+++ b/comp/work/56/starter
@@ -0,0 +1,25 @@
+---------------------------
+insert into Sales
+values (
+ 4072,
+ 48,
+ "29/9/2024"
+)
+
+2 marks
+---------------------------
+
+---------------------------
+update Product
+set quantity = quantity - 3
+where ProductID = 1
+---------------------------
+
+---------------------------
+SOMETHING
+---------------------------
+
+---------------------------
+slow
+
+---------------------------