coder
BAN USER
@tnutty2k8
Oh no I was just thinking of test cases with very large grids (100x100), etc. When I tested your code I noticed it was taking some time to produce the output (which is attributed to the DFS).
When using BFS does it matter what order you store the points in the queue? (up, left, down, right). So I guess you could dequeue then run the recursion on there until it terminates then pop the next direction from the queue.
@tnutty2k8
I came across this: look at problem with id=5754769170759680 and this problem allows for any corner (as long as it is flat).
So essentially there needs to be a way around hardcoding that starting = [0,0] like you do. I guess checking all 4 corners for the min could work but is that optimal?
@tnutty2k8 That makes sense, but going back to this example:
Input: 2,4
Field = [[1,1,0,1], [1,1,5,1]];
If we start at [1][3] (0 indexed) then we can move 1 point left and cut down the tree represented as 5, which would be cost 1, right?
So what I was asking was is there a way to modify your code to check all 4 corners somehow and start at the most optimal corner?
@tnutty2k8 Never mind, disregard that. However I did run it on the following test cases:
Input: 6,6
Field =
[
[1,1,0,12,1,1],
[1,1,1,1,1, 1],
[0,1,0,0,0, 1],
[0,1,1,1,14,1],
[0,0,0,0,1, 1],
[15,1,1,1,1,1]
]
That should return 14 but I got 17 as the output. Also I ran it on:
Input: 2,4
Field = [[1,1,0,1], [1,1,5,1]];
That should give 1 as the output but I got 3.
Reprameshdondu15, Analyst at ASAPInfosystemsPvtLtd
My name is Ramesh dondu from India. I burn through 2009 to on words consistently work in Interior planner. I ...
RepLopezKape, Applications Developer at A9
Lopez , an Outgoing Headhunter with a comprehensive background of client satisfaction in finding and recruiting top talent for various organizations ...
RepAmber Van is registered and fully insured cheap removal company in Bristol.Our featured services includes domestic moves,commercial moves ...
RepSpent 2001-2006 getting my feet wet with Slinkies in Fort Walton Beach, FL. mantra to control girl Spent 2001-2006 working ...
Repreetaharriet, Applications Developer at Achieve Internet
As a sales clerk, I deal with customers on a daily basis. My work face-to-face assisting customers with finding the ...
RepAre you searching for the most powerful and very strong mantra for your husband? If you want to do Jadoo ...
RepHazelMiller, Site Reliability Engineer at Delve Networks
Hazel Miller has been a stalwart advocate for sound public policy that advances the jobs creating potential of America’s ...
RepJohn Colcomb, Analyst at A9
With more than 20 years of car rental and dealership experience, responsible for developing growth strategies to maximize operational effectiveness ...
Repdianamowery95, Consultant at Delve Networks
My Name is Diana Mowery. I am from St. Louis and received a Bachelor Degree and My Masters Degree from ...
RepSherryellis555, Computer Scientist at ASAPInfosystemsPvtLtd
My name is Sherri Ellie Once had a fantasy of testing the market for tar in Georgia, GE. Rehearsed in ...
RepEdwards IVF Surrogate is one of the best & most successful provider of surrogate services.We provide moral, emotional, ethical and ...
Repriyanahobett, Sales Development Representative at Capgemini
I am Riyana , driven market researcher with over years of experience at Awthentikz , analyzing information in order to construct profiles ...
Repfesfporyi212, Member Technical Staff
My self Fesfpory. I work in agriculture university in India as a professor. I done PHD in Botany in Punjab ...
RepAlisonjaeger755, Data Engineer at Accolite software
I am work in Telecom line in IDEA company. I am data operator and Engineer in back end in Idea ...
RepCrystalday777, Computer Scientist at AMD
My name is Crystal Day; I'm from Sydney, Australia, Get Ex Lost Love Back and I'm a sophomore ...
RepLornaEllis, Android test engineer at Abax Techno Solutions
I am Lorna Job estimator, also known as cost planners, who are responsible for estimating the costs of a planned ...
@tnutty2k8 I've tried porting your code to JAVA but keep getting -1 no matter what input I give it...do you think you could help me?
- coder August 26, 2017