Pengalaman berbicara, ngga cuma nge solve code tapi tetep clean juga code nya. Happy path
@damaroro2 жыл бұрын
Live coding test selalu bjkin keder, kadang kita udh tau solving nya,tapi di tengah jlan suka ga fokus karena keder
@ryanza30275 ай бұрын
Sepintas lihat codenya ini masih terlalu slow. Dibagian "in pairs.keys()" di python ini akan buat jadi list of keys dan kemudian mencari didalam list. So basicly it's nested loop. Seharusnya "if c in pairs", that will be much faster.
@maulanaaji19043 жыл бұрын
Keren, cuma agak kurang jelas aja mas text editor nya pas share screen :)
@galangputratama17513 жыл бұрын
owh, jadi di running-nya di IDE kita sendiri ya
@hafizmfadli2 жыл бұрын
soal umum di hackerrank 😂
@ekaputra39713 жыл бұрын
next berarti system design ya? keren (y)
@tonidwi41232 жыл бұрын
Fe dan be sama aja soalnya min?
@solodeveloper74832 жыл бұрын
aku dulu mock interview ruang guru tapi code ny gaboleh di compile
@kers23872 жыл бұрын
Kelanjutannya gimana mas kalo boleh tau? Nunggu kabar selanjutnya berapa hari ya?
@aliif2 жыл бұрын
itu emang gak di compile codenya kalo pake python soalnya python interpreted
@grasroot1247 Жыл бұрын
join challenge slur! adding more difficulties by adding bracket stratification. level 1 { } (highest) level 2 [ ] level 3 ( ) (lowest) this new solution validates the bracket level first and continue check bracket pair. def solution(a): open=0 s=list(a) lv={ '{':{'v':1,'w':0}, '}':{'v':1,'w':1}, '[':{'v':2,'w':0}, ']':{'v':2,'w':1}, '(':{'v':3,'w':0}, ')':{'v':3,'w':1}, } open={1:0,2:0,3:0} #level validation currlv=-1 for e in s[:int(len(s)/2)]: level=lv[e]['v'] if level=currlv: currlv=level #pair validation open={1:0,2:0,3:0} for e in s: level=lv[e]['v'] pos=lv[e]['w'] if pos==0: open[level]+=1 else: open[level]-=1 return all([v==0 for v in open.values()]) if __name__=="__main__": l={ '{[()]}':True, '{[(]}':False, '[{()}]':False, '{(())}':True, '{([])}':False, '{((]}':False, '[{()()}]':False, '[{())(()}]':False } for k,v in l.items(): ans=solution(k) print(f'Input:{k} Answer:{ans}. Test passed:{ans==v}') # Will print # Input:{[()]} Answer:True. Test passed:True # Input:{[(]} Answer:False. Test passed:True # Input:[{()}] Answer:False. Test passed:True # Input:{(())} Answer:True. Test passed:True # Input:{([])} Answer:False. Test passed:True # Input:{((]} Answer:False. Test passed:True # Input:[{()()}] Answer:False. Test passed:True # Input:[{())(()}] Answer:False. Test passed:True