Cody

Problem 2358. Word Search Solver

Solution 453618

Submitted on 11 Jun 2014 by goc3
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% board = [ 'xcupa'; 'dyrng'; 'osbaq'; 'exbid'; 'wgamv'; ]; words = {'aim'; 'bid'; 'cup'; 'doe'}; loc_ans = [ 3 4 5; 4 3 3; 1 2 3; 2 1 5; ]; assert(isequal(WordSearch(board,words),loc_ans)) % board = [ 'okeanpbirf'; 'qicenafehu'; 'wniazcgame'; 'egaxjelbiv'; 'bnomelvmcr'; ]; words = {'fair'; 'game'; 'hall'; 'ice'; 'jack'; 'king'; 'lemon'}; loc_ans = [ 2 7 4; 3 7 3; 2 9 6; 3 3 1; 4 5 8; 1 2 5; 5 6 7; ]; assert(isequal(WordSearch(board,words),loc_ans)) % board = [ 'werojea'; 'cafefls'; 'apufrbw'; 'hrleaan'; 'aoltgbb'; 'aoaevdr'; 'mdzoece'; ]; words = {'able'; 'bare'; 'cafe'; 'door'; 'edge'; 'full'}; loc_ans = [ 4 6 1; 5 7 8; 2 1 3; 7 2 1; 7 7 8; 2 3 5; ]; assert(isequal(WordSearch(board,words),loc_ans)) % %% board = [ 'anmjwfpnyo'; 'wasgijsaen'; 'akigyqaekl'; 'doorbellci'; 'loiapucfdx'; 'loepalirri'; 'alzhheagle'; 'mgxmsovnpr'; 'aiqtbovgee'; 'juyhctahnr'; ]; words = {'airplane'; 'board'; 'clasp'; 'doorbell'; 'eagle'; 'fiesty'; 'graph'; 'hatch'; 'igloo'; 'jigsaw'; 'key'; 'llama'}; loc_ans = [ 2 2 4; 9 5 2; 5 7 1; 4 1 3; 7 6 3; 5 8 6; 3 4 5; 10 8 7; 9 2 1; 2 6 7; 3 9 1; 5 1 5; ]; assert(isequal(WordSearch(board,words),loc_ans))

===== a i m 3,2 ===== a i ===== b i ===== b i d 2,3 ===== c u p 2,3 ===== d o e 3,2 ===== f a ===== f a i 3,3 r ===== g a ===== g a m 2,3 e ===== g a ===== h a l l 3,1 ===== i c e 2,3 ===== i c e 1,2 ===== i c ===== j a c k 1,1 ===== k i n g 3,2 ===== l e ===== l e ===== l e m o 2,1 n ===== a b ===== a b ===== a b l e 1,2 ===== a b ===== a b ===== b a ===== b a ===== b a ===== b a ===== b a r e 1,1 ===== c a f e 2,3 ===== c a ===== d o o r 1,2 ===== e d ===== e d g e 1,1 ===== f u l l 3,2 ===== f u ===== a i r p l a n e 3,3 ===== a i ===== a i ===== a i ===== b o a r d 1,3 ===== b o ===== c l ===== c l ===== c l a s p 1,2 ===== c l ===== c l ===== d o o r b e l l 2,3 ===== d o ===== e a ===== e a ===== e a ===== e a ===== e a ===== e a ===== e a g l 2,3 e ===== f i ===== f i e s t y 3,1 ===== g r a p h 3,2 ===== g r ===== g r ===== h a ===== h a ===== h a t c h 2,1 ===== i g ===== i g o ===== i g ===== i g ===== i g ===== i g l o o 1,2 ===== j i ===== j i g s a w 2,1 ===== j i a ===== k e y 1,2 ===== k e ===== l l ===== l l ===== l l ===== l l ===== l l ===== l l ===== l l a m 3,2 a ===== l l ===== l l ===== l l ===== l l ===== l l ===== l l ===== l l

Suggested Problems

More from this Author139

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!