Outline ·
[ Standard ] ·
Linear+
Algorithmic question
TSFlierMate
|
May 10 2021, 12:08 PM, updated 3y ago
|
|
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
|
May 10 2021, 01:41 PM
|
misutā supākoru
|
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
|
May 10 2021, 06:31 PM
|
|
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
|
May 11 2021, 02:21 PM
|
misutā supākoru
|
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.
|
|
|
|