Ad
  • Custom User Avatar
  • Custom User Avatar

    That is a valid walk and your test (the one you've written in the sample tests) is testing for an invalid walk, see how are the sample tests:

    test.expect(is_valid_walk(['n','s','n','s','n','s','n','s','n','s']), 'should return True');
    test.expect(not is_valid_walk(['w','e','w','e','w','e','w','e','w','e','w','e']), 'should return False');
    test.expect(not is_valid_walk(['w']), 'should return False');
    test.expect(not is_valid_walk(['n','n','n','s','n','s','n','s','n','s']), 'should return False');