leetcode.com 2023-09-10
🔴1359.count-all-valid-pickup-and-delivery-options
🏷️ Tags
#math #dynamic_programming #combinatorics
🔴1359.count-all-valid-pickup-and-delivery-options
🏷️ Tags
#math #dynamic_programming #combinatorics
Telegraph
count-all-valid-pickup-and-delivery-options
Given n orders, each order consist in pickup and delivery services. Count all valid pickup/delivery possible sequences such that delivery(i) is always after of pickup(i). Since the answer may be too large, return it modulo 10^9 + 7. Example 1: Input:…
leetcode.com 2023-09-11
🟡1282.group-the-people-given-the-group-size-they-belong-to
🏷️ Tags
#array #hash_table
🟡1282.group-the-people-given-the-group-size-they-belong-to
🏷️ Tags
#array #hash_table
Telegraph
group-the-people-given-the-group-size-they-belong-to
There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1. You are given an integer array groupSizes, where groupSizes[i] is the size of the group that person i is in. For example, if groupSizes[1]…
leetcode.com 2023-09-12
🟡1647.minimum-deletions-to-make-character-frequencies-unique
🏷️ Tags
#greedy #hash_table #string #sorting
🟡1647.minimum-deletions-to-make-character-frequencies-unique
🏷️ Tags
#greedy #hash_table #string #sorting
Telegraph
minimum-deletions-to-make-character-frequencies-unique
A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The frequency of a character in a string is the number of times…
leetcode.cn 2023-09-13
🟡2596.check-knight-tour-configuration
🏷️ Tags
#depth_first_search #breadth_first_search #array #matrix #simulation
🟡2596.check-knight-tour-configuration
🏷️ Tags
#depth_first_search #breadth_first_search #array #matrix #simulation
Telegraph
check-knight-tour-configuration
骑士在一张 n x n 的棋盘上巡视。在有效的巡视方案中,骑士会从棋盘的 左上角 出发,并且访问棋盘上的每个格子 恰好一次 。 给你一个 n x n 的整数矩阵 grid ,由范围 [0, n * n - 1] 内的不同整数组成,其中 grid[row][col] 表示单元格 (row, col) 是骑士访问的第 grid[row][col] 个单元格。骑士的行动是从下标 0 开始的。 如果 grid 表示了骑士的有效巡视方案,返回 true;否则返回 false。 注意,骑士行动时可以垂直移动两个格子…
leetcode.com 2023-09-14
🔴332.reconstruct-itinerary
🏷️ Tags
#depth_first_search #graph #eulerian_circuit
🔴332.reconstruct-itinerary
🏷️ Tags
#depth_first_search #graph #eulerian_circuit
Telegraph
reconstruct-itinerary
You are given a list of airline tickets where tickets[i] = [fromi, toi] represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it. All of the tickets belong to a man who departs from "JFK", thus, the…
leetcode.com 2023-09-15
🟡1584.min-cost-to-connect-all-points
🏷️ Tags
#union_find #graph #array #minimum_spanning_tree
🟡1584.min-cost-to-connect-all-points
🏷️ Tags
#union_find #graph #array #minimum_spanning_tree
Telegraph
min-cost-to-connect-all-points
You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi]. The cost of connecting two points [xi, yi] and [xj, yj] is the manhattan distance between them: |xi - xj| + |yi - yj|, where |val| denotes…
leetcode.com 2023-09-16
🟡1631.path-with-minimum-effort
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
🟡1631.path-with-minimum-effort
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
Telegraph
path-with-minimum-effort
You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated in the top-left cell, (0, 0), and you hope to travel to the bottom…
leetcode.com 2023-09-17
🔴847.shortest-path-visiting-all-nodes
🏷️ Tags
#bit_manipulation #breadth_first_search #graph #dynamic_programming #bitmask
🔴847.shortest-path-visiting-all-nodes
🏷️ Tags
#bit_manipulation #breadth_first_search #graph #dynamic_programming #bitmask
Telegraph
shortest-path-visiting-all-nodes
You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge. Return the length of the shortest path that visits every node. You may start…