I am working on a programming prompt, I want you to give me a general approach to solving it. Like a step-by-step process. I don't want you to provide the actual code, just the steps or things to think about when solving it.
Here is the prompt for the question:

You are given a string of words and numbers. Extract the expression including:

1. the operator: either addition ("gains") or subtraction ("loses")
2. the two numbers that we are operating on
Return the result of the calculation.

Notes:

"loses" and "gains" are the only two words describing operators
No fruit debts nor bitten apples = The numbers are integers and no negatives

"Panda has 48 apples and loses 4"  -->  44
"Jerry has 34 apples and gains 6"  -->  40
system
main ek programing prompt par kaam kar rahaa hum, main chahta hum ki aap mujhe ise hal karne ke liye ek saamaanya drushtikon den.ek kadam-dar-charan prakriya kii tarah.main nahin chahta ki aap vaastavik code pradaan karen, bas ise hal karte samay sochane ke liye kadam yaa chijen.
yahan prashn ke liye sanket he:

aapako shabdon or sankhyaon kaa ek taar diya jaataa he.sahit abhivyakti nikaalen:

1. oparator: yaa to iske alaava ("laabh") yaa ghataav ("haar")
2. jin do sankhyaon par ham kaam kar rahe hai
gananaa kaa parinaam lautaaen.

tippaniyan:

"haar" or "laabh" keval do shabd hai jo operataron kaa varnan karte hai
koi fal rin nahin or na hi kaate hue seb = sankhyaayein purnank hai or koi nakaaratmak nahin he

"pandas main 48 seb hai or 4 kho detaa he" -> 44
"jeri main 34 seb or laabh 6 hai" -> 40
user
yah samasya mukhya rup se ek shabd prasanskaran samasya he.is samasya ko hal karte samay aapako yahaan kadam or chijen dhyaan main rakhni chahie.
1.) is bare main sochen ki aap data ko pars karne ke liye input ko kaise vibhajit karne ja rahe hai.
2.) aap kis kiward kii talash kar rahe hai?keval oparator jinhen aap dhund rahe hai, ve "laabh" or "haar" hai.
3.) input ko vibhajit karne ke baad aap sankhya kaise nikaalenge?

sankhyaon kaa kram bhi dhyaan rakhen, kyonki input nakaaratmak nahin ho saktaa he.

aashaa he ki yah madad karata he, mujhe bataaen ki kya aapako adhik sahaayta kii aavashyaktaa he.
assistant
<|system|>
</s>
<|user|>
main ek programing prompt par kaam kar rahaa hum, main chahta hum ki aap mujhe ise hal karne ke liye ek saamaanya drushtikon den.ek kadam-dar-charan prakriya kii tarah.main nahin chahta ki aap vaastavik code pradaan karen, bas ise hal karte samay sochane ke liye kadam yaa chijen.
yahan prashn ke liye sanket he:

aapako shabdon or sankhyaon kaa ek taar diya jaataa he.sahit abhivyakti nikaalen:

1. oparator: yaa to iske alaava ("laabh") yaa ghataav ("haar")
2. jin do sankhyaon par ham kaam kar rahe hai
gananaa kaa parinaam lautaaen.

tippaniyan:

"haar" or "laabh" keval do shabd hai jo operataron kaa varnan karte hai
koi fal rin nahin or na hi kaate hue seb = sankhyaayein purnank hai or koi nakaaratmak nahin he

"pandas main 48 seb hai or 4 kho detaa he" -> 44
"jeri main 34 seb or laabh 6 hai" -> 40</s>
<|assistant|>
yah samasya mukhya rup se ek shabd prasanskaran samasya he.is samasya ko hal karte samay aapako yahaan kadam or chijen dhyaan main rakhni chahie.
1.) is bare main sochen ki aap data ko pars karne ke liye input ko kaise vibhajit karne ja rahe hai.
2.) aap kis kiward kii talash kar rahe hai?keval oparator jinhen aap dhund rahe hai, ve "laabh" or "haar" hai.
3.) input ko vibhajit karne ke baad aap sankhya kaise nikaalenge?

sankhyaon kaa kram bhi dhyaan rakhen, kyonki input nakaaratmak nahin ho saktaa he.

aashaa he ki yah madad karata he, mujhe bataaen ki kya aapako adhik sahaayta kii aavashyaktaa he.</s>
