Area Under Curves and Volume of Revolving a Curve Discussions | Functional Programming | HackerRank
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.
The lambda pattern (\[a, b, [l, r]] -> solve l r a b) in the given IO code segment fails for test cases [2,3,4] due to them having extra unnecessary newline characters. Either the test cases need to be fixed or the pattern in the default IO code needs to be changed as the problem gives no hint at this kind of corner case and a perfectly working code fails at submission.
Area Under Curves and Volume of Revolving a Curve
You are viewing a single comment's thread. Return to all comments →
The lambda pattern
(\[a, b, [l, r]] -> solve l r a b)
in the given IO code segment fails for test cases [2,3,4] due to them having extra unnecessary newline characters. Either the test cases need to be fixed or the pattern in the default IO code needs to be changed as the problem gives no hint at this kind of corner case and a perfectly working code fails at submission.A simple fix for the lambda pattern is :
(\(a:b:[l, r]:_) -> solve l r a b)