当前位置:首页 » 翻译 
  • 匿名
关注:1 2013-05-23 12:21

求翻译:You are given a string s containing only the letters 'A' and 'B'. The letters are arranged in a circle, so the last and first characters are adjacent. You will perform a series of swaps until all the 'A's form one consecutive sequence and all the 'B's form another consecutive sequence. In each swap, you can select any two characters and swap them. Find the minimal number of swaps necessary to reach your goal.是什么意思?

待解决 悬赏分:1 - 离问题结束还有
You are given a string s containing only the letters 'A' and 'B'. The letters are arranged in a circle, so the last and first characters are adjacent. You will perform a series of swaps until all the 'A's form one consecutive sequence and all the 'B's form another consecutive sequence. In each swap, you can select any two characters and swap them. Find the minimal number of swaps necessary to reach your goal.
问题补充:

  • 匿名
2013-05-23 12:26:38
您有包含仅字母 'A' 和 'B' 的字符串 s。字母排列的圆圈,所以最后一次和第一个字符是相邻。您将执行一系列的互换直到所有 'A 的形成一个连续序列和所有' B 的形成另一种的连续序列。在每个交换,可以选择任意两个字符,并更换它们。找到掉期交易的最小数量要达到您的目标。
 
 
网站首页

湖北省互联网违法和不良信息举报平台 | 网上有害信息举报专区 | 电信诈骗举报专区 | 涉历史虚无主义有害信息举报专区 | 涉企侵权举报专区

 
关 闭