I'm currently working on trying to optimise a battery schedule system. The schedule is created once a day for the entire day with a half hour granular ...

Optimisation of Battery Schedule

I'm currently working on trying to optimise a battery schedule system. The schedule is created once a day for the entire day with a half hour granular ...

Minimum amount of tiles needed to cover points on a line

Minimum amount of tiles needed to cover points on a line Suppose we have n points evenly spaced on a line, say 1 length unit apart. Every point has a ...

Extract wildcard string (* asterisk only) from a set of strings/texts?

. Answers to this question are eligible for a +50 reputation bounty. ...

Finding twelve 32-bit numbers with at least 17 bit differences between pairs

Find twelve 32-bit numbers such that each pair of them differs by bits in at least 17 positions. I'm struggling to find and optimal algorithm for thi ...

TStringList.CustomSort: Compare() with variables

I am trying to custom sort a TStringList by a column in a .CSV file. My code below works (slowly, about 14 seconds for 200,000+ lines): What I woul ...

Given integers C and N, (c <= n <= 10^9), find the amount of pairs i,j (n >= i >= j >= 1), where gcd(i,j) == C

Given integers C and N, (c <= n <= 10^9), find the amount of pairs i,j (n >= i >= j >= 1), where gcd(i,j) == C This is getting timed ...

How would one solve the staircase problem recursively with a variable number of steps?

The problem of determining the n amount of ways to climb a staircase given you can take 1 or 2 steps is well known with the Fibonacci sequencing solut ...

Search if a string contains a substring in Javascript (partial search)

Yes I know we can use indexOf and includes or a regular expression to find weather a string is present in another string. But we have a different req ...

Solving Robozzle puzzle

This question was migrated from Stack Overflow because it can be answered on P ...

Recurrence Equation Simplification

Given a pseudocode like this: The main cost is the cost given by the two recursive calls. The dimension of this two recursive calls should be in my ...

Algorithims for Selecting Unique Combinations

I'm looking for algorithims or methods that would be useful for solving this problem: Say I have a dataframe: That goes on for ~10k rows. Each Bin ...

What is the growth of this program? ChatGPT is wrong, right?

This is definitely a stupid, and simple question. But for some reason this is bugging me. This is not a homework question--insofar, as I am not solvin ...

Most optimal way of writing sparse array not using any libraries nor hash table

You are given a large array where the vast majority of the elements are zero. Create a class that can store these elements more space efficiently. ...

How do I use if statement to return -1 if what I am searching for is not in my array?

I need to return the index place of my target and if my target is not present in my nums array I need to return -1. When I run my code it is like only ...

Zmq pub-sub pattern does the publisher need to upload multiple times in n*O(m) messages to subscribers?

Hello all assuming that we have a pub-sub pattern in zmq with many subscribers, one publisher, and a message of 3GB. My question is does the publisher ...

Find missing arrithmetic operations in arithmetic expression

I was given the following task: Richard likes to ask his classmates questions like the following: 4 x 4 x 3 = 13 In order to solve this task, his cl ...

Extract the sub elements >=2 into another list and delete them from the nested list

So I have a nested list I want to extract the common elements if they are more than 2 and delete them from the list, so it would be something like ...

Trying to remove obsolete points from a very long line in Python

Problem description: I have a large array of 2D points (>150k) that represent an edge of a figure. The point coordinates are all integer (minimum ...

Java JSON tree structure creation from existing data

Need your help with creating a JSON tree structure from available data. This is what is available with me right now, The same data in json format i ...

Number of Palindromic Substrings- error in dynamic programming

I'm trying to solve the number of palindromic substrings problem using DP. The problem requires us to find the number of palindromic substrings in a ...

Sorted:

Quality: