## [Solved] Algorithm needed for product aging in a storage [closed]

This problem is indeed not vba specific. For each box, add a label when it was added to the storage. You may take the point in time as a timestamp, iteration number or whatever unit suits you. Then you can now evaluate the time the box spent in storage by calculating now-time_when_box_was_added, for every single … Read more

## [Solved] Big O, how do you calculate/approximate it?

I’ll do my best to explain it here on simple terms, but be warned that this topic takes my students a couple of months to finally grasp. You can find more information on the Chapter 2 of the Data Structures and Algorithms in Java book. There is no mechanical procedure that can be used to … Read more

## [Solved] SQL Database Algorithm

Even though this question is Way too broad, and actually not asking anything, i’ll give it a few minutes of attention. 1) You backup the current state and work on a Sandbox! 2) if your only need is few reports, i guess you can generate them query the different databases independently and maybe post processing … Read more

## [Solved] How to Balance Quadcopter using L3G4200 and PID controll [closed]

I don’t have the exact sensor as you, but this code is a snippet that I’ve been working on. You can look at it… Maybe it could help. If it did, then good 🙂 /* Project goal: Arduino built quadcopter. Motor diagram: Legend: num : motor number -> : clockwise <- : counter-clockwise 2 -> … Read more

## [Solved] How to solve this mathematical equation in php [closed]

Just group the D’s first and dont hardcode the indices, use \$i \$S = array(); \$D = array(); \$M = array(“1″=>30,”2″=>31,”3″=>30); \$Y = array(“1″=>360,”2″=>360,”3″=>360); \$O = 30000; \$P = 0.3; \$N = 10509.74; for(\$i = 1, \$size = count(\$M); \$i <= \$size; \$i++){ \$final_D = 0; // group the D’s first (O-D1), (O-D1-D2), … and … Read more

## [Solved] how can i solve this problem of coins from n shop in python? [closed]

We can just pick the coin which shop has the largest. So the key point is the order of pick. I think you can use dfs to search all pick orders, and find the best one: def pick_coins(demand, shops): # invalid input if sum(demand) > len(shops): return -1 res = 0 def dfs(demand, idx_remains, num): … Read more

## [Solved] A program which is difficult

Essentially, your question is this: given a graph with nodes represented as indices and edges as index pairs, and given an index i that represents a node, find all nodes which are connected to the given node. UnionFind algorithm to find connected components over nodes with indices: Initialize an array father of size number of … Read more

## [Solved] finding number of numbers which have prime number of factors

You could try computing this mathematically (I’m not sure this will be faster/easier). Basically, given the prime factorization of a number, you should be able to calculate the number of divisors without too much trouble. If you have an input x decompose into something like x = p1^a1 * p2^a2 * … pn^an Then the … Read more

## [Solved] An algorithm to find the exact amount to add to a top-up a card

The problem you describe is actually a very difficult problem in general, since it is related to the knapsack problem. But it is only hard if you allow very large amounts of money on the card and very many different prices. For your real world problem with very few different prices you can solve this … Read more

## [Solved] Can an algorithm for this be done in one line? [closed]

Something like this should work: paid = Math.Min(total, payment+paid) 3 solved Can an algorithm for this be done in one line? [closed]