Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dan Romanski
6,044 PointsRecursive Functions and Realigning Strings
I am working on a problem dealing with recursive functions. The goal is to write a function that takes two strings, split them and piece them back together while alternating letter.
ex: 'dog' 'cat' would come back 'dcoagt'
and if one was shorter the longer word would just finish
ex: 'strong' 'dog' = 'sdtorgong'
I am not allowed to use any types of loops, string processing functions other than slicing, or global variables. I have started with setting my 'combo' variable in the function and have written the set of code that returns a blank string if both inputs are blank. Any advice for moving forward would be helpful.
Thanks!
2 Answers
Josh Keenan
20,315 PointsOn what site are you getting this challenge from? Or is it a homework task?
Josh Keenan
20,315 PointsWhat are you studying and where?! XD Never seen anything like that before for homework, i'll try it!
Josh Keenan
20,315 PointsI can do it, this is an awesome challenge!
Dan Romanski
6,044 PointsIt is tough for me just starting out. I understand the theory but am having difficulty understanding the process. I am working on my Masters in Predictive Analytics
Dan Romanski
6,044 PointsDan Romanski
6,044 PointsHey Josh, it is a homework task I am having trouble with.