Challenge 1: Length of a String

Given a string, find its length using recursion.

Problem Statement

Implement a function that takes a string testVariable and returns the length of the string.

Try to solve this problem using recursion.

Input

A variable testVariable that contains a string.

Output

The length of the input string.

Sample Input

"Educative"

Sample Output

9

Try it Yourself

Try this challenge yourself before examining the solution. Good luck!

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.