This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import randint | |
| def bubble_sort(arr): | |
| n = len(arr) | |
| for i in range(n): | |
| done_sort = True | |
| for j in range(n - i - 1): | |
| if arr[j] > arr[j + 1]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PIL import Image | |
| def compare_pixels(png1, png2): | |
| pixels1 = list(png1.getdata()) | |
| pixels2 = list(png2.getdata()) | |
| if len(pixels1) != len(pixels2): | |
| return -1 # different pixel count | |
| match = 0 |