6. Example
Question:
Find the
Pattern
The pattern challenge is back again with more complexity. Can you
solve it??
Input 1:
3
2224 5262 223
Output 1:
5485
Input 2:
11
170 368 472 298 22 139 370 1061 162 1073 491
Output 2:
1095
9. Run Time
Error
(SIGSEGV)
This is an error caused by an invalid memory
reference or segmentation fault. The most
common causes are accessing an array
element out of bounds or using too much
memory.
When the memory assigned is not enough to
store the input then also we get segmentation
fault
Let us understand this with an example
10. Greatest String
You are given a string S and an integer Q. You are
allowed to perform at most Q operations on the
string. In one operation, you can change
any vowel to it's next character
(e.g., 'a'->'b', 'e'->'f', 'i'->'j', 'o'->'p', 'u'->'v').
Length of the string
can be up to 100000
11. Error: Time Limit
and Segmentation
fault
Violating the constraint that
Length of the string can be up
to 100000 leads to
segmentation fault.
In finte loop without break
leads to Time limit exceeded
error
12. Another Example for Segmentation
fault and wrong answer
Question:
Shreya and Non-
Palindrome (Hacker
Earth)