百度2019秋招--字符串計數

分析:如果輸入12345,移位分別得到:23451、34512、45123、51234、12345(重複),說明循環次數最多超過字符串長度就會重複 利用set的去重特性,和string的erase就可以輕鬆得到代碼 c++代碼如下: #include <bits/stdc++.h> using namespace std; int main() {
相關文章
相關標籤/搜索