Extension function in Koltin is the function which can be declared in the current class/file without…