Comments (13)
Okay- after tracing the steps it was a problem with my method of finding the least common denominator for my end result fractions! WHEW
[4, 5, 5, 4, 2, 20]
from google-foobar-help.
Okay- I've got mine to the same point as another guy, it is only failing test 6. Not sure what edge cases I could look out for!
from google-foobar-help.
Hey,
Which problem is this? doomsday_fuel
?
Also you should be able to do if (input > x) { return null; }
and if you still have the same tests failing you can then do if (input > x) { System.out.println; }
then if you get an error you found out some information about your inputs.
from google-foobar-help.
I really appreciate your help. After putting this in I saw some of the conversation with others in the closed issues. This input method looks like a java example, do you know if it works in Python ?
Thanks again.
from google-foobar-help.
You will want to throw some conditionals against the argument that you are taking from each test. So for example you are being passed a map m
.
If you write if len(m) > 4
and return null
inside the conditional you will fail all tests which the input was greater than 4 in length. Now lets say you find out by the process of elimination that all your tests pass except number 6 when you write if len(m) == 1
- you still do not know with 100% certainty that the conditional is passing.
However you can replace the return null
with print('foo')
which will cause ANY tests that HIT this line to throw an error. If you get an error, you have found some information about the input that is causing you trouble. If you do not get an error, then that input is not being used by any tests.
You may find that the test you are failing is an edge case, where the map is [1]
or [[1,0],[0,1]]
.
from google-foobar-help.
Okay- thanks! That makes sense. I have sort of been doing that but I thought you had a better trick.
I did catch the m=[[1]] issue, and I do have a check in there for a 2x2 matrix (but it never fires). I will continue trying to poke for more information about the test case, and maybe review some more of my logic. I went from not knowing much about matrices to feeling like an expert- okay maybe not but I know a lot more than I ever did :) I was reading the scipy and numpy are really the best way to work with matrices in python but we have to do it by hand in foobar.
I will keep at it, wish me luck, I only have approx 1 day remaining.
from google-foobar-help.
Best of luck!
Maybe it could be a fraction that is not being simplified as much as possible, or something is slightly wrong with multiplication/addition.
from google-foobar-help.
I was able to identify the problem matrix, I'm tracing thru my code to see if there is some bug..
[[0, 7, 0, 17, 0, 1, 0, 5, 0, 2],
[0, 0, 29, 0, 28, 0, 3, 0, 16, 0],
[0, 3, 0, 0, 0, 1, 0, 0, 0, 0],
[48, 0, 3, 0, 0, 0, 17, 0, 0, 0],
[0, 6, 0, 0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
**WARN- Answer looks wrong :( [2, 2, 2, 2, 1, 10]
from google-foobar-help.
I think I ran into a problem with my LCM method too. Glad you figured it out though I can imagine it was very long winded.
from google-foobar-help.
Hey @stevem99 , how were you able to get the matrix which was failing the test case?
I'm on this challenge myself.
from google-foobar-help.
I used ivanseed method of intentionally setting up an error condition, except I combined it with a mapping of each value to a specific exception so I would know what value was being supplied to the program based on the raised exception. It was kind of a brute-force style attack but I was desperate and it does work.
from google-foobar-help.
I think it would be fair if they allowed to reveal one of the tests per challenge, i.e. if you are failing only 6 and have not used your reveal you could see the inputs just for that test.
from google-foobar-help.
True, as is the system in Hackerrank, wherein you can trade in your "Hackos" to see test cases
from google-foobar-help.
Related Issues (18)
- About doomsday_fuel challenge HOT 3
- Distract the guards HOT 6
- (I-Q)^-1 =? HOT 1
- Help wanted
- For test cases 3 and 10 f's columns do not match r's rows HOT 6
- How do you calculate inverse of matrix with fractions? HOT 2
- Add more Google Foobar Challenges!
- Some more to add (don't remember the names though)
- Solution to planning bunnies escape? HOT 1
- En Route Salute in one pass HOT 1
- doomsday_fuel issue HOT 1
- Distract the Trainers - Maximum Matching
- Failing one test on doomsday_fuel HOT 4
- Two-layer Dijkstra solution for prepare_the_bunnies_escape HOT 3
- t
- Doomsday Fuel Python Test 8 HOT 29
- doomsday_fuel tests HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-foobar-help.