Skip to main content
2 votes
1 answer
117 views

I’m trying to solve the following Leetcode problem: You are given a 2D integer array intervals where intervals[i] = > [starti, endi] represents all the integers from starti to endi inclusively. A ...
Utkarsh Mishra's user avatar
3 votes
1 answer
196 views

I am sitting on a LeetCode problem, specifically Minimum Time to Repair Cars. You get a list of how many mechanics you have and how many cars you need to fix. Each mechanic has a rank, and he takes ...
MaxH's user avatar
  • 75
1 vote
4 answers
394 views

I recently had an interview where I was asked to solve a modified version of this question on leetcode. Instead of checking if the string is valid you are supposed to count the minimum number of ...
oroprop's user avatar
  • 19
13 votes
6 answers
420 views

I'm an electrician working toward becoming an electrical engineer. I have some basic knowledge of Python and am trying to automate a tedious process we often face in the field. In 3-phase electrical ...
Adrian Cabrera Duarte's user avatar
1 vote
1 answer
106 views

Does anyone know any LeetCode, Codeforces or anything like the following programming problem?: Imagine you have "n" slots, from 1 to "n" with "s" being your starting ...
Casper Kejser's user avatar
1 vote
1 answer
230 views

I'm working through "Competitive Programming 4" by "Halim et al." and in the topic "Greedy algorithms", I was solving the following problem on Kattis: fridge. The goal ...
dietervdf's user avatar
  • 427
4 votes
1 answer
278 views

I am looking at solutions to the LeetCode problem 3474. Lexicographically Smallest Generated String: You are given two strings, str1 and str2, of lengths n and m, respectively. A string word of ...
eatfood's user avatar
  • 181
-1 votes
2 answers
66 views

Problem Description: Xiaoming has n energy balls, which are arranged from left to right. Each energy ball has an energy value v_i. Now, Xiaoming can perform the following 4 types of operations on this ...
user27379311's user avatar
2 votes
1 answer
158 views

It is a famous question which asked about finding longest nondecreasing subsequence from a given array. The question is well studied and have O(n log n) time complexity solutions. I have encountered a ...
tsh's user avatar
  • 4,838
0 votes
1 answer
56 views

I am attempting https://open.kattis.com/problems/distributingseats This problem has been listed as a classical greedy problem in the Competitive Programming Book by Steven & Felix https://cpbook....
musashi's user avatar
  • 21
0 votes
1 answer
277 views

Suppose I have several tasks with uneven lengths. For example, let k=8 and w(k)=[4,5,3,10,1,1,1,3]. How would I assign these to N=3 workers such that any tasks assigned to a given worker are ...
Zaya's user avatar
  • 346
3 votes
0 answers
58 views

A graph G(V,E) is defined by a set of vertices V and a set of edges E. Given W⊆V, find a connected subgraph G'(V',E') of G that satisfies the following conditions: i) ∀p∈V,∃p'∈V' such that p′ is ...
Sword fish's user avatar
2 votes
2 answers
129 views

I am a beginner in algorithms and my native language is not English, so please forgive me if there are any cognitive errors or grammatical errors. I am working on a problem where I need to maximize ...
Ader's user avatar
  • 21
2 votes
1 answer
67 views

I am trying to create subgraphs from pairs of edges in a graph a by following procedure: library(igraph) library(data.table) dt <- data.table(from = c("A", "B", "C", &...
zhang's user avatar
  • 689
5 votes
2 answers
152 views

In a multi-branch game, there are 𝑛 possible endings. You can think of it as a directed tree with 𝑛 leaf nodes, where each edge has a weight of 1. Instead of playing through the entire game to reach ...
SuohTheBest L's user avatar

15 30 50 per page
1
2 3 4 5
71