Skip to content

Find the length of largest subarray with 0 sum

Given an array of integers, find the length of the longest sub-array with sum equals to 0. Here is an approach to this problem The Efficient approach But fails for test cases like , Do you have another approach to this problem ? Answer To spell out the solution from the comment. First create a generator to yi…

Python3 PyGame how to move an image?

I tried to use .blit but an issue occurs, here is a screenshot to explain my problem furthermore: The image appears to be smudged across the screen following my mouse code: Answer Fix the indentation in your given code, it puts all the important stuff outside the while loop. You can also add a function that r…

Question regarding my program being tedious

I just started learning python 3 recently and i have a problem of my code being too repetitive and lengthy. i wrote a code to calculate the interest earned. I have read about using functions to simplify my code but i am not sure how to go about doing this. Thanks for anyone who is willing to help me out!

Improving image deskew using Python and OpenCV

The code I’ve produce to detect and correct skew is giving me inconsistent results. I’m currently working on a project which utilizes OCR text extraction on images (via Python and OpenCV), so removing skew is key if accurate results are desired. My code uses cv2.minAreaRect to detect skew. The ima…