Exercise: Arrays Advanced - 6. Bomb Numbers
Здравейте колеги,
Решавам задачата и смятам, че съм описал всички гранични случаи, но judge връща 60/100, заради 2 от тестовете със state "Runtime error". Моля да погледнете кода ми и да ми кажете къде бъркам.
Ето и условието на задачата:
6. Bomb Numbers
Write a function that receives two parameters: sequence of numbers and special bomb number with a certain power.
Your task is to detonate every occurrence of the special bomb number and according to its power his neighbors from left and right. Detonations are performed from left to right and all detonated numbers disappear.
The input contains two arrays of numbers. The first contains the initial sequence and the second contains the special bomb number and its power.
The output is the sum of the remaining elements in the sequence.
Моето решение: https://pastebin.com/4dzF1UxL
Благодаря Ви за своевременният и професионален отговор. По-точен едва ли бих могъл да очаквам.