added bruteforce solving method.