# Open Kattis Problems’ Solutions in Python (TRIVIAL and EASY Questions)

Kattis Problems’ Solutions: Kattis Problem Archive contains hundreds of interesting competitive programming questions. Solving these problems can be fun and challenging at times. Here in my college, students use this platform to improve their programming skills and prepare for programming contests.

Here are some of the solutions to these problems I have tried solving. All the solutions shared here are accepted solutions. I hope these solutions would give you tips to solve these questions.

Note: The solutions here are the solutions for question Difficulty level TRIVIAL and EASY only.

# Kattis Problems’ Solutions

## Problem: ABC

Sample Solution:

```array=list(map(int,input().split()))
ar_sorted =  sorted(array, key=int)
string = input()
if string == 'ABC':
print(ar_sorted)```

## Problem: Apaxiaaaaaaaaaaaans

Sample Solution:

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

## Problem: Bijele

Sample SOlution:

```needed = [1,1,2,2,2,8]
have   = [int(x) for x in input().split()]

difference = []
for i in range(len(needed)):
difference.append(needed[i] - have[i])

print(" ".join([str(x) for x in difference]))```

## Problem: Datum

Sample Solution:

```import calendar
import datetime
a = [int(x) for x in input().split()]
d = a
m = a
def findDay(date):
born = datetime.datetime.strptime(date, '%d %m %Y').weekday()
return (calendar.day_name[born])
date = "{} {} 2009".format(d, m)
print(findDay(date))```

## Problem: Modulo

Sample Solution:

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

## Problem: Number Fun

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:
print("possible")
else:
print("impossible")
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], a[i], a[i])

```

## Problem: Sibice

Sample Solution:

```import math

n, w, h = [int(q) for q in input().split()]
hyp = math.sqrt(w*w + h*h) + 0.01

for _ in range(n):
if int(input()) < hyp:
print('DA')
else:
print('NE')```

## Problem: Detailed Differences

Sample Code:

```num = int(input())
a = []
for i in range(num):
str1 = input()
str2 = input()
for j in range(len(str1)):
if str1[j]==str2[j]:
a.append(".")
else:
a.append("*")
print(str1)
print(str2)
print("".join(a))```

## Problem: Nasty Hacks

Sample Code:

```n = int(input())
for i in range(n):
x = [int(y) for y in input().split()]
r = x
e = x
c = x
if r == e-c:
print("does not matter")
elif r < e - c:
else:

## Problem: Cryptographer’s Conundrum

Sample Code:

```cypher = input()
per = "PER"
count = 0
for i in range(len(cypher)):
if cypher[i] != per[i%3]:
count +=1
print(count)```