Simplified approach
solved problem 4
Simplified problem 1
Simplified problem 2
Simplified problem 4
Solved problem 5
Solved problem 6