[leetcode-10] Regular Expression Matching
ยท
๐Ÿข One step
LeetCode-10 Regular Expression Matching : Given an input string s and a pattern p, implement regular expression matching note : The matching should cover the entire input string (not partial).Answer :::python class Solution: def isMatch(self, s: str, p: str) -> bool: if len(re.findall(p,s))>0: return s == re.findall(p,s)[0] else: return False Result : 201ms Memory: 13.9mbSolve :::python class So..
[leetcode-8] String to Integer (atoi)
ยท
๐Ÿข One step
LeetCode-8 String to Integer (atoi) : Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). note : integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1.Answer :::python class Solution: def myAtoi(self, s: str) -> int: left = 0 k = '' p = '' for l ..
Choose Your Weapon:Survival Strategies for Depressed AI Academics
ยท
๐Ÿ‘พ Deep Learning
https://arxiv.org/abs/2304.06035  Choose Your Weapon: Survival Strategies for Depressed AI AcademicsAre you an AI researcher at an academic institution? Are you anxious you are not coping with the current pace of AI advancements? Do you feel you have no (or very limited) access to the computational and human resources required for an AI research breakthrarxiv.org Abstract AI ์ข…์‚ฌ์ž์ธ๊ฐ€์š”? ๋„ต ์ ์  ์ปค์ ธ๊ฐ€๋Š” AI..
[leetcode-6] Zigzag Conversion
ยท
๐Ÿข One step
LeetCode-6 Zigzag Conversion : The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows note : like this: (you may want to display this pattern in a fixed font for better legibility)Answer :::python class Solution: def convert(self, s: str, numRows: int) -> str: if numRows==1: return s answer = '' interval = numRows + (numRows-2) ls = [[''] for _ in ra..
[leetcode-7] Reverse Integer
ยท
๐Ÿข One step
LeetCode-7 Reverse Integer : Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. note : Assume the environment does not allow you to store 64-bit integers (signed or unsigned).Answer :::python class Solution: def reverse(self, x: int) -> int: if x > 0: x = int(str(x)[::-1..
[leetcode-9] Palindrome Number
ยท
๐Ÿข One step
LeetCode-9 PalindromeNumber : Given an integer x, return true if x is a palindrome, and false otherwise. note : From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.Answer :::python class Solution: def isPalindrome(self, x: int) -> bool: return str(x) == str(x)[::-1] Result : 57ms Memory: 13.7mb PalindromeNumber PalindromeNumber๋Š” ์•ž์œผ๋กœ ์ฝ์œผ๋‚˜ ๋’ค๋กœ ์ฝ์œผ๋‚˜..
๋‹คํ–ˆ๋‹ค
B's