an HCL GUVI product

11. Longest Increasing Subsequence

Required Input:

10 9 2 5 3 7 101 18

Expected Output:

4

Code In Python

def lis_length(nums): # Write your code here pass # Predefined Input nums = [10, 9, 2, 5, 3, 7, 101, 18] # Output print(lis_length(nums))

Run Code?

Click Run Button to view compiled output

12. Jump Game

Required Input:

2 3 1 1 4

Expected Output:

True

Code In Python

def can_jump(nums): # Write your code here pass # Predefined Input nums = [2, 3, 1, 1, 4] # Output print(can_jump(nums))

Run Code?

Click Run Button to view compiled output

13. Wildcard Pattern Matching

Required Input:

adceb
*a*b

Expected Output:

True

Code In Python

def is_match(s, p): # Write your code here pass # Predefined Input s = "adceb" p = "*a*b" # Output print(is_match(s, p))

Run Code?

Click Run Button to view compiled output

14. Rod Cutting Problem

Required Input:

1 5 8 9 10 17 17 20
8

Expected Output:

22

Code In Python

def rod_cutting(price, n): # Write your code here pass # Predefined Input price = [1, 5, 8, 9, 10, 17, 17, 20] n = 8 # Output print(rod_cutting(price, n))

Run Code?

Click Run Button to view compiled output

15. Interleaving Strings

Required Input:

aabcc
dbbca
aadbbcbcac

Expected Output:

True

Code In Python

def is_interleave(s1, s2, s3): # Write your code here pass # Predefined Input s1 = "aabcc" s2 = "dbbca" s3 = "aadbbcbcac" # Output print(is_interleave(s1, s2, s3))

Run Code?

Click Run Button to view compiled output

16. Decode Ways

Required Input:

226

Expected Output:

3

Code In Python

def decode_ways(s): # Write your code here pass # Predefined Input s = "226" # Output print(decode_ways(s))

Run Code?

Click Run Button to view compiled output

17. Palindromic Substrings

Required Input:

aaa

Expected Output:

6

Code In Python

def count_palindromes(s): # Write your code here pass # Predefined Input s = "aaa" # Output print(count_palindromes(s))

Run Code?

Click Run Button to view compiled output

18. Egg Dropping Problem

Required Input:

Fri Feb 06 2026 00:00:00 GMT+0530 (India Standard Time)

Expected Output:

2

Code In Python

def egg_drop(e, f): # Write your code here pass # Predefined Input e, f = 2, 3 # Output print(egg_drop(e, f))

Run Code?

Click Run Button to view compiled output

19. Job Scheduling for Max Profit

Required Input:

1 2 3
3 4 5
5 6 6

Expected Output:

11

Code In Python

def job_scheduling(jobs): # Write your code here pass # Predefined Input jobs = [ [1, 3, 5], [2, 4, 6], [3, 5, 6] ] # Output print(job_scheduling(jobs))

Run Code?

Click Run Button to view compiled output

20. Longest Palindromic Subsequence

Required Input:

bbbab

Expected Output:

4

Code In Python

def lps(s): # Write your code here pass # Predefined Input s = "bbbab" # Output print(lps(s))

Run Code?

Click Run Button to view compiled output

2 of 3