A whodunit is a complex plot-driven variety of detective fiction in which the puzzle regarding who committed the crime is the main focus.