Computer says it's a mate in 4.
This is supposed to be a mate in 2
Computer says it's a mate in 4.
The author forgot to check white O-O box.
Oh yeah, I'm not yet familiar with how the thing works. Sorry!
It's from a free app called Chess Riddles Deluxe. Some are pretty funky ones.
It would be hard to believe, in that position, that both the White king and the h1 rook have not moved yet. The only two pieces which stand like a strong building or statue in the midst of all the chaos.
You posted this too late considering that the solution has already been found by several players above, unless you came to this post trying to solve the puzzle first without scrolling down to see what others wrote.
In such situations castling is improbable because in the endgame stage, the king or the rook will most likely have moved.

There's a chess problem convention dictating that castling is legal in a problem position, unless it could be proven to be illegal using "retro-analyses". Here's an example to demonstrate both possibilities. It's a Mate-in-2 in two parts by Wolfgang Pauly, published in Chess Amateur 1913.
In a hypothetical game that lead to the diagram, Black's last move could only have been made by the K or the R, so castling is now illegal. That means Black can't play 1...0-0, which would've defeated White's correct first move.
With a BP added on g2, Black's last move could have been made by that P, so you can't prove that Black's K or R had moved previously. That means castling is legal here and it would defeat 1.Ra8?

With a BP added on g2, Black's last move could have been made by that P, so you can't prove that Black's K or R had moved previously. That means castling is legal here and it would defeat 1.Ra8?
Even after Be5 castling is legal. (https://en.wikipedia.org/wiki/Castling)
White Rook can still deliver mate, but not on a8 in this scenario :

With a BP added on g2, Black's last move could have been made by that P, so you can't prove that Black's K or R had moved previously. That means castling is legal here and it would defeat 1.Ra8?
Even after Bg5 castling is legal. (https://en.wikipedia.org/wiki/Castling)
White Rook can still deliver mate, but not on a8 in this scenario :
I think you meant to say Be5, in which case, thanks for confirming what I said.

With a BP added on g2, Black's last move could have been made by that P, so you can't prove that Black's K or R had moved previously. That means castling is legal here and it would defeat 1.Ra8?
Even after Bg5 castling is legal. (https://en.wikipedia.org/wiki/Castling)
White Rook can still deliver mate, but not on a8 in this scenario :
I think you meant to say Be5, in which case, thanks for confirming what I said.
Bishop e5 of course. Corrected in post above.
Point also being, you can castle even if your Rook is under attack.

You posted this too late considering that the solution has already been found by several players above, unless you came to this post trying to solve the puzzle first without scrolling down to see what others wrote.
In such situations castling is improbable because in the endgame stage, the king or the rook will most likely have moved.
The solution with 1...Kb2 is wrong because the move is illegal.
... but I simply don't see it. I understand this is because it just might be -that- tricky, but I'm out of ideas at this point.
white to move