본문 바로가기

분류 전체보기769

pick out something: ~를 고르다 You should help me pick out the best computer. : 내가 제일 좋은 컴퓨터를 고르게 도와줘야해 I must help my parent pick out a good outfit. : 나는 부모님이 좋은 옷을 살수 있도록 도와줘야해 My parent is planning to shop for a bunch of clothes in this department. Since they've not experienced shopping abroad, I have to help them pick out reasonable things. 2021. 3. 27.
behind schedule: 일정보다 늦다. We've already 1 week behind schedule. The progress of this project has already 1 year behind schedule. 2021. 3. 27.
be appointed: ~로 임명되다 You'll be appointed official manager. Mr.Kim will be appointed team leader. My boss will be appointed CEO in 3 weeks. 2021. 3. 27.
[LeetCode] Redeem Your Free T-Shirts LeetCode를 하다보면 코인을 받을 수 있는데.. 그렇게 받는 코인을 사용할 수 있는 Store를 발견했다. 솔직히 30-Day Premium은 그냥 나중에 별도의 Challenge를 하고싶을 때 직접 지불하면 될 것같고 (Yearly subscription 도 고려중..) 저 티셔츠가 뭐라고 탐이난다. 코인이 없어서 상품정보를 볼수조차 없게 만들어 두었는데.. 해외배송은 해줄지도 궁금하다.. 저게 뭐 별거라고 6,000 코인을 목표로 문제도 풀고 Contribution도 하는 동기부여가 된다. 2021. 3. 27.
[LeetCode] 62. Unique Paths 전형적인 DP 문제의 입문. Memoization을 위한 dp_map을 만들어 놓고 이미 방문한 경로에서 계산 된 Path 갯수를 저장해서 사용한다. class Solution { int dest_x, dest_y; int dp_map[100][100]; public: Solution () : dest_x (0), dest_y (0) { for( int i = 0; i < 100; i++) for( int j = 0; j < 100; j++) dp_map[i][j] = -1; } int dfs ( int y, int x ) { if ( y == dest_y - 1 && x == dest_x - 1 ) return 1; int rr = 0; int rd = 0; // move right if ( x + 1.. 2021. 3. 27.
make sure ( 반드시 ~해 주세요, 나는 꼭 ~를 한다 ) Please make sure to : 반드시 ~해주세요, 나는 꼭 ~한다. Please make sure to organize the stuff when you finish your works. : 일 끝나고 물건들을 정리해 주세요. I make sure to clean my room before I leave. : 난 나가기 전에 내 방을 청소해 Make sure to leave a comment on Kim's pull request. : Kim의 Pull request에 comment 를 남겨줘 Make sure that you have your purse when you go shopping. : 쇼핑갈때 지갑 챙겨 When I'm going out for more than a couple of.. 2021. 3. 27.
[LeetCode] 6. ZigZag Conversion 실수가 좀 잦은 것 같다. numRows 내에서 첫줄과 마지막줄은 고정 크기만큼 jump 가 가능하며 그 중간에서의 Jump size만 계산하면 되는 문제다. 근데 Jump Size가 0으로 나오는 경우를 처리하지 않아서 제출횟수를 좀 날렸다. class Solution { public: string convert(string s, int numRows) { // ( numRows - 2 ) * 2 // 3 : 4, 2, 4 // 4 : 6, (4,2,4,2.. ), (2,4,2,4...), 6 // 5 : 8, (6,2,6,2...), (4,4,4,4..), (2,6,2,6...), 8 int std_gap = ( numRows - 2 ) * 2 + 2; // standard gap int input_.. 2021. 3. 26.
[LeetCode] 5. Longest Palindromic Substring 대충 30분 가량 소요.. substr에 length에 문자열 연산을 마구잡이로 쓰다보니 TLE 무지막지하게 났다. 게다가 stack을 써서 push pop 하면서 LPS 를 판단했었는데 굳이 왜그랬나 싶다. 좌 우 index를 가지고 비교하도록 개선하다 보니 성능이 점점 나아졌다. class Solution { public: string longestPalindrome(string s) { auto size = s.length(); string lps; int max_length = 0; for ( int i = 0; i 0; j--) { if ( s[i] .. 2021. 3. 25.
Are you worried about something? Are you worried about something? // 뭐 걱정 되는거 있어요? What's your concern? What are you worried about? // 뭐가 걱정이야? Why are you worried about that? // 그게 왜 걱정이야? There's nothing to worry about. Why worry? // 걱정할 필요가 없다. What's there to worry about? // 걱정할게 뭐가있어? , 걱정할게 없다. What's there to talk about? // 할 얘기가 뭐가있어? I'm waiting for Mr.John to go to the restaurant. Why wait? He's always late. Just get .. 2021. 3. 24.
Had better Had better is usually contracted in spoken English. > Had better 는 축약된다. I had better meet my parent. > I'd better meet my parent. You had better go to the doctor. > You'd better go to the doctor. You had better meet her. > You'd better meet her. Sam had better not borrow my car without asking again. The president is extremely busy preparing the report for the investment today. You'd better not .. 2021. 3. 24.
Encroach, Prance, Smitten, Allude, Fleet, Right angle Encroach / v. 빼앗다, 잠식하다 - Roaches will encroach wherever there's food. - With an encroaching anxiety, I made my way to where the crashed car lay on its side. - The feature called encroachment makes it take other's resources. Prance / v. 활보하다, 껑충거리며 뛰어 다니다 - I don't prance around at all. - My children always prance in the living room. - You prance around like you're some big deal. - Cindy's horse.. 2021. 3. 22.
[LeetCode] Add Two Numbers 코드가 좀 길지않나 싶다. 줄이기는 또 귀찮고.. 문제를 제대로 안읽고 그냥 다 더해서 리스트를 만들라는건가 싶었는데 node 개수가 1~100 개라고 하니 그것은 아닌 것 같고, Node를 방문하면서 계속 만들어 내야할 것 같았다. 한 노드에 저장되는 수는 0~9 이기에 Carry 는 1이상 나오지 않는다고 생각했다. Constraints: The number of nodes in each linked list is in the range [1, 100]. 0 val + carry; if ( v >= 10 ) { v %= 10; carry = 1; } else if ( carry != 0 ) { carry = 0; } if ( l3 == nullptr ) { l3 = new ListNode(v); l3.. 2021. 3. 21.
[LeetCode] Two sum 손풀기용. 매일 한 문제 씩 풀어나갈 수 있었으면 좋겠다. 보통 LeetCode쓰는사람이 IDE에서 로컬로 따로 푸는지 아니면 그냥 페이지에서 바로 푸는지 조금 궁금하다. 클래스 써서 필요한 Test case를 넣을 수야 있지만.. 조금 귀찮기도 하고.. 그냥 브라우저에서 푸는게 최선이일련지.. class Solution { public: vector twoSum(vector& nums, int target) { auto v_size = nums.size(); int idx1, idx2 = 0; for ( int i = 0; i < v_size-1; ++i ) { for ( int j = i + 1 ; j < v_size; ++j ) { int sum = nums[i] + nums[j]; if ( sum.. 2021. 3. 21.
Getting started with MIG NVIDIA Document에 나와있는 Multi-Instance GPU 기능에 대한 개념은 어느정도 봤으니, 실제로 가이드에서 사용법을 어떻게 정리해 두었는지 보려고 한다. 가이드에도 언급이 된 부분이긴 한데, 아래 nvidia-smi 결과내용과 관련하여 실제와는 조금 다른 부분이 있다고 한다. 예시에서 GPU Instance를 2개 만들어 놓은 상태에서 Compute Intance 를 활용하는 예시를 보여주는데, 실제로 확인 해야할 부분에 집중하기 위해 일부러 나타내지 않은 정보가 있으니 이 점은 염두하고 예시를 참고해야 한다. 필요조건 MIG User guide에 나와있는 예시는 아래 조건 기반으로 작성 되었다. MIG is supported only on NVIDIA A100 products an.. 2021. 3. 21.
I almost had an accident. Almost + past tense: ~할뻔했다. - Honestly, I almost won the lottery yesterday. - I almost forgot to tell you ( 말하는걸 깜빡 할뻔 했다.) - She was on diet but, she almost had a great dinner on weekdays. Last Friday, I met one of my best friends from my hometown. be + almost + state - I'm almost done. (나 거의 다 끝났어) - Are you done cleaning your room? / Yes, I'm almost finished. - We're almost ready. - I'm almos.. 2021. 3. 20.