How does Huck scam the two con-artists?

In Mark Twain's novel "The Adventures of Huckleberry Finn," Huck Finn manages to scam the two con-artists, commonly known as "The Duke" and "The King." Here's how Huck accomplishes this:

1. Discovering their true intentions: Huck befriends the con-artists on his journey down the Mississippi River, and while initially he is fooled by their lies and disguises, he eventually realizes their true nature. He discovers that they are not who they claim to be, but rather dishonest men trying to deceive others for personal gain.

2. Witnessing their scams: As Huck spends more time with the Duke and the King, he witnesses their scams and manipulations firsthand. They engage in various cons, such as pretending to be a long-lost heir, organizing fake religious revivals, or putting on plays for money. Huck becomes increasingly disillusioned with their actions and wants to expose them.

3. Outsmarting them during the Royal Nonesuch: The Duke and the King plan their most audacious scam, putting on a play called "The Royal Nonesuch" in a small town. They charge exorbitant ticket prices, promising a grand show that turns out to be a humiliating farce. As the townspeople demand refunds, Huck quietly steals the money and escapes, leaving the con-artists empty-handed.

4. Planning the escape: Huck realizes that he needs to protect both himself and Jim, a runaway slave he is helping, from the con-artists' schemes. He helps Jim escape, and they both board a raft to continue their journey down the river. Huck decides to wait for the perfect opportunity to get rid of the con-artists.

5. The final scam on the steamboat: Huck's plan involves a steamboat accident that he learned about, which is heading downstream. Huck gathers information about the accident, and when they dock at a town, he tells the Duke and the King that a reward has been offered for the dead bodies found from the steamer crash. Panic-stricken, the con-artists abandon the raft, thinking they can collect the reward, and Huck successfully escapes their clutches.

By observing their scams, capitalizing on their greed, and utilizing his resourcefulness, Huck turns the tables and manages to scam the two con-artists, ultimately freeing himself from their influence.