Approaching enemies
Description:
You are in a military mission in the middle of the jungle where your enemies are really hard to spot because of their camouflage. Luckily you have a device that shows the position of your enemies!
Your device is a radar that computes the x
and y
coordinates of an enemy in meters every 5 seconds
. You are always at the point (0, 0)
and your enemies are always heading towards you.
Your task
The radar will give you two consecutive points P1(x, y)
and P2(x, y)
of an enemy and you should write a function that will return the estimated time in seconds that the enemy will take to reach you, so you can defend! Python results should be rounded to 3 decimal places.
Hints
Distance between two points. Remember that you are working with only 2 dimensions!
Tests will have a precision of 3 decimal points. Good luck!
Similar Kata:
Stats:
Created | Mar 1, 2016 |
Published | Mar 2, 2016 |
Warriors Trained | 1567 |
Total Skips | 50 |
Total Code Submissions | 2041 |
Total Times Completed | 725 |
Java Completions | 297 |
Ruby Completions | 80 |
C# Completions | 113 |
Python Completions | 278 |
Total Stars | 22 |
% of votes with a positive feedback rating | 92% of 188 |
Total "Very Satisfied" Votes | 162 |
Total "Somewhat Satisfied" Votes | 23 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 15 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |