Palindrome check · בדיקת פלindrome
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) כך שתחזir true כאשר s קורא אותו אותו דבר קדימה ואחורה, ללא הבחנת קייס ורווחים.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.