CPP || easy to understand || simulation
Code\n\nclass Solution \n{\npublic:\nset<int>st;\nint findPoisonedDuration(vector<int>& arr, int duration) \n{\n    for(int i=0;i<arr.size();i++)\n    {\n      
# Code\n```\nclass Solution \n{\npublic:\nset<int>st;\nint findPoisonedDuration(vector<int>& arr, int duration) \n{\n    for(int i=0;i<arr.size();i++)\n    {\n       st.insert(arr[i]);\t\n\t}\n\tint count=0;\n\t\n\tfor(auto t : st)\n\t{\n\t\tint start_time = t;\n\t\tint temp=0;\n\t    \n\t    while(temp <= (duration -1))\n\t    {\n\t    \tif((start_time + temp)==start_time or st.find(start_time + temp)==st.end())  //poisenod for this second\n\t    \t{\n\t    \t\tcount++;\n\t\t\t}\n\t\t\telse if(st.find(start_time + temp) != st.end()) //new start_time found\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttemp++;\n\t\t}\n\t}\n\treturn count;\n} \n};\n```
['Array', 'Simulation', 'C++']