The novel Tom Sawyer, Detective was written by Mark Twain in 1896. It is
a continuation of Tom Sawyer Abroad (1876), The Adventures of
Huckleberry Finn (1884), and The Adventures of Tom Sawyer (1876).
(1894). In this parody of the wildly famous detective novels of the day,
Tom Sawyer tries to investigate a mysterious murder. The story is
recounted in Huck Finn's first-person narrative style, just like in
Adventures of Huckleberry Finn. The plot of the novel, according to a
1909 accusation made by Danish schoolteacher Valdemar Thoresen in an
essay published in the magazine Maaneds, was lifted verbatim from Steen
Blicher's short story The Vicar of Weilby. Twain's secretary sent a note
to Mr. Thoresen explaining that Mr. Clemens had not read the book you
mentioned or any translations or adaptations of it that he was aware of.
Blicher's work had been translated into German but not English.
Twain/Clemens had the same right to utilize the subject matter as
Blicher because it predated Blicher (the 1626 trial of Pastor Sren
Jensen Quist of Vejlby).