Attached: Screenshot_2019-05-17_13-39-47.png (523x649, 54K)
Coding challenge
Brandon Green
Other urls found in this thread:
hastebin.com
oeis.org
twitter.com
Levi Ortiz
do your own homework retard
Oliver Powell
user, why do you study computer science if you aren't even going to try.
Austin Murphy
>(1, 2) is considered the same as (2, 1)
what?
Zachary Reed
Oh, that's the pair of bishops, not the (row, column) tuple
Gabriel Foster
Ok, so what's the challenge? Doing it in better time than n^2?
Jose Sanchez
"""challenge"""
Dominic Jackson
I guess for each bishop (r,c) you can calculate c-r, and c+r, then match it up to other bishops with equal values for the same computation and it would just be O(n)
Brayden Morgan
Wait, actually you can it in n.
Anthony Gomez
For \ leaning diagonals if (ri+ci) == (rj+cj) then they match
For / leaning diagonals if (ri+(M-ci)) == (rj+(M-cj)) then they match
Count all matches and divide final result by 2 to get all pairs
Alternatively you could use a stack and pop a bishop every time you finish looking into its matches