leetcode.com 2023-07-27
🔴2141.maximum-running-time-of-n-computers
🏷️ Tags
#greedy #array #binary_search #sorting
🔴2141.maximum-running-time-of-n-computers
🏷️ Tags
#greedy #array #binary_search #sorting
Telegraph
maximum-running-time-of-n-computers
You have n computers. You are given the integer n and a 0-indexed integer array batteries where the ith battery can run a computer for batteries[i] minutes. You are interested in running all n computers simultaneously using the given batteries. Initially…
leetcode.cn 2023-07-28
🔴2050.parallel-courses-iii
🏷️ Tags
#graph #topological_sort #array #dynamic_programming
🔴2050.parallel-courses-iii
🏷️ Tags
#graph #topological_sort #array #dynamic_programming
Telegraph
parallel-courses-iii
给你一个整数 n ,表示有 n 节课,课程编号从 1 到 n 。同时给你一个二维整数数组 relations ,其中 relations[j] = [prevCoursej, nextCoursej] ,表示课程 prevCoursej 必须在课程 nextCoursej 之前 完成(先修课的关系)。同时给你一个下标从 0 开始的整数数组 time ,其中 time[i] 表示完成第 (i+1) 门课程需要花费的 月份 数。 请你根据以下规则算出完成所有课程所需要的 最少 月份数:
leetcode.com 2023-07-28
🟡486.predict-the-winner
🏷️ Tags
#recursion #array #math #dynamic_programming #game_theory
🟡486.predict-the-winner
🏷️ Tags
#recursion #array #math #dynamic_programming #game_theory
Telegraph
predict-the-winner
You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of 0. At each turn, the player takes one of…
leetcode.com 2023-07-31
🟡712.minimum-ascii-delete-sum-for-two-strings
🏷️ Tags
#string #dynamic_programming
🟡712.minimum-ascii-delete-sum-for-two-strings
🏷️ Tags
#string #dynamic_programming
Telegraph
minimum-ascii-delete-sum-for-two-strings
Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Input: s1 = "sea", s2 = "eat" Output: 231 Explanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum. Deleting "t"…
leetcode.com 2023-08-03
🟡17.letter-combinations-of-a-phone-number
🏷️ Tags
#hash_table #string #backtracking
🟡17.letter-combinations-of-a-phone-number
🏷️ Tags
#hash_table #string #backtracking
Telegraph
letter-combinations-of-a-phone-number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does…
leetcode.com 2023-08-04
🟡139.word-break
🏷️ Tags
#trie #memoization #array #hash_table #string #dynamic_programming
🟡139.word-break
🏷️ Tags
#trie #memoization #array #hash_table #string #dynamic_programming
Telegraph
word-break
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. Note that the same word in the dictionary may be reused multiple times in the segmentation. Example…
leetcode.com 2023-08-05
🟡95.unique-binary-search-trees-ii
🏷️ Tags
#tree #binary_search_tree #dynamic_programming #backtracking #binary_tree
🟡95.unique-binary-search-trees-ii
🏷️ Tags
#tree #binary_search_tree #dynamic_programming #backtracking #binary_tree
Telegraph
unique-binary-search-trees-ii
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in any order. Example 1: Input: n = 3 Output: [[1,null,2,null,3],[1,null,3,2],[2,1,3],[3,1,null…
leetcode.com 2023-08-06
🔴920.number-of-music-playlists
🏷️ Tags
#math #dynamic_programming #combinatorics
🔴920.number-of-music-playlists
🏷️ Tags
#math #dynamic_programming #combinatorics
Telegraph
number-of-music-playlists
Your music player contains n different songs. You want to listen to goal songs (not necessarily different) during your trip. To avoid boredom, you will create a playlist so that: