6 kyu

Examining Traffic Data to Track Criminal Conduits

Description
Loading description...
SQL
Databases
Date Time
  • Please sign in or sign up to leave a comment.
  • zaritskiiAA Avatar

    how 2 blue honda can counted twice in test 2?

    puts "Another Static test ('blue honda' is counted twice):"

    DB[:traffic_observations].delete
    
    DB[:traffic_observations].multi_insert([
      {datetime: Time.parse('2024-06-25 09:50:00'), type: 'white toyota', traffic_light_id: 1},
      {datetime: Time.parse('2024-06-25 09:55:30'), type: 'black bmw', traffic_light_id: 1},
      {datetime: Time.parse('2024-06-25 10:05:15'), type: 'blue honda', traffic_light_id: 1},
      {datetime: Time.parse('2024-06-25 09:55:45'), type: 'black bmw', traffic_light_id: 2},
      {datetime: Time.parse('2024-06-25 10:05:45'), type: 'green ford', traffic_light_id: 2},
      {datetime: Time.parse('2024-06-25 11:00:00'), type: 'black bmw', traffic_light_id: 1},
      {datetime: Time.parse('2024-06-25 11:10:30'), type: 'red toyota', traffic_light_id: 1}
    ])
    
  • Rafaldownow Avatar

    I cannot pass the random test, it's always wrong, other previous tests ok, should I pos my code?

  • Mednoob Avatar

    There should be a fixed test that have two adjacent black bmw sightings. My solution doesn't handle that case and was able to pass through luck.

  • Voile Avatar

    The specs does not mention how to handle two adjacent black bmw sightings. Or will this never happen?

    • bornForThis Avatar

      it is possible, and they are treated just like any other type - don't want to add additional complexity with that. Updated the description.

      Issue marked resolved by bornForThis 9 months ago