A given function to check if a given string is present in dictionary . The implementation is naive for simplicity . As per the question dictionary is given to us .
static boolean isWord ( String str ) {