Write a program to create a function that determines whether elements in an array can be re-arranged to form a consecutive list of numbers where each number appears exactly once. The difference between two numbers will be 1 always.
Input The program will take an integer N as the size of an array. Then it will take the integer values of the array M[].
5
4 2 3 1 0
Output
true
Input
6
1 2 3 4 4 5
Output
false
Notes: If there are any duplicates, it's impossible to form a consecutive list
Write a program to create a function that determines whether a string is a valid code. A code must begin with a pound key # and is exactly 6 characters in length. Each character must be a digit from 0-9 or an alphabetic character from A-F. All alphabetic characters may be uppercase or lowercase.
Input
The program will take a string #CD5C5C
as input.
Output
The output will print either true
or false