Board index   FAQ   Search  
Register  Login
Board index PHP PHP Jobs

Complete words based on character list?

Forum to require and offer php jobs. Are you searching for php developers to make or complete your php script ? This place is for you.

Moderators: macek, egami, gesf

Complete words based on character list?

Postby MaxG » Mon Mar 07, 2011 2:48 am

The problem:
Check which word from a list can be build based on a list of characters available.

I have been thinking about this for a few days now, and have not been able to figure out how to solve this -- what appears to be a problem that can be solved with arrays, I think :help:

I need to check, whether I can complete / spell a word based on a bunch of characters I have. E.g.
I need to build the words:
php
link
great
ink

and have the characters: a, b, c, d, e, f, g, h, i, i, k, l, n, p, p, t

I can build the word link and php, but not ink, because I am missing a second k

The words in the word list should be (attempted to be) completed top to bottom in the word list

E.g. the result could be a repeat of the list with characters in bold that are available.
php
link
great
ink

The problem is not to bold the existing characters, but to take into account the number of each character available.
MaxG
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Mar 07, 2011 2:27 am

Re: Complete words based on character list?

Postby egami » Thu Mar 10, 2011 7:22 am

You are also missing an r
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT


Return to PHP Jobs

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron