Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Algorithmic question

views
     
TSFlierMate
post May 10 2021, 12:08 PM, updated 3y ago

On my way
****
Validating
543 posts

Joined: Nov 2020
Maybe I am too old to join one. I spent 15 minutes wandering without understanding the question of the problem set:

QUOTE
...the goodness score of a string as the number of indices i such that Si≠SN−i+1 where 1≤i≤N/2 (1-indexed). For example, the string CABABC has a goodness score of 2 since S2≠S5 and S3≠S4.


Why is CABABC has goodness of score of 2???

QUOTE
a string S of length N,


This post has been edited by FlierMate: May 10 2021, 12:10 PM
wKkaY
post May 10 2021, 01:41 PM

misutā supākoru
Group Icon
VIP
6,008 posts

Joined: Jan 2003
Basically it's saying that goodness is the number of letters on opposite ends of the string, that are different.

CABABC
123321

1. C = C
2. A != B
3. B != A

goodness is 2, because 2 are different.

Re. "too old" - do you have a CS background? Part of the course is learning to decipher such statements 😅
TSFlierMate
post May 10 2021, 06:31 PM

On my way
****
Validating
543 posts

Joined: Nov 2020
QUOTE(wKkaY @ May 10 2021, 01:41 PM)
Basically it's saying that goodness is the number of letters on opposite ends of the string, that are different.

CABABC
123321

1. C = C
2. A != B
3. B != A

goodness is 2, because 2 are different.

Re. "too old" - do you have a CS background? Part of the course is learning to decipher such statements 😅
*
Excellent! I understand a little bit better now. Maybe because I am from CE (engineering) background, algorithms are difficult for me to understand most of the time.
wKkaY
post May 11 2021, 02:21 PM

misutā supākoru
Group Icon
VIP
6,008 posts

Joined: Jan 2003
QUOTE(FlierMate @ May 10 2021, 06:31 PM)
Excellent! I understand a little bit better now.  Maybe because I am from CE (engineering) background, algorithms are difficult for me to understand most of the time.
*
Ah ok. If you've never learned such language before, you will be at a disadvantage understanding them. If it's something you're interested in, you can build it up by taking some first year math and CS courses, doing algorithm puzzles like leetcode, etc.

 

Change to:
| Lo-Fi Version
0.0138sec    0.62    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 04:42 PM