The Wrath and the Dawn by Renée Ahdieh
"Every dawn brings new horror to a different family in a land ruled by a killer. Khalid, the eighteen-year-old Caliph of Khorasan, takes a new bride every night only to have her executed at sunrise. So it is a suspicious surprise when sixteen-year-old Shahrzad volunteers to marry Khalid. But she does so with a clever plan to stay alive and exact revenge on the Caliph for the murder of her best friend and countless other girls. Shazi's wit and will, indeed, get her through to the dawn that no others have seen, but with a catch...she's falling in love with the very boy who killed her dearest friend.
She discovers that the murderous boy-king is not all that he seems and neither are the deaths of so many girls. Shazi is determined to uncover the reason for the murders and to break the cycle once and for all."
If you liked this book, try these:
A Thousand Nights by E.K. Johnston
Illuminae by Amie Kaufman
Six of Crows by Leigh Bardugo
Crimson Bound by Rosamund Hodge
A Book of Spirits and Thieves by Morgan Rhodes