• # Determine The Trajectory Of Frogs And Make Sure Your Code Doesn't Stink

Hello, checkiomates🐱‍👤!

Let's find out if frogs will intersect and learn how to make your code less "stinky".

💡TIP

On Easy difficulty, each of the few starting stations is dedicated to a distinct data type. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

🏁MISSION

In the vast expanse of an infinite two-dimensional grid, two adventurous frogs embark on their hopping journey. Each frog, characterized by a unique 4-tuple, sets forth with determination. Their positions at time t=0 and constant directional vectors propel them forward through discrete time steps. As they leap across the grid, the question arises: will their paths intertwine? The challenge beckons for a solution to determine the precise moment when both frogs, frog1 and frog2, synchronize their hops onto the same square. Should fate decree their paths never to converge, the function shall gracefully return None, leaving their trajectories to wander in parallel, never to intersect.

```frogs_collision((0, 0, 0, 2), (0, 10, 0, 1)) == 10
frogs_collision((10, 10, -1, 0), (0, 1, 0, 1)) == None```

📖ARTICLE

By finding and refactoring this stinky code, we can make our codebase more maintainable, readable, and scalable. This will make it easier for us to add new features, fix bugs, and collaborate with other developers.

👩‍💻CODE SHOT

How do you think, what the following code does?

```?????? = lambda num: len(__import__("re").search('0*\$', str(num)).group(0))
```