瀏覽代碼

Added first puzzle and more requirements

master
Lachlan Jacob 5 年之前
父節點
當前提交
cfbf97896d
共有 3 個檔案被更改,包括 26 行新增1 行删除
  1. 14
    0
      125/main.py
  2. 3
    0
      125/run.sh
  3. 9
    1
      README.md

+ 14
- 0
125/main.py 查看文件

@@ -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 查看文件

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

python3 main.py

+ 9
- 1
README.md 查看文件

@@ -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

Loading…
取消
儲存