Palindrome check · Kiểm tra palindrome
Palindrome check
A palindrome reads the same forwards and backwards. Return true if s does, ignoring case and spaces, so Race car counts. Clean the string first (toLowerCase, remove spaces), then compare characters moving inward from both ends.
Kiểm tra palindrome
Một palindrome đọc giống nhau theo cả chiều thuận và ngược. Trả về true nếu s làm điều đó, bỏ qua chữ hoa/thường và khoảng trắng, vì vậy Race car được tính. Làm sạch chuỗi trước (toLowerCase, xóa khoảng trắng), sau đó so sánh các ký tự tiến vào từ cả hai đầu.
Complete isPalindrome(String s) so it returns true when s reads the same forwards and backwards, ignoring case and spaces. · Hoàn thành isPalindrome(String s) để trả về true khi s đọc giống nhau từ trái sang phải và từ phải sang trái, bỏ qua chữ hoa/thường và khoảng trắng.
Click Run to see the output here. · Nhấn Chạy để xem kết quả ở đây.