Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. | |||||
Note: For the purpose of this problem, we define empty string as valid palindrome. |
SELECT FirstName, LastName, City, State FROM Person | |||||
LEFT JOIN Address ON Person.PersonId = Address.PersonId; |
Table: Person | |||||
+-------------+---------+ | |||||
| Column Name | Type | | |||||
+-------------+---------+ | |||||
| PersonId | int | | |||||
| FirstName | varchar | | |||||
| LastName | varchar | | |||||
+-------------+---------+ | |||||
PersonId is the primary key column for this table. | |||||
Table: Address | |||||
+-------------+---------+ | |||||
| Column Name | Type | | |||||
+-------------+---------+ | |||||
| AddressId | int | | |||||
| PersonId | int | | |||||
| City | varchar | | |||||
| State | varchar | | |||||
+-------------+---------+ | |||||
AddressId is the primary key column for this table. | |||||
Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people: | |||||
FirstName, LastName, City, State | |||||
#!/bin/bash | |||||
echo "Can't be botherd making this into a test" |
SELECT MAX(Salary) AS SecondHighestSalary FROM Employee WHERE Salary != (SELECT MAX(Salary) FROM Employee); |
Write a SQL query to get the second highest salary from the Employee table. |
#!/bin/bash | |||||
echo "Can't be botherd making this into a test" |
SELECT Email FROM (SELECT Email, COUNT(Email) AS cnt FROM Person GROUP BY Email) AS b WHERE cnt > 1; |
Write a SQL query to find all duplicate emails in a table named Person |
#!/bin/bash | |||||
echo "Can't be botherd making this into a test" |
class Solution: | |||||
def plusOne(self, digits): | |||||
numberString = "" | |||||
for n in digits: | |||||
numberString += str(n) | |||||
number = int(numberString) + 1 | |||||
final = [] | |||||
for digit in str(number): | |||||
final.append(int(digit)) | |||||
return final | |||||
s = Solution() | |||||
print("Expected: [1, 2, 4]") | |||||
print("Got:", str(s.plusOne([1, 2, 3]))) |
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. | |||||
The digits are stored such that the most significant digit is at the head of the list, and each element in the array contain a single digit. | |||||
You may assume the integer does not contain any leading zero, except the number 0 itself. |
#!/bin/bash | |||||
python3 main.py |
Folder Names will Be Puzzle Numbers and contain: | Folder Names will Be Puzzle Numbers and contain: | ||||
- `problem.txt` - A plain text file with a problem description. | |||||
- `main.<language extension>` will be the code submitted. (Some code may have to be modified to run outside of LeetCode's driver). | - `main.<language extension>` will be the code submitted. (Some code may have to be modified to run outside of LeetCode's driver). | ||||
- run.sh (This will contain a bash scipt to run/compile+run the code. | |||||
- `run.sh` (This will contain a bash scipt to run/compile+run the code. | |||||
## Necessary Dependencies | ## Necessary Dependencies | ||||
for f in *; do | for f in *; do | ||||
if [ -d ${f} ]; then | if [ -d ${f} ]; then | ||||
echo "" | |||||
echo "Running Problem: $f" | echo "Running Problem: $f" | ||||
cd $f | cd $f | ||||
./run.sh | ./run.sh |