Розмір відео: 1280 X 720853 X 480640 X 360
Показувати елементи керування програвачем
Автоматичне відтворення
Автоповтор
if you solved this question easily, try this question: ua-cam.com/video/qPVdT2W6_rA/v-deo.html
ENGLISH explanation: ua-cam.com/video/X41w2B9yx_s/v-deo.htmlsi=Zv7LJ2kXLv3ZEKgp
class Solution: def decrypt(self, code: List[int], k: int) -> List[int]: n=len(code) if(k==0): return [0]*n modifiedNums=[] kk=k if(k0): ans.append(prefixSum[i+k+k]-prefixSum[i+k]) else: if(i==0): ans.append(prefixSum[i+kk-1]) else: ans.append(prefixSum[i+kk-1]-prefixSum[i+kk-1-kk]) return ans# code= [5,7,1,4] k=3# [7, 1, 4, 5, 7, 1, 4, 5, 7, 1]# [7, 8, 12, 17, 24, 25, 29, 34, 41, 42]
if you solved this question easily, try this question: ua-cam.com/video/qPVdT2W6_rA/v-deo.html
ENGLISH explanation: ua-cam.com/video/X41w2B9yx_s/v-deo.htmlsi=Zv7LJ2kXLv3ZEKgp
class Solution:
def decrypt(self, code: List[int], k: int) -> List[int]:
n=len(code)
if(k==0):
return [0]*n
modifiedNums=[]
kk=k
if(k0):
ans.append(prefixSum[i+k+k]-prefixSum[i+k])
else:
if(i==0):
ans.append(prefixSum[i+kk-1])
else:
ans.append(prefixSum[i+kk-1]-prefixSum[i+kk-1-kk])
return ans
# code= [5,7,1,4] k=3
# [7, 1, 4, 5, 7, 1, 4, 5, 7, 1]
# [7, 8, 12, 17, 24, 25, 29, 34, 41, 42]