Update greedy.cpp

Fixed InCheck().