| @@ -0,0 +1,3 @@ | |||
| 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. | |||
| @@ -0,0 +1,2 @@ | |||
| SELECT FirstName, LastName, City, State FROM Person | |||
| LEFT JOIN Address ON Person.PersonId = Address.PersonId; | |||
| @@ -0,0 +1,29 @@ | |||
| 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 | |||
| @@ -0,0 +1,3 @@ | |||
| #!/bin/bash | |||
| echo "Can't be botherd making this into a test" | |||
| @@ -0,0 +1 @@ | |||
| SELECT MAX(Salary) AS SecondHighestSalary FROM Employee WHERE Salary != (SELECT MAX(Salary) FROM Employee); | |||
| @@ -0,0 +1 @@ | |||
| Write a SQL query to get the second highest salary from the Employee table. | |||
| @@ -0,0 +1,3 @@ | |||
| #!/bin/bash | |||
| echo "Can't be botherd making this into a test" | |||
| @@ -0,0 +1 @@ | |||
| SELECT Email FROM (SELECT Email, COUNT(Email) AS cnt FROM Person GROUP BY Email) AS b WHERE cnt > 1; | |||
| @@ -0,0 +1 @@ | |||
| Write a SQL query to find all duplicate emails in a table named Person | |||
| @@ -0,0 +1,3 @@ | |||
| #!/bin/bash | |||
| echo "Can't be botherd making this into a test" | |||
| @@ -0,0 +1,15 @@ | |||
| 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]))) | |||
| @@ -0,0 +1,5 @@ | |||
| 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. | |||
| @@ -0,0 +1,3 @@ | |||
| #!/bin/bash | |||
| python3 main.py | |||
| @@ -8,8 +8,9 @@ Aiming for one a day, to try be a little consistent. | |||
| 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). | |||
| - 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 | |||
| @@ -2,6 +2,7 @@ | |||
| for f in *; do | |||
| if [ -d ${f} ]; then | |||
| echo "" | |||
| echo "Running Problem: $f" | |||
| cd $f | |||
| ./run.sh | |||