목록c++ (29)
Game Tech Blog
[문제] You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots. Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise. [TC] Exa..
[문제] There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have. Return a boolean array result of length n, where result[i] is true if, after giving the ith kid all the extraCandies, they will have the greatest number of candies among..
[문제] For two strings s and t, we say "t divides s" if and only if s = t + ... + t (i.e., t is concatenated with itself one or more times). Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2. [TC] Example 1: Input: str1 = "ABCABC", str2 = "ABC" Output: "ABC" Example 2: Input: str1 = "ABABAB", str2 = "ABAB" Output: "AB" Example 3: Input: str1 = "LEE..
[문제] You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string. Return the merged string. [TC] Example 1: Input: word1 = "abc", word2 = "pqr" Output: "apbqcr" Explanation: The merged string will be merged as so: word1: a b c word2: ..
- 제목 : C, C++ 게임 코드로 알아보는 코딩의 기술 - 저자 / 옮긴이 : 오즈 모지하루 / 윤인성 업무를 진행하다 보면, 더 효율적이고 가독성 좋은 코드를 작성하고 싶은 생각이 자주든다 좋은 도서를 찾다가 운좋게 회사 동료분께서 이 책을 가지고 있어서 잠시 빌릴 수 있었다 표지만 보면 되게 가벼운 내용을 다루게 생겼는데, 의외로 다 알지만 간과하고 있을만한 팁들을 알려주는 좋은 도서였다. 다음은 크게 읽으면서, 고민했던 부분이다. 몇몇은 아직도 왜 저렇게 해야하는가에 대한 의문이 있지만, 대부분 읽다보니 저자의 의도가 조금은 이해가 갔다. - 반복문 분할, 하나의 반복문엔 하나의 처리만 한다. 아직까지 이해가 가지 않는 부분 중, 하나이다. 반복문을 돌리면서 처리와 또 다른 연산이 필요할때, 처..