INDAPlus21 / INDAPlus21/melg-task-7

Pass

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Very well done Marcus!**

I like your code!

My only objection is one single use of a local variable. String operations are at least linear, hence expensive. To top Kattis, make away with as much as possible.
_Your code_:
```c
char names[count * 2][42];

for (int i = 0; i < count * 2; i++)
{
char name[42];
scanf("%s", name);
strcpy(names[i], name);
}
```
_Without local middlehand_:
```c
char names[count * 2][42];

for (int i = 0; i < count * 2; i++)
{
scanf("%s", names[i]);
}
```

Keep it up!

> Lubarsky’s Law of Cybernetic Entomology: There’s always one more bug.
> Shaw’s Principle: Build a system that even a fool can use, and only a fool will want to use it.
> Woltman’s Law: Never program and drink beer at the same time.
> Gallois’ Revelation: If you put tomfoolery into a computer, nothing comes out but tomfoolery. But this tomfoolery, having passed through a very expensive machine, is somehow enobled, and no one dares to criticize it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the C source containing the shown input loop and inspect how names are read into the array. Make the loop match the direct-input form shown in the issue, then run the repository's available build or Kattis check to confirm the program still accepts the expected input.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.