Closed Aishwarya-S-Sharma closed 2 weeks ago
@Aishwarya-S-Sharma
Thank you for opening this Issue 🙌! We’re thrilled to have you join us for Hacktoberfest 💖. We’ll review your submission and get back to you shortly.
In the meantime, please remember to give this repo a star! ⭐ We appreciate your contribution!
Hii @Kushal997-das Please assign this issue to me
Hi there! I am the Mentor of this project. Although this repo is not part of Hacktoberfest 2024, we have some great alternatives for you. Welcome to SkillShow, a repository focused on skill enhancement!
Guidelines:
Note: Start by creating an issue. Once it’s assigned to you, feel free to open a pull request (PR). Directly opening a PR will lead to an invalid
label.
Looking forward to your contributions!
Ceil The Floor
Problem Given an unsorted array arr[] of integers and an integer x, find the floor and ceiling of x in arr[].
Floor of x is the largest element which is smaller than or equal to x. Floor of x doesn’t exist if x is smaller than smallest element of arr[]. Ceil of x is the smallest element which is greater than or equal to x. Ceil of x doesn’t exist if x is greater than greatest element of arr[].
Return an array of integers denoting the [floor, ceil]. Return -1 for floor or ceiling if the floor or ceiling is not present.
Examples:
Input: x = 7 , arr[] = [5, 6, 8, 9, 6, 5, 5, 6] Output: 6, 8 Explanation: Floor of 7 is 6 and ceil of 7 is 8.
Input: x = 10 , arr[] = [5, 6, 8, 8, 6, 5, 5, 6] Output: 8, -1 Explanation: Floor of 10 is 8 but ceil of 10 is not possible.