Problem Statement:
Write a program to find the index of the first occurrence of a specific character ch in the given string Str.
Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings anywhere in the program, as these contribute to the standard output, and test cases will fail.
Constraints:
Input Format:
Output Format:
Sample Input 1:
Eluid
u
Sample Output 1:
2
Explanation 1:
Given, Str = "Eluid". The first occurrence of a specific character ch 'u' is 2, which is printed as the output.
Problem Statement:
(Derived from the provided Input/Output specification)
You are given an m \times n matrix. Your task is to target a specific element at a given row index i and column index j, and increase its value by adding a given integer P. Output the newly updated value of that specific matrix element.
Input Format:
Output Format:
Sample Input 1:
3 2
3 4
16 8
21 89
1 1
500
Sample Output 1:
508
Explanation 1:
The given matrix is:
i \ j | 0 | 1 |
0 | 3 | 4 |
1 | 16 | 8 |
2 | 21 | 89 |
The element at the position M[1][1] = 8, so adding 500 (i.e., 8 + 500) to it, it will become 508.