Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
2 replies
47 views

Found this code exercise on W3R. Been trying to figure out the relationship between the outer and inner loop (i and j), but can't seem to wrap my head around it. If anyone could walk me through this ...
Stanislav Matveyevich's user avatar
2 votes
1 answer
99 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
Advice
1 vote
3 replies
68 views

I want to implement in python some algorithms from a paper that allow for a pre-trained neural network to be modified (adding or removing neurons or layers) conserving (theoretically) the outputs of ...
Rubén Sales Castellar's user avatar
Advice
0 votes
1 replies
70 views

As a student in an IT school, i need to solve problems every days, but I don't believe that I am doing it the right way. When I try to solve a problem, I am fastly thinging of what is the problem and ...
GlicyDev's user avatar
0 votes
2 answers
70 views

I've been trying to teach myself various sort methods just for the sake of being able to use them in the future and right now I've been teaching myself about shell sorts. I understand the way shell ...
Neptunium-Eater's user avatar
Advice
0 votes
3 replies
65 views

The context is implementing conversion functions between Gregorian calendar dates and Julian dates. Most (nearly all?) such implementations have restrictions on the dates - typically requiring that ...
John's user avatar
  • 1,673
2 votes
1 answer
190 views

The inverse of the gamma function over the reals is multivalued with an infinite number of branches. This self-answered question is about the principal inverse of the gamma function, Γ0-1(x), whose ...
njuffa's user avatar
  • 27.1k
2 votes
1 answer
158 views

Problem: We are given a list of integers of length n. What is the minimum number of elements whose sign you need to flip such that every prefix sum is non-negative? (A prefix sum is the sum of the ...
Marc Carlsan's user avatar
1 vote
1 answer
305 views

I'm trying to implement the Cooper–Harvey–Kennedy algorithm from this paper in C++. The original is used to find dominators, however in my case I need to find the postdominators. For this, I am aware ...
DeepQuantum's user avatar
-2 votes
1 answer
176 views

I’m trying to implement an in-place Quick Sort in Python. I have two slightly different versions of my partitioning logic, and I’m confused because both seem correct on small arrays, but the second ...
Lisguen's user avatar
  • 11
2 votes
1 answer
134 views

I am tasked with a question as follows: We have n players and we want to hold a wrestling tournament with exactly n * (n - 1) / 2 matches. In each day a player can only play at most one match. However,...
Eastern Skill's user avatar
2 votes
1 answer
120 views

I need a really fast vectorized maximal independent set algorithm implemented in pytorch, so I can use it for tasks with thousands of nodes in reasonable time. I cannot use networkx, it is way too ...
Kemsikov's user avatar
  • 640
3 votes
3 answers
188 views

The problem: Given an array in which the number of negative elements is equal to the number of positive elements (arranged in arbitrary order). Swap the first negative and the first positive, then ...
user567_9's user avatar
7 votes
3 answers
245 views

I have an array x of n >= 4 elements, at indices 0..n-1. I want to swap the elements at indices j and k, where 0 <= k < j < n with the elements at indices 0 and 1 (it doesn't matter ...
The Lost Petrol's user avatar
2 votes
1 answer
124 views

I have a room that is a box. There is a single rectangular window on one of the walls of the room. A directional light source is shining into the room through the window. The light source has a ...
nj16's user avatar
  • 133
5 votes
3 answers
221 views

I implemented a recursive solution in Python to check if two binary trees are identical, which traverses nodes recursively and compares values and structure. The time complexity is O(n), space O(h). ...
Jared McCarthy's user avatar
3 votes
2 answers
496 views

Given StartTime and endTime for N employees, an employee can form a team if his working hour overlaps with other employees' (both startTime and endTime inclusive). Find the maximum team size. Example: ...
QA Android Alfa's user avatar
0 votes
0 answers
93 views

I have a bunch of data which is indexed by key/value pairs. For example I might have x=1, y=2, z=3 => data="1,2,3" and x=1,y=2 => data="1,2" etc. The operations I need to ...
Mumrah's user avatar
  • 422
7 votes
3 answers
295 views

The problem is to find the longest sequence of numbers from 1 to 100 such that each number is either multiple or divisor or the previous, and with no repetition. For example, 50 25 5 35 7 63 21 is a ...
Zorm's user avatar
  • 71
1 vote
1 answer
110 views

The current problem I'm having is that when the code runs it shows me "None" in the terminal. /usr/local/bin/python3.12/Users/jaredmccarthy/Desktop/2025/ejercicios_leetcode.py None Process ...
Jared McCarthy's user avatar
2 votes
0 answers
114 views

I'm researching about maintaining order in a list like JIRA, and I come across Jira Lexorank. I've already understood it's core concept, but there are 2 questions that I struggle to find the in depth ...
nanh's user avatar
  • 51
-2 votes
2 answers
150 views

I have an application where I have a Rule object that has a list of Filter predicates. I will be comparing many Events to the predicates, and want to know if they all match. Most Events will not match ...
Andrew Rueckert's user avatar
-2 votes
3 answers
856 views

This is CSES Mountain Range problem: https://cses.fi/problemset/task/3314/ There are n mountains in a row, each with a specific height. You begin your hang gliding route from some mountain. You can ...
Isabella's user avatar
3 votes
2 answers
199 views

The method is working as intended, but while I was trying multiple cases, I got this weird issue, so hopefully someone can understand why and explain it to me, since 6 > 5 looks logically sound to ...
chtasmino's user avatar
5 votes
3 answers
156 views

I'm currently building my portfolio and im making a typewriter effect for some text : "use client" import { useEffect, useState } from "react" type Typewriter = { textToWrite: ...
Rayan's user avatar
  • 47

1
2 3 4 5
2430