Lets check out the third problem listed on the Leetcode website! Problem Analysis The task is to find the length…