Hi, I am looking for novels (or authors) which have the scenario of X number of people trapped in an environment with each member dying one after the other. Mostly, it is up to the protagonist(s) to become would be detectives to find the killer amongst them. I have looked for such novels for 6+ years now and I thought I would turn to the internet for help. Thanks

Other works for reference would be the movie "Identity" or "Kindachi Case Files"