A hospital has a waiting room where patients arrive and wait for doctors. The patient who comes first should be treated first. Problem: Implement a program to add patients to a queue and remove them when the doctor sees them.
Test Input: ["John", "Alice", "Bob"]
Expected Output: First served → John, Second served → Alice, Third served → BobHTML
Trains arrive and depart at different times. Find the minimum number of platforms required so that no train has to wait.
Input:
In vehicle registration, some states want special palindrome number plates (e.g., AB12321BA). Problem: Check if a given number plate is a palindrome.
Example Input: "AB12321BA"
Output: Yes, PalindromeHTML
In an e-commerce website, customer feedback is stored as a string. You need to count the number of words to analyze reviews. Input: "The product quality is very good"
Output: 6 wordsHTML
In an image editing app, rotating an image by 90° means rotating its pixel matrix. Problem: Rotate a 3x3 matrix 90° clockwiseHTML