#include <leetcode.h>
|
static bool | canTransform (const string &start, const string &end) |
|
◆ canTransform()
bool leetcode::swap_adjacent_in_lr_string::Solution::canTransform |
( |
const string & |
start, |
|
|
const string & |
end |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 2747 行定义.
2748 auto oss_start = ostringstream();
2749 auto oss_end = ostringstream();
2750 auto i_start = vector<int>();
2751 auto i_end = vector<int>();
2752 for(
int i = 0; i < start.size(); i++) {
2754 if(ch ==
'R' || ch ==
'L') {
2756 i_start.push_back(i);
2759 for(
int i = 0; i < end.size(); i++) {
2761 if(ch ==
'R' || ch ==
'L') {
2766 string str_start = oss_start.str();
2767 string str_end = oss_end.str();
2768 if(str_start != str_end) {
2771 for(
int i = 0; i < i_start.size(); i++) {
2772 if(str_start[i] ==
'R') {
2773 if(i_start[i] > i_end[i]) {
2778 if(i_start[i] < i_end[i]) {
被这些函数引用 leetcode::swap_adjacent_in_lr_string::TEST().
该类的文档由以下文件生成: