There's a couple different ways of dealing with the directories.

But since you're using the path names, you should inspect the list of
path names which you have constructed, for accuracy (and completeness
-- the input.txt file will repeat some of the names)..

I hope this helps,

-- 
Raul

On Thu, Dec 8, 2022 at 10:05 AM David Lambert <[email protected]> wrote:
>
> I must misunderstand the instructions since I get same wrong answer in
> every language I try.
>
> Strategy: create a list of rooted path to all files.  Make a set of the
> directories-part, producing a unique list of all directories.  For each
> of these, add the file sizes for all files with matching leading path.
> Sum the directory totals for those with less than or equal to one
> hundred thousand.  This strategy solves the example.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to