3
votes
0answers
45 views

TLE for SPOJ Upper Right King

I am solving this problem on SPOJ Upper Right King (Hard). I've written a solution in Python with a time complexity of O(n(logm)2). But it's showing TLE. Can anyone help me out with this? For more ...
3
votes
0answers
54 views

Summing 2D NumPy array by multiple lables

Each element of the array is a coordinate (x, y). Each coordinate has two labels. Goal: sum the elements that have the same two labels. How can this be faster? ...