We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Warmup
- Compare the Triplets
- Discussions
Compare the Triplets
Compare the Triplets
Sort by
recency
|
4142 Discussions
|
Please Login in order to post a comment
This could be a little easier to read if i extrapolate the ternary to several lines and use if statements instead. This is also lacking an error handler for situations where potentially different size arrays are passed in for a and b, but that wasn't part of the challenge.
A simple JS solution:
Here is the simplest code in my opinion. It is written using C language
Python3
Complexity
Option1 - enumerate
Option2 - zip - more phytonic