Tangentially inspired by the opening to the What-If book.
The input is a rectangle of spaces as a string, list of string, etc., with objects made of #
's inside:
########
# #
########
### ####
### ####
###
The objects will always be non-intersecting, non-touching, rectangles. A soft object is defined as an object that isn't filled up with #
's in the middle and is only a border, a hard object is one that is filled up. An object with width or height <=2
is considered hard. All objects are either hard or soft.
If there are more hard objects in the input, output "Hard"
, if more soft, output "Soft"
, if they are equal, output "Equal"
.
This is code-golf, so shortest code in bytes wins!
Test Cases
These cases aren't full inputs, but rather what each object should be characterized as. The actual input will be like the ascii-art at the top of the question.
Hard
#
####
##
##
##########
##########
##########
Soft
###
# #
###
###################
# #
# #
# #
###################
####
# #
# #
# #
# #
# #
# #
# #
####
Actual Test Cases
########
# #
########
### ####
### ####
###
Hard
###
###
###
###################
# #
# #
# #
###################
Equal
######
# #
######
###
## # # #
###
########
# #
########
Soft