IN THIS PROBLEM I DON'T UNDERSTAND THE GRAPH APPROACH FOR THIS PROBLEM? CAN ANYBODY HELP OUT!! PROBLEM LINK TUTORIAL LINK
# | User | Rating |
---|---|---|
1 | jiangly | 3640 |
2 | Benq | 3593 |
3 | tourist | 3572 |
4 | orzdevinwang | 3561 |
5 | cnnfls_csy | 3539 |
6 | ecnerwala | 3534 |
7 | Radewoosh | 3532 |
8 | gyh20 | 3447 |
9 | Rebelz | 3409 |
10 | Geothermal | 3408 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 173 |
2 | adamant | 164 |
3 | awoo | 162 |
4 | TheScrasse | 160 |
5 | nor | 159 |
6 | maroonrk | 156 |
7 | SecondThread | 154 |
8 | pajenegod | 147 |
9 | BledDest | 145 |
9 | Um_nik | 145 |
IN THIS PROBLEM I DON'T UNDERSTAND THE GRAPH APPROACH FOR THIS PROBLEM? CAN ANYBODY HELP OUT!! PROBLEM LINK TUTORIAL LINK
Name |
---|
Make a graph with vertexes 1, 2, ..., n; for each i a substring sisi + 1...si + k - 1 should be a palindrome, so for each i you should make edges between si and si + k - 1, between si + 1 and si + k - 2, etc. For each connected component in this graph, letters should be equal in each vertex of that component; if number of components is e then the answer is me
thanxx bro appreciate it!!!