Skip to content

Hack The Box | MinMax

In this walkthrough, we will be going through the MinMax box on Hack The Box.


Successfully Pwned MinMax

Completed and pwned this challenge on Hack The Box.

Owned

Hack The Box

Pwned

Challenge Description

In a haunted graveyard, spirits hide among the numbers. Can you identify the smallest and largest among them before they vanish?

Challenge Overview

MinMax - Statement

Script

To solve this problem we need to find the smallest and largest number in the given list of numbers. We can do this by using the min() and max() functions in Python.

python
n = input()

l = [] # Create an empty list
for i in n.split(" "): # Split the input by space and store it in a list
    l.append(float(i)) # Convert the string to float and append it to the list

print(min(l)) # Print the minimum number
print(max(l)) # Print the maximum number

Run the script and get the flag

MinMax - Flag