Description
There are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had different colors. Stones in a row are considered neighboring if there are no other stones between them.
Input
The first line contains integer n (1
©著作权归作者所有:来自51CTO博客作者lsh670660992的原创作品,如需转载,请注明出处,否则将追究法律责任
0
收藏
转载于:https://blog.51cto.com/huahua520amy/1373655
Ctrl+Enter 发布
发布
取消