File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 8585 * [ Fibonacci] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/fibonacci.r )
8686 * [ First N Fibonacci] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/first_n_fibonacci.r )
8787 * [ Greatest Common Divisor] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/greatest_common_divisor.r )
88+ * [ Palindrome Check] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/isPalindrome.r )
8889 * [ Josephus Problem] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/josephus_problem.r )
8990 * [ Least Common Multiple] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/least_common_multiple.r )
9091 * [ Modular Exponentiation] ( https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/modular_exponentiation.r )
Original file line number Diff line number Diff line change 1- # Palindrome Number Checking in R
1+ # ' Check if a number is a palindrome
2+ # '
3+ # ' @description Checks if an integer is a palindrome (reads the same forwards
4+ # ' and backward) without using strings. Negative numbers are not palindromes.
5+ # ' @param number The integer to check.
6+ # ' @return TRUE if the number is a palindrome, FALSE otherwise.
7+ # ' @examples
8+ # ' isPalindrome(121)
9+ # ' isPalindrome(123)
10+
211isPalindrome <- function (number ) {
312 # Negative numbers are not considered palindromes
413 if (number < 0L ) {
You can’t perform that action at this time.
0 commit comments