ICode9

精准搜索请尝试: 精确搜索
  • 5. 最长回文子串2022-01-31 01:32:20

    给你一个字符串 s,找到 s 中最长的回文子串   s = "abcddcboa" list1 = list(s) list2 = list(reversed(list1)) def test(s,max_lengh): list1 = list(s) list2 = list(reversed(list1)) if s and list1==list2 and len(s)!=1: if len(s) not in max_le

  • 4. 寻找两个正序数组的中位数2022-01-31 01:02:33

    给定两个大小分别为 m 和 n 的正序(从小到大)数组 nums1 和 nums2。请你找出并返回这两个正序数组的 中位数 。 算法的时间复杂度应该为 O(log (m+n))   nums2 = [1,] nums1 = [54,78,90,] def test(nums): lengh = len(nums) if lengh % 2 == 0: index = [lengh

  • 3. 无重复字符的最长子串2022-01-30 20:31:37

    给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 s = "pwwkew" max_lengh = 0 for it in range(len(s)): temp = [] temp.append(s[it]) for item in s[it+1:]: if item in temp: break else: temp.ap

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有