Plans
Platforms
Requirements
Description
Pgrammer is an online service that helps you practice coding for interviews. With both free and paid plans, it offers a personalized learning experience, coding challenge questions, and hints and analysis. Available on their website.
Update your previous 'binarySearch' function to handle an array with duplicate elements. The function should return the index of first occurrence of the target element in array. If the target element does not exist in the array, return -1. Inputs will be an integer array, the size of the array, and the target integer to search for.
Given a list of positive integers, write a function named 'maxPairings' that returns the maximum possible total sum of unique pairings. In each pair, the integer a could either be added or subtracted. You can pair up all the integers in the list and use each integer exactly once. Note: A pair consists of only two numbers. A sum is the sum of all possible pairs.
Return the maximum possible total sum.
Note: The list of integers will have an even number of elements.
Your task is to write a SQL query to retrieve the details of employees who have a salary greater than 50000. The employees table structure is as follows:
Employee (EmployeeId INT, FirstName VARCHAR(255), LastName VARCHAR(255), Salary Decimal(10,2), DepartmentId INT)
The output should include the FirstName, LastName, and Salary of qualifying employees and should be ordered by their salary in descending order.