CSES - HIIT Open 2018 - Results
Submission details
Task:HIIT Generation
Sender:Sloths
Submission time:2018-05-26 11:48:51 +0300
Language:Python3
Status:READY
Result:
Test results
testverdicttime
#1--details
#2--details
#3--details
#4ACCEPTED0.06 sdetails

Code

def replace(base,letter):
    base = str(base)
    length = len(base)
    for i in range(length):
        if base[i] == letter:
           result = base.replace(letter, "HIIT")
    return result

base_string = "HIIT"

n = int(input())

for i in range(n):
    letter = input()
    base_string = replace(base_string, letter)


print(base_string)


Test details

Test 1

Verdict:

input
17
I
I
I
I
...

correct output
HHHHHHHHHHHHHHHHHHIITHIITTHHII...

user output
(empty)

Test 2

Verdict:

input
333332
H
H
H
H
...

correct output
HIITIITIITIITIITIITIITIITIITII...

user output
(empty)

Test 3

Verdict:

input
24
H
T
H
T
...

correct output
HIIHIITIIHIIHIITIIHIITIIHIIHII...

user output
(empty)

Test 4

Verdict: ACCEPTED

input
0

correct output
HIIT

user output
HIIT