All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General > Word Problems
Three Consecutive Letters in Order (Posted on 2023-03-15) Difficulty: 3 of 5
Complete the words given below using three consecutive letters in alphabetic order.

As an example, for: (*)(*)A(*)US, add A, B, and C and it becomes ABACUS.

  1. CO(*)(*)E(*)
  2. (*)(*)(*)ORM
  3. SO(*)E(*)(*)
  4. (*)A(*)(*)RATE
  5. (*)U(*)G(*)L
  6. S(*)O(*)(*)Y
  7. (*)OBU(*)(*)
  8. (*)O(*)OT(*)NE
  9. (*)US(*)E(*)

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution (Matlab) Comment 2 of 2 |
clearvars,clc
alphabet='abcdefghijklmnopqrstuvwxyz';
word= {'CO**E*'  
    '***ORM'  
    'SO*E**'  
    '*A**RATE'
    '*U*G*L'  
    'S*O**Y'  
    '*OBU**'  
    '*O*OT*NE'
    '*US*E*' };
word=lower(word);
for i=1:length(word) 
  disp(' ')
  disp(word{i})
  for astart=1:24
    w=word{i};
    lets=alphabet(astart:astart+2);
    ix=find(w=='*');
    w(ix)=lets;
    if isword(w)
      w(ix)=upper(w(ix));
      disp(w)
    end
  end
end
 
where isword is a function already written:

function iw=isword(x)
  ws=string(x);
  xl=length(x);
  fn=['c:\words\words' num2str(xl) '.txt'];
  words=fileread(fn);
  nwords=length(words)/xl;
  first=1; last=nwords;
  while first<=last
     mid=floor((first+last)/2);
     word=string(words(xl*(mid-1)+1:xl*mid));
     if word==ws
        break 
     end
     if word>ws
         last=mid-1;
     end
     if word<ws
         first=mid+1;
     end     
  end
  if word==ws
      iw=true;
  else
      iw=false;
  end
end
 
finds

 
co**e*
coRSeT
 
***orm
DEForm
 
so*e**
soLeMN
soReST           Two solutions for this one.
 
*a**rate
SaTUrate
 
*u*g*l
CuDgEl
 
s*o**y
sNoOPy
 
*obu**
RobuST
 
*o*ot*ne
MoNotOne
 
*us*e*
RusSeT


  Posted by Charlie on 2023-03-15 14:21:58
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (17)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information