We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Great learning experience on this challenge!! I'm new to Scala and completed this challenge in 30 lines of Scala code (not including comments). Really liking Scala right now..
Spoiler Alert
I did it by recursively "folding" top half of each triangle down on top of itself and checking for double '1's in the bottom "folded" triangles. Turned those with double '1's into underscores. I leave the top half un-touched. There is probably a more effecient. I may try to re-attempt this at some point.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Functions and Fractals: Sierpinski triangles
You are viewing a single comment's thread. Return to all comments →
Great learning experience on this challenge!! I'm new to Scala and completed this challenge in 30 lines of Scala code (not including comments). Really liking Scala right now..
Spoiler Alert
I did it by recursively "folding" top half of each triangle down on top of itself and checking for double '1's in the bottom "folded" triangles. Turned those with double '1's into underscores. I leave the top half un-touched. There is probably a more effecient. I may try to re-attempt this at some point.