You are viewing a single comment's thread. Return to all comments →
gettings tle in 10,12,13. any suggestions?
def freqQuery(queries): dic = dict() res =[] for q, n in queries: if q == 1: try: dic[n] += 1 except Exception: dic[n] = 1 elif q == 2: try: dic[n] -= 1 if (dic[n] == 0): dic.pop(n) except Exception: continue; else: if n in dic.values(): res.append(1) else: res.append(0) return res
Seems like cookies are disabled on this browser, please enable them to open this website
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
gettings tle in 10,12,13. any suggestions?