Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ASSIGNMENT 03

CS14950
Instructions:
1. This paper has 4 questions. Attempt all.
2. You must submit individual code files for every question. Your files should be
named as follow:
<Your_Roll_No.>_CS14950_<AsgnNo>_<Question_Number>.py
For example: 21PY124_CS14950_Asgn03_Q2a.py
3. You must submit the code file in the following link:
www.CS14950_A1.com
Topic: Arrays
Question 01:[10+2(Bonus)]
Given a list of integers, L find the length of the largest strictly increasing
subsequence.
Input: [1,2,5,89,5,6,1,4,5,8,6,2,5,7]
Output: 4
[Bonus/Optional]For the same question also print the subsequence.
Input: [1,7,5,89,5,6,1,4,5,8,23,2,5,7]
Output: [1,4,5,8,23]

Question 02: [10+2(Bonus)]


Given two lists find whether they follow a common pattern.
Sample:
Input:
[1,2,2,3,5,1,4,2,5,3]
[f,k,k,c,d,f,y,k,d,c]
Output:
True
[Bonus/Optional] For the same question also print a dictionary as to what
corresponds to what value.
Input:
[1,2,2,3,5,1,4,2,5,3]
[f,k,k,c,d,f,y,k,d,c]
Output:
{1:f,2:k,3:c,4:y,5:d}

You might also like