Fix the problem 6

write test cases for problem 6 
change the result for empty case from 0 to false
change "or" in the cons? case to "and"