Skip to main content

Attempting Challenge of Wits 2023

· One min read

In August 2023, I submitted my solution to the second challenge of Chalenge of Wits 2023 organised by the Defence Science & Technology sector of the Government of Singapore, which is about data science. However, since I am not a Singaporean, I was not qualified to receive the rewards of the challenge.

The problem statement of the challenge (with required data set and answer) can be found here.

Here is my submitted code for the challenge, which can also be found via this GitHub repository.

import xml.etree.ElementTree as ET
import os
import matplotlib.pyplot as plt
import traceback

cwd = os.getcwd()
K = 2254
coordinates = []
invalid = [317, 1768]

for i in range(K):
if i in invalid:
continue
try:
filename = cwd + '/log_' + str(i) + '.xml'
# with open(filename, 'r') as f:
# read_data = f.read()
tree = ET.parse(filename)
root = tree.getroot()
location_raw = root[0].text
coordinate = tuple(map(lambda text: int(text), location_raw.split(',')))
coordinates.append(coordinate)
except Exception:
print(traceback.format_exc())
print(i)

plt.scatter(*zip(*coordinates))
plt.savefig('key.jpeg')