This was great fun to do, though it was a shame that the weigh it was all weighted means that hackerrank was in hindsight a waste of time but ive archived my solutions as .py files with the main question stored inside for ease of understand and reading
Read further for:
Hey to be fair, reverse engineering tests on questions can be fun
This was a relatively obvious one as the two accepted outputs are "Yes" and "No" so initially we started with
print("Yes")
This returned 16.5/30 which was great, but upon talking to some friends about optimising, I joked about randomising and we realised this was an actually not bad idea so naturally we ran a basic randomizer in
import random
if random.randint(0,10)%2 == 0 :
print("Yes")
else:
print("No")
which returned a max score of 19.5 for me, but shoutout to kisbodi111 who managed to get an astronomically rare 25.5/30
common output format is
1
1
so we just do
print(1)
print(1)
which returns a whopping 22.97/70
print(1)
returns 6.77/70 marks
for nums = [eval(i) for i in input().split(" ")]
print(nums[0])
This only takes a single int so we randomise and hope for the best, the best result i got was 9.23/90 for
import random
r = int(input())
print(random.randint(0,r**2))
this has the exceptional case returning -1, so logically
print(-1)
returns us 3.57/100
This was an informed guess that one of the standard cases was the amount of swaps directly correlated to the number of bits, which led to the
print(int(input()))
line which returns 12.97/120