fave77 / Mathball

A JavaScript library for Competitive Programming
https://fave77.github.io/Mathball-Docs/
MIT License
99 stars 49 forks source link

Range of Palindromes #76

Closed fave77 closed 5 years ago

fave77 commented 5 years ago

Do the checklist before filing the issue:

NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it along with screenshots.

[Function: M.rangePalindrome()] needs to be added!

For more info:

M.rangePalindrome() needs to accept a positive integer and all other arguments passed should throw a type error which needs to be handled gracefully! It should return an array of palindrome numbers, that lies between 0 & the argument (inclusive).

Implementation:

exports.rangeFib = (num) => {
    .....
};

Include the function within the same module as palindrome!

Category: Range of Numbers

pydevsg commented 5 years ago

I would like to take this issue.

Shubhayu-Das commented 5 years ago

What is this function supposed to do exactly? Just curious.

nilshah98 commented 5 years ago

What is this function supposed to do exactly? It should return an array of palindrome numbers, that lies between 0 & the argument (inclusive).* Just curious.

It should return an array of palindrome numbers, that lies between 0 & the argument (inclusive).

M.rangePal(20)        // will return [0,1,2,3,4,5,6,7,8,9,11]
Shubhayu-Das commented 5 years ago

I would like to claim this issue.

fave77 commented 5 years ago

@sateslayer you're assigned!

Shubhayu-Das commented 5 years ago

Can I suggest an update for this issue:

Instead of starting from zero, we can start from a user entered number. Like: rangePal(5,20) This can add flexibility to the function.

fave77 commented 5 years ago

@sateslayer Cool. Implement it as you suggested!

Shubhayu-Das commented 5 years ago

Okay!

fave77 commented 5 years ago

Name it as rangePalindrome() as the shorter one might be confusing