Palindrome check · فحص التناظر
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.
التحقق من العكسية
العكسية تُقرأ بنفس الاتجاهين. أدرِ true إذا فعلها s، متجاهلاً حالة الأحرف والمسافات، لذا Race car يعدّ. نظّف السلسلة أولاً (toLowerCase، أزل المسافات)، ثم قارن الأحرف بالتحرك للداخل من كلا الطرفين.
Complete isPalindrome(String s) so it returns true when s reads the same forwards and backwards, ignoring case and spaces. · أكمل isPalindrome(String s) لتُرجع true عندما يقرأ s بنفس الاتجاهين (أمامياً وخلفياً)، مع تجاهل حالة الأحرف والمسافات.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.