Word Wrangler
by sealldev
π© CTFs HackTheBox University CTF 2024 coding
Word Wrangler / HackTheBox University CTF 2024

Original Writeup on seall.dev
Input: βThe quick brown fox jumps over the lazy dog. The dog barks at the fox!β
Output: the
Get the most common words in a string, ignore punctuation and capitalisation.
# Input the text as a single string
input_text = input() # Example: "The quick brown fox jumps over the lazy dog."
# Write your solution below and make sure to print the most common word
words = (''.join([l for l in input_text.lower() if l.islower() or l == ' '])).split(' ')
from collections import Counter
counter = Counter(words)
print(counter.most_common(1)[0][0])
Flag: HTB{pfupp_wh0_m4d3_th353_345y_ch4ll3ng35_ch1ld1sh!_f6a57597470925970e2cf3eba4cf119c}
Related Writeups
Conflict Crusher
Awakened by Lena Starling, you, the legendary Space Cowboy, must assist the Minutemen in their fight against the Frontie ...
Energy Crystals
The ancient Starry Spur has been recovered, but its energy matrix remains dormant. As Space Cowboy, your task is to awak ...
Exclusivity
Welcome back, Space Cowboy. The Minutemen have intercepted a corrupted data stream from the Frontier Board. Hidden withi ...