Prime Time
Function Name: isPrimeTime
Description
Write a function called isPrimeTime that determines whether the provided time (hours and minutes) can be represented as a prime number when concatenated. For instance, 15:31 would become 1531, and you would need to determine if 1531 is a prime number or not. Hours should be in the range of 0 to 23, and minutes should be in the range of 0 to 59. The function should not consider leading zeroes (e.g., 03:07 should be treated as 307).
Requirements
- The function must take two integers as arguments, representing hours and minutes.
- The function must return a boolean value: true if the time as a concatenated number is prime, false otherwise.
- Hours must be validated to be between 0 and 23, and minutes between 0 and 59.
- There should be no leading zeroes in the concatenated number.
- You should not rely on any external libraries for prime number determination.
- INTEGER OVERFLOW: For the purpose of this challenge, you may assume that the concatenated number will always fit within the bounds of a standard integer representation in the language of choice.
Examples
Example 1: isPrimeTime(3, 47) should return true, as 347 is a prime number.Example 2: isPrimeTime(18, 0) should return false, as 1800 is not a prime number.Example 3: isPrimeTime(23, 57) should return true, as 2357 is a prime number.
Links
Balanced Brackets
Mon Dec 30 2024
In this task, you are required to write a function `isBracketsBalanced` that takes a single string parameter containing various types of brackets such as `(), {}, []`. The function must check whether the input string's brackets are balanced. In the context of this challenge, balanced brackets mean that each opening bracket has a matching closing bracket, and the pairs of brackets are properly nested. Your function must return a boolean result indicating whether the brackets are balanced or not.
Symmetric Tree Check
Wed Jan 01 2025
Write a function that takes the root node of a binary tree as its parameter and returns a boolean indicating whether the tree is symmetric around its center. A binary tree is considered symmetric if it can be divided into two halves that are mirror images of each other.The function should handle trees with any number of nodes, and nodes may have the value of any integer.A tree with zero nodes (empty tree) should be considered symmetric.