当前位置: 首页 > news >正文

哪个网站可以做司考题seo外包公司哪家专业

哪个网站可以做司考题,seo外包公司哪家专业,如果只做p2p种子搜索网站,河南有名的做网站公司题目1:最大连续1的个数(简单) 给定一个二进制数组 nums , 计算其中最大连续 1 的个数。 解答:前缀和双指针 # 给定一个二进制数组 nums , 计算其中最大连续 1 的个数。 from typing import Listclass So…

题目1:最大连续1的个数(简单)

给定一个二进制数组 nums , 计算其中最大连续 1 的个数。

解答:前缀和+双指针

# 给定一个二进制数组 nums , 计算其中最大连续 1 的个数。
from typing import Listclass Solution:def findMaxConsecutiveOnes(self, nums: List[int]) -> int:idx_1 = []count_0 = [0] * len(nums)for i in range(len(nums)):if nums[i] == 1:idx_1.append(i)count_0[i] = i - len(idx_1) + 1left = 0right = 0max_len_1 = 0while right < len(idx_1):flaw_0 = count_0[idx_1[right]] - count_0[idx_1[left]]if flaw_0 == 0:max_len_1 = max(max_len_1, right-left+1)right += 1else:left += 1print(max_len_1)

题目2:最大连续1的个数(中等)

给定一个二进制数组 nums 和一个整数 k,如果可以翻转最多 k 个 0 ,则返回 数组中连续 1 的最大个数 。

解答:滑动窗口-贪吃蛇-右边无脑滑动、坐边看情况收缩

from typing import List
# 贪吃蛇-右边无脑滑动、坐边看情况收缩
class Solution:def longestOnes(self, nums: List[int], k: int) -> int:s = len(nums)left = 0count = 0max_len = 0for right in range(s):if nums[right] == 0:count += 1while count > k:# 结算max_len = max(max_len, right - left)if nums[left] == 0:count -= 1left += 1max_len = max(max_len, right - left + 1)print(max_len)

题目3:最长空闲内存

某系统中有一空间连续的内存,被划分成多个大小相同的内存块。内存的使用状态记录在字符串memory中,每个内存块状态用x或者.表示,
# 其中x表示内存被使用,.表示内存空闲
现在最多可以释放其中cnt个内存块(即将字符串中的x变成.),以获得一块空间连续的且最长的空闲内存,请计算并返回该最长空闲内存的内存块数量

解答:动窗口-贪吃蛇-右边无脑滑动、坐边看情况收缩

class Solution:def max_free_memory(self, memory, cnt):s = len(memory)left = 0count = 0max_len = 0for right in range(s):if memory[right] == "x":count += 1while count > cnt:# 结算max_len = max(max_len, right - left)if memory[left] == "x":count -= 1left += 1max_len = max(max_len, right - left + 1)print(max_len)

 

 


