This file contains 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 collections import Counter | |
size = 11 | |
tab = [None] * size*size | |
def split(t): | |
return [t[size*i:size*i+size] for i in range(size)] | |
def splitV(t): |
This file contains 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
# A side-step solution because I was too lazy to find the repeated word... | |
# It find the most common letter, but exclude ' ', which is the lowest value and is often more common than 'e' | |
import sys | |
from collections import Counter | |
with open(sys.argv[1], 'r') as test_cases: | |
for test in test_cases: | |
vals = map(int, test.split('|')[2].strip().split(' ')) | |
m = min(vals) | |
e = Counter(v for v in vals if v != m).most_common(1)[0][0] |
This file contains 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
parent_index = lambda x: (x - 1) / 2 | |
left_child_index = lambda x: 2 * x + 1 | |
def heapsort(arr): | |
""" | |
sorts the given list using heapsort | |
""" | |
heapify(arr) | |
print_heap(arr) | |
sort_heap(arr) |
This file contains 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
# Java Maven CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-java/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version you desire here | |
- image: circleci/openjdk:8-jdk |
OlderNewer