[2023][ruby][6.x] perf

main
Alpha Chen 12 months ago
parent 8a81e989da
commit 8b21d78e9a
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -11,5 +11,4 @@ p times.zip(records)
# part two
time = times.join.to_i
record = records.join.to_i
distances = (1...time).map {|hold| (time - hold) * hold }
p distances.count { _1 > record }
p (1...time).count {|hold| (time - hold) * hold > record}

Loading…
Cancel
Save