Stub generator input giving error

I’m contributing a classic (IN/OUT) puzzle, all my test cases are becoming red when I press try in IDE, here are some:

4
4
2
COOL
CODE
CRKP
OOPW
OLDE
LGDE

this one says: Mismatch with the stub generator input: Invalid number of variables. Expected: '2'. Received: '1'

6
6
3
SEARCH
FOR
WORDS
SQWWER
ETFORY
AUIROP
RASDFG
CHJSKL
HZXCVB

and this: Mismatch with the stub generator input: Invalid number of variables. Expected: '4'. Received: '1'

here is the stub generator:

read H:int
read W:int
read N:int
loopline N word:word(W)
loopline H line:word(W)

loopline is for looping over a number of space-separated variables in the same line.
You need loop instead of loopline if you are looping over variables in separate lines.

1 Like