Todd Benson
11/7/2007 11:51:00 PM
On Nov 7, 2007 9:51 AM, Phrogz <phrogz@mac.com> wrote:
> On Nov 7, 8:12 am, Johnson Wang <99...@163.com> wrote:
> > How to solve this problem in Ruby????
> > ==============================================
> > You are given a String disk representing the clusters on a disk. An 'X'
> > represents a used cluster, and a '.' represents an available cluster.
> > You are also given an int size representing the size, in clusters, of a
> > file waiting to be written to disk. A file can only be stored in
> > clusters not already being used.
> > Return the minimum number of groups of consecutive clusters needed to
> > store the file on the disk. (The disk does not wrap around at the end.)
> > Return -1 if the disk does not have enough space available to store the
> > file.
> > Definition
>
> This smells like a homework problem,
Indeed. If it is a student, than they shoot themselves in the foot by
asking for answers here (even if they get the right ones). If it is a
professor just trying to learn the language, more power to him ;)
Todd