View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem type

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

Input Specification

The first line of input contains a single integer N (1 \le N \le
1\,000) 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 Specification

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.

Sample Input


Sample Output



  • 0
    x_Sunnybr0G_x  commented on July 27, 2021, 12:49 p.m.

    Can someone see what is wrong with my code? I tried accounting for spaces but it is still wrong.

    • 0
      Badmode  commented on July 27, 2021, 2:21 p.m.

      What if the string started with spaces?

      • 0
        x_Sunnybr0G_x  commented on July 27, 2021, 8:27 p.m.

        Been workin through it and now it gives an error. So confused

  • 0
    mahes0640  commented on Jan. 21, 2021, 12:51 p.m.

    Can anyone see why my code is wrong?

    • 0
      julian33  commented on Jan. 21, 2021, 3:58 p.m.

      consider spaces

  • 3
    dev405  commented on Jan. 3, 2021, 10:03 a.m. edit 2

    Good challenge. I only need over 60 submissions.

  • 0
    PerfectlyInternal  commented on Oct. 20, 2020, 5:46 p.m.

    I've tested my code and it seems to work just fine, but I keep failing tests 9 and 10, why is this? I tried handling cases where M is 0 and it didn't change. Is M negative in some cases?

    • 2
      kresteodymium  commented on Feb. 5, 2021, 4:08 p.m.

      I faced the same issue but @charliezhao06's comment opened my eyes lol

    • 6
      charliezhao06  commented on Oct. 20, 2020, 8:07 p.m.

      Did you consider if the string has spaces in it?

      • 18
        ross_cleary  commented on Oct. 20, 2020, 9:05 p.m.

        Massive brain.