Ok, I won't give you the answer directly since that'd be harmful to your learning. I'll ask 3 questions instead - try to answer them:-
How can you turn a number into a list of "digits".
How can you check if a "digit" is odd?
How do you "drop" certain elements of a list that match a criteria? (hint: filter)
You'll notice the quotes I put around the word "digits". I generally prefer using Char for "digits". But one may just as well use Int. Whichever you use, your answers will depend on it.
Ok, I won't give you the answer directly since that'd be harmful to your learning. I'll ask 3 questions instead - try to answer them:-
You'll notice the quotes I put around the word "digits". I generally prefer using
Char
for "digits". But one may just as well useInt
. Whichever you use, your answers will depend on it.You can use recursion too :
Thanks man
Thankyou so much, I got it right!!!!!