Assignment 1: Problem Solving Example

Unit 1 > Assignment 1 > problem solving


Let's start with some visualization:

 

A1.1 Exercise: Write up the above in my_demo_problem1.py. Test it with different lengths. Explain in your assignment1.pdf.
 

 

How do we compare the triple beginning at i in the first list against the triple beginning at j in the second list?

 

A1.2 Exercise: Complete the other conditions in the if-statement in my_demo_problem2.py. And also complete the print statement.
 

Finally, we need to account for the case when no such triple is found.
 

A1.3 Exercise: When do we know for sure that no such triple exists? Complete the whole program in my_demo_problem3.py. Explain how you solved the latter issue (no such triple found) in assignment1.pdf.


© 2020, Rahul Simha