Abhizen's blog

By Abhizen, history, 6 years ago, In English

I have solved this problem The Tower is Going Home. My solution is failing at test13. Please have a look at my solution and point out the problem.

Full text and comments »

  • Vote: I like it
  • -7
  • Vote: I do not like it

By Abhizen, history, 6 years ago, In English

I have solved this problem Taxi drivers and Lyft using two approaches. My first solution does not pass test case 5 where as second solution passes all test cases. Test case 5 is pretty big to figure out the mistake. Please help me figure out what is the problem with my first approach.

  1. By iterating over people array and storing distance of next taxi driver in a separate array. Then I am iterating again on people array to count riders for each taxi based on distance between taxi driver and rider. First solution
  2. By iterating over people array and storing taxi driver coordinate and rider coordinate in separate array. Then I am iterating over rider coordinate array and iterate over taxi driver coordinate array in nested loop based on distance between rider and taxi driver. Second solution

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it