← 返回 meta 的题目列表Freedom Trail-like Problem
类型:online_judge
Given a string ring of N characters arranged in a circle, compute the minimum number of clockwise or counter-clockwise steps to spell the given string key using characters from ring in order. After spelling each character, you can choose to start the next character from any position on the ring. Calculate the minimum steps required.
Example
Input
godding