Question: In Haskall, Create a function named 2a that uses a list comprehension. The function will take a single integer parameter n . Find every number
In Haskall, Create a function named 2a that uses a list comprehension. The function will take a single integer parameter n. Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 7. Do not user a helper function.
The below is the code I have but it fails to load and I have no idea how to check if a number starts with 7.
2a :: Int -> Int -> [Int]
2a n = [n | n <-[1..n], n == reverse n]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
