I checked the codestyle "There is no whitespace between a cast and the item modified (e.g., "(int)j" and not "(int) j")."
Sorry if I couldn't understand but this looks fine. Can you please help as what is exactly wrong?