Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In haskell Write a function mostOdds :: [[Int]] -> [Int]. It will takes a list of lists of integers, and will return that list of

image text in transcribed

In haskell

Write a function mostOdds :: [[Int]] -> [Int]. It will takes a list of lists of integers, and will return that list of integers that contains the most number of odd numbers. For example, in the below case, the second list, [11,15,10,17], contains 3 odd numbers, while the first list contains only one, and the third list contains only two. *Main> mostOdds [[1,10,20,30,40],[11,15,10,17] , [77,4,4,11]] [11,15,10,17] Your function must not use recursion. You should use at least one of map, filter, and foldi. You may also want to use length. You may write an additional helper function, if appropriate. If the input contains more than one list with the most number of odds, you may return any one of them. You may assume that the input list is nonempty

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

=+4 How does one acquire a global mindset?

Answered: 1 week ago