[Community Puzzle] 1D Spreadsheet

thanks for the hint =D

In test “Accounting is hard 1” input line 68 (cell 67th) has record:

VALUE $67 _

How to handle this ?

The value is the result of the 67th cell.

1 Like

But 67th cell contains this value “$67” !

Hello,
the input line 68 is for the cell 66, not 67.

my code is failing on test case 11 and 12 :sob: :sob: :sob:
For the last one no problem when i use lru_cache from python functools.
So whats wrong with 11, 12 (accounting is hard 1, 2)

“Easy” really? It should belong to medium/hard section. Memoization, Lazy Evaluation, Dependency Graph tags are not meant for easy problem in general. Suggesting to move it to the medium section.

@PolyB

4 Likes

This is definitely not an “Easy” one. Not only needs recursion, but needs to be also optimized with memoization, because the last test fails otherwise. Lost almost a whole day to this…

Spending time to practise to earn experience and skill is not a loss. It is an investment.
It could be a loss if you gained nothing from it, or what you gained has zero or negative value to you.

Sure, you are right. But if a practice is labeled easy, and it is at least a medium one, people will get discouraged from solving it, and this can affect their progress negatively. This was meant to be the core of my post.

1 Like

In this site, difficulty level is a rough classifier, often subjectively more than scientifically assigned. No need to bother with it too much.

A remedy is having the author or anyone to contribute really helpful hints, making some difficult “Easy” puzzles more educational, more solvable by learners.

There have been some explanations or discussion of suitable approaches in this thread. Review them first. If you find these existing messages are still not helpful enough, you can ask explicitly in what area more explanation is wanted. Most of the time there are someone more than willing to help.

2 Likes

Totally agree, @FoxLee.

Don’t let difficulty rating misfires stress you out, @edsdame. CG’s rating system is entirely subjective and there’s not an easy fix for that. There is a lot of art to coding; a broad palette of tools and tactics can be applied to any given problem. If you come up with a surefire, objective way to rate puzzles, absolutely share it.

So, ratings are subjective. Ergo, other coders’ ratings won’t always match the challenge a puzzle presents to you at your current skill level. Ratings will ballpark how long a puzzle will take to solve, but YMMV. Try not to get bent out of shape if you run into a puzzle that is unsatisfying or is more time consuming than you expected.

Instead of getting frustrated with a mismatched difficulty rating, think of it as an opportunity to practice your development meta-skills:

  • Communicate your experiences and ideas with your fellow coders in the game forum (you already did! :raised_hands:t2:). Cultivate a solution-focused mindset. Describe the problem(s) you encountered and suggest ideas to fix them.
  • If you find yourself slipping out of flow while you’re working, take a moment to consider shifting your focus. You can work on a different part of the puzzle, work on an entirely different puzzle, check the forum for hints and suggestions, or isolate and study/practice the puzzle’s suggested skills. Or stand up and go for a walk. Don’t beat your head against walls. That doesn’t do any good for the walls or your head.
7 Likes

Solved with golang 100%, after some code struggle finally got all test passed successfully. However it looks like primitive code… didn’t use memoization, lazy graph or Dependency Graph, as it was stipulated at the beginning of the task that they should be used.
I used pointers, structs if and for.

The test is unclear as to how you’re supposed to approach references that have yet to be assigned. Do you jump to the reference to calculate its value prior to assigning? I assumed that all values would start off at 0 and when I found out otherwise I’m now going to have to rewrite my code just to guess what the program wants me to do.

The instructions need to better tell people what is expected of unassigned references.

1 Like

The description makes explicit note about that

Note that a cell can reference a cell after itself!

If a cell is referencing other value then you need to calculate it first. There isn’t really any other way.

1 Like

In fact I resolve this puzzle by a multi pass technique … Very basic

3 Likes

Not in Python.

hi @MigSilvan2211,
I solved it with recursion, but had exactly the same issue in the first place, which puzzled me for some time. Indeed, the key is to use memoization. Think about this example, which was the error for me:

2
VALUE 3 _
VALUE $0 _

Is “VALUE $0 _” computed ? Obviously not … so you HAVE TO distinguish between the cells that have indeed been computed (like VALUE 3 _) and the others, even if they are of “VALUE” type.

Hope this helps.

BTW: I agree with others, this should be moved to the medium section. IMO, this problem can not be considered “easy”.

1 Like

Hello everyone,
I’m trying to resolve the puzzle using java i have passed all test except “PADOVAN”
can someone help me !

Padovan test case is similar to the Fibonacci one, but it has more cells initialized.
Try something like this:

12
VALUE 1 _
VALUE 1 _
VALUE 1 _
ADD $0 $1
ADD $1 $2
ADD $2 $3
ADD $3 $4
ADD $4 $5
ADD $5 $6
ADD $6 $7
ADD $7 $8
ADD $8 $9

Expected answer:

1
1
1
2
2
3
4
5
7
9
12
16
1 Like