i liked this - this is how i done it. Although i think i may have been bias; been coding a few years in python and would not have consided looking into a switch function or similar. I've been brushing on C++ and CUDA over the past few weeks and made be try what i would consider doing in C++. Which also makes me wonder, how does this solution stack in terms of execution time and memory compared to others. Anyone done any profiling on it?
I could be wrong, but it seems that the random test outputs expect incorrect answers. For example, in cases where y1=y2 the slope should = 0 yet, the test expects -1? :/
very tidy solution. Like this
like this one. Very tidy solution
i liked this - this is how i done it. Although i think i may have been bias; been coding a few years in python and would not have consided looking into a switch function or similar. I've been brushing on C++ and CUDA over the past few weeks and made be try what i would consider doing in C++. Which also makes me wonder, how does this solution stack in terms of execution time and memory compared to others. Anyone done any profiling on it?
very clever, i like this
really like this solution. Well done
same here
I could be wrong, but it seems that the random test outputs expect incorrect answers. For example, in cases where y1=y2 the slope should = 0 yet, the test expects -1? :/