Submit solution
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
32M
Authors:
Problem type
Allowed languages
Python
Problem Statement
Given a string and a target character , return the first occurence(0-index) of in . If is not in then return -1.
Input Specification
The first line of the input gives the number of test cases, , test cases follow. Each test case consists of a line. The line contains a string and a target character seperated by a space. The string will contain only uppercase and lowercase English letters.
Limits
Memory limits: 32MB.
Time limits: 1 second.
Test Set 1
Sample Case.
Test Set 2
Test Set 3
Test Set 4
Output Specification
For each test case, output one line containing Case #x: y
, where is the case number(starting from 1) and is the position of character in .
Sample Input
2
ABC C
HelloWorld A
Sample Output
Case #1: 2
Case #2: -1
Hint
`find()` `linear search`
Comments