# 2523. Mispelling

## Problem code: GNY07A

Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string.

### Input

The first line of input contains a single integer N (1 ≤ N ≤ 1000) which is the number of datasets that follow.

Each dataset consists of a single line of input containing M, a space, and a string made up of uppercase letters and spaces only. M will be less than or equal to the length of the string. The length of the string is guaranteed to be less than or equal to 80.

### Output

For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled string. The misspelled string is the input string with the indicated character deleted.

4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON

### Sample Output

1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON

Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

• (1/1)
my code gave the right outputs on my computer but I get RE when I submit? And what's a decimal integer...?

• (1/0)
2. Here, "decimal" refers to the numerical base--contrast with octal, or hexadecimal. Decimal means base 10, so just use the normal numbers you're familiar with.

• (0/1)
Sorry for disturbing, but the judge is returning some runtime error and I cannot see the whole of it because it is getting clipped. Could you please check my code and tell me where I am going wrong. I am getting correct output on my machine though. :)

• (0/0)
Traceback (most recent call last):
File "a.out", line 5, in <module>
(snip)
ValueError: too many values to unpack

• (1/0)
the input though...

• (0/0)
Can someone check out my code please. I get 90/100 and right now I am at lost as to where the error might be. Thanks for any help.

• (0/0)
Read the question again. The only reason you're getting 90/100 instead of 20/100 is because the test data is a little weak :) Oops. Misread your code. Retracted.

• (0/0)
My test input:

10
4 MISSPELL
1 PROGRAMMING ASDF
7 CONTEST ASDF ASDF
3 BALLOON
11 HELLO BELLO HOWDY
5 WHAT IS THE
6 MEAINNIG BLABLA
15 BATMAN SUPERMAN
12 WOLOLOL LOLO
13 GOOAL A B C D

Output:
1 MISPELL
2 ROGRAMMING ASDF
3 CONTES ASDF ASDF
4 BALOON
5 HELLO BELL HOWDY
6 WHATIS THE
7 MEAINIG BLABLA
8 BATMAN SUPERMA
9 WOLOLOL LOL
10 GOOAL A B C

Sorry for beeing slow but I've read the problem quite a few times and tested it aswell, for example here is my test output, and I don't see what is wrong with it.

• (0/0)
When testing, it's often a good idea to try edge cases. What happens when the string is min (1) or max (80) length?

• (0/0)
Okay, thank you for the help, first thing tomorrow i'll put more thought into the edge cases! Thanks again!

• (1/0)
Ok, its me again... sorry for bothering again.
I've tried the cases you have mentioned. I think I'm getting the right output, though maybe the format is not good. Can you take a look at it?

My Input:
6
4 MISSPELL
1 P
3 EGY JETTO
7 CONTEST ASDF ASDF
3 BALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONO
1 W

Output:

1 MISPELL
2
3 EG JETTO
4 CONTES ASDF ASDF
5 BALOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONO
6

• (0/0)
Your output format is fine; your output is just wrong (though not for those cases). You're still missing an edge case. :)

• (0/1)
My code is returning correct outputs in the above cases and the submitted test case. However, it still says it is 60/100.

• (1/0)
Try coming up with some of your own cases. In particular make one or two with longer strings and larger values of n. The issue will become clear.

• (0/0)
I'm not sure what's wrong

• (0/0)
Each dataset consists of a single line of input containing M, a space, and a string made up of uppercase letters and spaces only.

• (0/0)
My code works perfectly with the test cases, and the one with the spaces mentioned above in the comments. However, I am getting a score of 0. Any reasons as to why this is?

• (1/0)
1 null COLUR

1 COLOR

You should also read these guidelines -- specifically, the important note.

• (0/0)
It's likely that you're doing Something Bad that is corrupting memory and giving you the nulls. In particular, in one case your output contains no space at all, which looks impossible given your code... right?

• (0/1)
Thanks guys. I pasted my code instead of submitting the file, and it worked. I got 100/100.

• (0/1)
I submitted the wrong file (2 a1.java files). Sorry!

• (0/0)
So you've said that the input string will contain spaces. Does that mean we should include the space as a char to remove or just take the first word before the space?

• (1/0)
A test case may be:
2
3 THIS IS A TEST
5 JUST CHECKING

for which the output would be:
1 THS IS A TEST
2 JUSTCHECKING

• (0/0)
alright thanks I got it now.

• (0/0)
Quote: Each dataset consists of a single line of input containing M, a space, and a single word made up of uppercase letters only.

Isn't the input string only can be a single word which means it cannot be a phrase, so statements like "the input string may contain spaces" doesn't make sense?

• (0/0)
That's an error in the problem statement that has yet to be fixed. The input will include spaces.

• (0/0)