Ver código fonte

Added first puzzle and more requirements

master
Lachlan Jacob 5 anos atrás
pai
commit
cfbf97896d
3 arquivos alterados com 26 adições e 1 exclusões
  1. 14
    0
      125/main.py
  2. 3
    0
      125/run.sh
  3. 9
    1
      README.md

+ 14
- 0
125/main.py Ver arquivo

@@ -0,0 +1,14 @@
# This problem was to check (case insensitively) if a given str is a palindrome

class Solution:
def isPalindrome(self, s: str) -> bool:
newString = ""
for c in s:
if ord(c.lower()) <= 122 and ord(c.lower()) >= 97 or (ord(c) >= 48 and ord(c) <= 57):
newString += c.lower()
return newString == newString[::-1]

s = Solution()
print("Expect: True")
print("Got:", s.isPalindrome("aba"))

+ 3
- 0
125/run.sh Ver arquivo

@@ -0,0 +1,3 @@
#!/bin/bash

python3 main.py

+ 9
- 1
README.md Ver arquivo

@@ -9,5 +9,13 @@ Aiming for one a day, to try be a little consistent.
Folder Names will Be Puzzle Numbers and contain:

- 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

To run all problems you will need installed on your system:

- python3 (preferably >3.8)
- rustc
- gcc
- SQlite

Carregando…
Cancelar
Salvar