I'm looking over the solution to adding 2 binary numbers, using the bit manipulation approach. The input are 2 binary-number strings, and the expected output is
Today I was browsing for some questions that I saw this: Algorithm - Air Battle C ++ time limit: 1 second Java time limit: 2 seconds Python time limit: 10 secon
Based on the answer by Will Ness, I've been using a JavaScript adaptation for the postponed sieve algorithm: function * primes() { yield 2; yield 3;
Given two integers n and r, I want to generate all possible combinations with the following rules: There are n distinct numbers to choose from, 1, 2, ..., n; Ea
I need to find the coins needed to make up a specified amount, not the number of ways or the minimum number of coins, but if the coins end up a minimal number t
I am attempting to solve a coding challenge however my solution is not very performant, I'm looking for advice or suggestions on how I can improve my algorithm.
I was given a question that I can't seem to solve. given a directed graph G=(V,E) and a natural number k, k>0. Find an algorithm that will return "YES" if th
In my algorithm to compare the secret word with the guessed word, I need to manage the duplicated letters. For example, if the secret word is newly and the gue
The question is to distribute candies to N children.Each child has a rating. Distribution should be such that each child have at least one candy and children wi
I have a list of num and string of operator above: final List<dynamic> items = [5.0, "-", 2, "*", 3]; I want to calculate the value inside of it. I can d
Problem Statement- You and two of your friends have just returned back home after visiting various countries. Now you would like to evenly split all the souveni
I'm having trouble simplifying a conditional statement. It looks like this: There is an array of arrays like this, dice = [ [a, b], [c, d] ]. a, b, c, and d rep
Looking for an algorithm to find longest sequences (pairs, triplets, up to quadruplets) that are separated by a constant, non-integer difference k in a sorted a
I'm not very familiar with Big O notation. I'm wondering does the time complexity of the nested loop always be n^2? For example the following function, the inne
I'm playing a game with the following rules: There is a map (with walls), some coins (randomly generated in the map) and a Minotaur. The goal is to grab as many
I'm making an elevator in react, But I need to make a function that sorts an array to the nearest to the number X and also there is a condition if the elevator
I have dataframe of job and employee, with the duration each employee can finish each job. I want to use Hungarian algorithm to assign each job to 1 employee, a
I've written a recursive function to find a given object and the path within that tree, but when I change the target id (over here : if(tree.targetModuleId ===
I am currently practicing algorithms and DS. I have stumbled upon a question that I can't figure out how to solve. So the question's link is there: In summary,
The picture above has 25 action points such that: Each of the four corners of each of the three layers is an action point. The midsection of each of the four s