[LeetCode OJ - Algorithm 알고리즘 문제] Romans to Integer - Easy

Posts

[LeetCode OJ - Algorithm 알고리즘 문제] Romans to Integer - Easy

로마 숫자를 십진수로 변환하는 함수 작성이다.로마숫자는 기이하게도 1,5,10 단위로 문자가 하나씩 주어지며,각 문자의 개수 조합과 그 위치에 의하여 값을 의미한다. 기본적으로는 모든 문자열의 값을 전부 더하면 되지만 예외가 있다.5 와 10의 숫자의 좌측에 1이 위치함으로서 4 와 9를 나타낸다는것. 이것에 대한 고려를 해준다면.. 생각보다 해답은 간단하게 풀린다. Python - Accepted 효율성은 그닥 좋아보이지 않는다.딱1회의 스캔만을 가지고 끝내버리는 방법이 분명 있을것 같긴 한데... 흠 class Solution(object): list2 = ['CM','CD','XC','X

Related Posts

3 posts

리눅스 bash 스크립트에서 배열/연관배열 초기화

반달가면|2022년 8월 3일

bash 스크립트에서 사용중이던 배열(array) 또는 연관배열(associative array)의 모든 원소를 삭제하고 싶다면 빈 배열을 할당하면 된다. x[0]='abc' x[1]='def' # x 초기화 x=() 연관배열도 동일하다. declare -A a_x a_x[abc]=1 a_x[aaa]=2 # a_x 초기화 a_x=() 배열의 사용에 대한 추가적인 내용은 아래의 링크를 참고하자.

프로그램 만드는 AI, 알파코드

프로그램 만드는 AI, 알파코드https://alphacode.deepmind.com/https://news.naver.com/main/read.naver?mode=LSD&mid=shm&sid1=105&oid=421&aid=0005880752https://www.dongascience.com/news.php?idx=52123-------------------------------------------------------------------------------------------------------------- 2012년이 딥러닝의 원년이다.2011년 Relu 함수의 출현 : vanishing gradient problem 해결, 표현력이 높은 딥러닝이 시작됨.2012년

cycleGAN

cycleGAN [unpaired image-to-image translation] How to Develop a CycleGAN for Image-to-Image Translation with Keras (machinelearningmastery.com)A Gentle Introduction to CycleGAN for Image Translation (machinelearningmastery.com)https://www.kaggle.com/upamanyumukherjee/cyclegan[Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks][1703.10593] Unpaired Image-to-Image Tran