Question about Prophet Sulaiman's baby story?
Keep in mind first that i'm not an expert.
I used to be a Muslim, when i was a child, me and my friends used to hanged out in a local library. We read the prophet's story, and the religious book, etc.
One day, one of my friend showed me a story about a king trying to solve a story on two mothers disputing over custody of a baby, claiming to be hers. The king, eventually choose to try to cut, or pull the baby, can't remember exactly.
One of the mother then stopped the king, and gave the custody to the other mother, which in turn prompt the king to decide that the kind mother is the real mother and gave the custody to her.
We were like "wow, why is this story so familiar with Prophet Sulaiman's story?", but the book is clearly Hindus/Buddhist, which was pretty crazy for us at the time.
What is the scholary consensus on the origin of the story? Is it originally Jewish or Hindu/Buddhist? Not sure whether to ask this in here or r/academicbiblical.