Oracle interview question

Regex matching (leetcode)