English
Open in Telegram

Postdef answer(arr, i, dp):

7 August 2024
M
Machine Learning coder
def answer(arr, i, dp): if i >= len(arr): return 0 if dp[i] != -1: return dp[i] include = arr[i] | answer(arr, i + 1, dp) exclude = answer(arr, i + 1, dp) dp[i] = max(include, exclude) return dp[i] def solve(N, arr): dp = [-1] * N return answer(arr, 0, dp) OR Bit ✅ #Seimens
1 · 1.6K ·

Nearby in the feed

MMachine Learning coderPhotoMMachine Learning coderdef solve(N, workload): tot = 0 max_tot = 0 for i in workload: if i > 6: tot += 1 else: tot = 0 if tot > max_tot: max_tot = tot
this message
MMachine Learning coderfrom collections import defaultdict def getMaxRacers(speed, k): ans = 0 D = defaultdict(list) for i, e in enumerate(speed): D[e].append(i) for arr in D.values()MMachine Learning coderimport heapq def get_greatest_elements(arr, k): n = len(arr) result = [] min_heap = [] for i in range(n): heapq.heappush(min_heap, arr[i]) if len(min_heap) > k:
DDeloitte | COGNIZANT | IBM | CAPGEMINIDeloitte | COGNIZANT | IBM | CAPGEMINI@python_java_Coding · channel · Tech
7 178subscribers406average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count