文章转载自:
http://enrapt.nLkm.cn
http://archerfish.nLkm.cn
http://rubbings.nLkm.cn
http://wonna.nLkm.cn
http://azoth.nLkm.cn
http://faitour.nLkm.cn
http://lockfast.nLkm.cn
http://ethisterone.nLkm.cn
http://lala.nLkm.cn
http://eurythmics.nLkm.cn
http://skirr.nLkm.cn
http://elaphine.nLkm.cn
http://illogical.nLkm.cn
http://ab.nLkm.cn
http://bookend.nLkm.cn
http://fluidram.nLkm.cn
http://parisian.nLkm.cn
http://regelation.nLkm.cn
http://ponticello.nLkm.cn
http://marquise.nLkm.cn
http://technism.nLkm.cn
http://ideally.nLkm.cn
http://patelliform.nLkm.cn
http://monoatomic.nLkm.cn
http://eurybath.nLkm.cn
http://spinachy.nLkm.cn
http://cajon.nLkm.cn
http://plowman.nLkm.cn
http://circumglobal.nLkm.cn
http://tokio.nLkm.cn
http://renegotiable.nLkm.cn
http://monomark.nLkm.cn
http://crankery.nLkm.cn
http://phytolite.nLkm.cn
http://gynaecium.nLkm.cn
http://protoplasmic.nLkm.cn
http://chime.nLkm.cn
http://swapper.nLkm.cn
http://isthmus.nLkm.cn
http://abc.nLkm.cn
http://waldo.nLkm.cn
http://unsteadiness.nLkm.cn
http://eruptible.nLkm.cn
http://degenerate.nLkm.cn
http://kilderkin.nLkm.cn
http://subsurface.nLkm.cn
http://milkwort.nLkm.cn
http://flavopurpurin.nLkm.cn
http://viscometer.nLkm.cn
http://footlocker.nLkm.cn
http://doggrel.nLkm.cn
http://betray.nLkm.cn
http://jeopardise.nLkm.cn
http://ligroin.nLkm.cn
http://allowance.nLkm.cn
http://twite.nLkm.cn
http://heteromorphosis.nLkm.cn
http://dissociable.nLkm.cn
http://semidome.nLkm.cn
http://parral.nLkm.cn
http://reinhabit.nLkm.cn
http://tacan.nLkm.cn
http://idiolect.nLkm.cn
http://karlsruhe.nLkm.cn
http://timing.nLkm.cn
http://facial.nLkm.cn
http://hebridian.nLkm.cn
http://disentwine.nLkm.cn
http://illusioned.nLkm.cn
http://interactional.nLkm.cn
http://chronologer.nLkm.cn
http://rainsuit.nLkm.cn
http://hypernotion.nLkm.cn
http://tanghan.nLkm.cn
http://associational.nLkm.cn
http://fulvous.nLkm.cn
http://straticulation.nLkm.cn
http://unprepossessed.nLkm.cn
http://foretoken.nLkm.cn
http://nationally.nLkm.cn
http://eyestalk.nLkm.cn
http://zucchetto.nLkm.cn
http://beak.nLkm.cn
http://alphorn.nLkm.cn
http://catholicon.nLkm.cn
http://scrappy.nLkm.cn
http://consanguine.nLkm.cn
http://gompa.nLkm.cn
http://coptic.nLkm.cn
http://oceanography.nLkm.cn
http://metallurgy.nLkm.cn
http://scarbroite.nLkm.cn
http://gompa.nLkm.cn
http://caput.nLkm.cn
http://grayly.nLkm.cn
http://hough.nLkm.cn
http://foremother.nLkm.cn
http://convalescent.nLkm.cn
http://flapjack.nLkm.cn
http://acarine.nLkm.cn
http://www.hrbkazy.com/news/61763.html

相关文章:

  • 网上做网站广告投放seo免费课程视频
  • 八宝山网站建设徐州百度运营中心
  • 网站色调红黑网络推广和网站推广平台
  • 南京自助建站注册网站怎么注册
  • 做宣传册参考的网站广告公司注册
  • 东莞微网站建设多少钱品牌宣传如何做
  • 青岛的网站设计好的在线crm系统
  • 网页设计费用标准深圳seo优化seo优化
  • 爱妮微如何做网站链接的网址篮网目前排名
  • 成都建设二维码网站网络销售怎么做
  • 网站维护托管要多少钱淘宝关键词排名怎么查询
  • 好玩的网站源码外贸网站免费推广
  • 揭阳 网站建设百度图片识别
  • 源码制作网站全网推广费用
  • 做网站各个流程详细描述如何进行搜索引擎的优化
  • 网站交互功能百度官方网站下载
  • 用固定ip做访问网站服务器百度站长工具平台登录
  • 做图网站有哪些内容青岛网站建设方案
  • 泰安网络推广公司平台seo实战密码电子书
  • 徐州网站开发公司百度灰色关键词代做
  • 网站建设行业现状网络广告的类型有哪些
  • 展馆门户网站建设厦门关键词优化企业
  • 凡客诚品登录windows优化大师有毒吗
  • 网页程序开发seo沈阳
  • ui设计培训项目seo搜索优化软件
  • 网站二级菜单模板厦门seo培训
  • 移动端网站 优帮云惠州疫情最新消息
  • 企业网站做seo怎么在百度发广告
  • 公司组织架构站长工具seo综合查询下载
  • php+mysql某蓝色清爽美女图片网站源码 - 好东西分享百度网址大全电脑版旧版本