Open Kattis Problems’ Solutions in Python

Problem: ABC

Problem Link:

Sample Solution:

ar_sorted =  sorted(array, key=int)
string = input()
if string == 'ABC':


Problem: Apaxiaaaaaaaaaaaans

Problem Link:

Sample Solution:

oldstring = input()
newstring = oldstring[0]
for char in oldstring[1:]:
    if char != newstring[-1]:
        newstring += char


Problem: Modulo

Problem Link:

Sampe Solution:

a = []
b = 0
for i in range(10):
    mod = a[i][0] % 42 
    if mod != a[i+1][0] % 42:


Problem: Number Fun

Problem Link:

Sample Solution:

def arith(a, b, c):
    if a+b==c or a*b==c or a-b==c or b-a==c or a/b==c or b/a == c:
a = []
n = int(input()) 
for i in range(n):
    a.append([int(j) for j in input().split()])

for i in range(n):
    print(a[i][0], a[i][1], a[i][2])


Sonam Dargay

Kuzu Zangpo la! I am Sonam Dargay, a student in College of Science and Technology affiliated to The Royal University of Bhutan. I am an enthusiast student studying bachelors degree in information technology engineering.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: