Homework8

pdf

School

University of California, Irvine *

*We aren’t endorsed by this school

Course

253P

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

3

Uploaded by CountOryxPerson1070

Report
1. Longest Palindromic Substring (Medium) TestCase 1: Input: s = "babad" Output: "bab" TestCase 2: Input: s = "cbbd" Output: "bb" Edgecases: Input: s = "abcdedcba" Output: "abcdedcba" Time Complexity: O(N^2) Space Complexity: O(1) Code:
Submission: 2. Maximum Length of Repeated Subarray (Medium) TestCase 1: Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7] Output: 3 TestCase 2: Input: nums1 = [0,0,0,0,0], nums2 = [0,0,0,0,0] Output: 5 Edgecases: Input: nums1 = [1, 2, 3, 4, 5], nums2 = [0, 2, 3, 4, 6] Output: 3 Time Complexity: O(m*n) Where m is length of num1 and n is length of num2 Space Complexity: O(m*n) Code:
Submission:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help