Conversion of Looping to Recursive Solution
问题 I have written a method pythagoreanTriplets in scala using nested loops. As a newbie in scala, I am struggling with how can we do the same thing using recursion and use Lazy Evaluation for the returning list(List of tuples). Any help will be highly appreciated. P.S: The following method is working perfectly fine. // This method returns the list of all pythagorean triples whose components are // at most a given limit. Formula a^2 + b^2 = c^2 def pythagoreanTriplets(limit: Int): List[(Int, Int,