get-Shell | where {$_.pipeline -contains Objects}
And another WTF Programing Praxis :
function get-OpenLockers ($num){1..([math]::sqrt($num))|%{$_*$_}}
Enjoy,
Greetings /\/\o\/\/
This solution only works when the absolute difference between the number of total lockers (x) and sq' is less than the absolute difference between the number of lockers and sq''.
For example, if there are 12 lockers, then lockers 1, 4 & 9 are open. In this case sq' = 9 and sq''=16.
sq' - x = |9-12| = 3
x - sq'' = |12-16 = 4
3 < 4, so the solution works
But if there are 13 lockers, then the script outputs 1,4,9 & 16.
sq' - x = |9-13| = 4
x - sq'' = |13-16 = 3
4 > 3, so the solution doesn't work. Locker 16 can't be open because it doesn't exist.
I'm very new to powershell and programming in general, so I'll have to have a look to see how the output is being generated.