[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는 앞으로 읽으나 뒤로 읽으나..
[leetcode-4] Median of Two Sorted Arrays
·
🐢 One step
LeetCode-4 Median of Two Sorted Arrays : Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. note : The overall run time complexity should be O(log (m+n)).Answer :::python class Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: p = nums1 + nums2 p.sort() if len(p)%2!=0: median = p[len(p)//2] else..
[leetcode-3] Longest Substring Without Repeating Characters
·
🐢 One step
LeetCode-3 Longest Substring Without Repeating Characters : Given a string s, find the length of the longest substring without repeating characters. note : s consists of English letters, digits, symbols and spaces.Answer :::python class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s)==1: return 1 left, right, answer_max = 0, 1, 0 for _ in range(len(s)): while (left
[RL] Soft Actor-Critic (a.k.a SAC)
·
👾 Deep Learning
https://github.com/seohyunjun/RL_SAC/blob/main/README.md GitHub - seohyunjun/RL_SAC: Soft Actor-Critic Soft Actor-Critic. Contribute to seohyunjun/RL_SAC development by creating an account on GitHub. github.com * SAC (Soft Actor-Critic) Continuous Action Space / Discrete Action Space 모든 공간에서 안정적인 Policy를 찾는 방법을 고안 기존의 DDPG / TD3에서 한번 더 나아가 다음 state의 action 또한 보고 다음 policy를 선택 (좋은 영양분만 주겠다) * Pol..
다했다
'분류 전체보기' 카테고리의 글 목록 (26 Page)