💬 문제
https://app.codility.com/programmers/trainings/4/str_symmetry_point/
💬 Idea
- 중간 인덱스까지 비교하며 같지 않다면 return -1, 같다면 mid를 리턴한다.
💬 풀이
publicfunc solution(_ S :inoutString)->Int{ifS.count %2==0{return-1}letmid=S.count /2varstart=0varend=S.count -1lets=Array(S).map({String($0)})while start < mid {ifs[start]!=s[end]{return-1}
start +=1
end -=1}return mid
}효율성 0점 풀이 : https://app.codility.com/demo/results/trainingDY7DPQ-PFH/
100점 풀이 : https://app.codility.com/demo/results/trainingZNRGGS-24G/
💬 문제https://app.codility.com/programmers/trainings/4/str_symmetry_point/
💬 Idea💬 풀이효율성 0점 풀이 : https://app.codility.com/demo/results/trainingDY7DPQ-PFH/
100점 풀이 : https://app.codility.com/demo/results/trainingZNRGGS-24G/