From db07388ee7ce585155732966ad824bf60df66338 Mon Sep 17 00:00:00 2001 From: Shvetsov Nikolai Date: Sat, 25 Apr 2026 09:01:49 +0300 Subject: [PATCH] bigbob --- goga2/testik.py | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 goga2/testik.py diff --git a/goga2/testik.py b/goga2/testik.py new file mode 100644 index 0000000..cc1e191 --- /dev/null +++ b/goga2/testik.py @@ -0,0 +1,68 @@ +# def compress_string(s: str) -> str: +# result="" +# count=1 + +# for i in range(1, len(s)): +# if s[i] == s[i - 1]: +# count += 1 +# else: +# result += s[i - 1] +# if count > 1: +# result += str(count) +# count = 1 +# result+=s[-1] +# if count > 1: +# result+=str(count) +# return result + +# if __name__ == "__main__": +# # print(compress_string('aaabbbbbccddddddddrrraaaa')) +# ===================================== +# def is_armstrong(n: int) -> bool: +# digits=str(n) +# power=len(digits) +# total=0 + +# for digit in digits: +# total += int(digit)**power +# return total == n + +# if __name__ == '__main__': +# print(is_armstrong(160)) +# print('=================') +# print(is_armstrong(153)) +# ================================ +# def interseption_of_sorted(a: list, b: list) -> list: +# return sorted(set(a) & set(b)) + +# if __name__ == '__main__': +# print(interseption_of_sorted([1, 1, 1, 2, 3, 4, 5],[1, 5, 2, 3, 45, 5])) +# ============================= +# def remove(s: str) -> str: +# seen=set() +# result="" + +# for i in s: +# if i not in seen: +# seen.add(i) +# result+=i +# return result +# if __name__ == "__main__": +# print(remove('bebebebeaaaassdsdsad')) +# ================================ +# def most_frequent(d: dict) -> tuple: +# count={} +# for value in d.values(): +# count[value]=count.get(value, 0)+1 +# best_value=max(count, key=count.get) +# return best_value, count[best_value] + +# if __name__ == "__main__": +# print(most_frequent({'a': 4, 'b': 4, 'c': 4, 'g': 3})) +def gcd(a: int, b: int) -> int: + while b!=0: + a, b = b,a%b + return a + +if __name__=='__main__': + print(gcd(121, 11)) \ No newline at end of file