Skip to content

Latest commit

 

History

History

characterParity

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Check Out My YouTube Channel

Algorithm Challenge Available At CodeFights

Given a character, check if it represents an odd digit, an even digit or not a digit at all.

Example

  • For symbol = '5', the output should be characterParity(symbol) = "odd";
  • For symbol = '8', the output should be characterParity(symbol) = "even";
  • For symbol = 'q', the output should be characterParity(symbol) = "not a digit".

Hints

  • isNaN()
  • parseInt()

Input/Output

  • [execution time limit] 5 seconds (ts)
  • [input] char symbol
  • [output] string