이번에 Singular Events 코드가 정상적으로 작동하지 않는 문제가 있어 해결하던 중 원인이기도 했고 제대로 알지못한 상태에서 설정했었다보니 다음부터는 조심하려는 의미로 작성해본다. Use R8 ? 이 옵션은 Android 빌드에서만 사용할 수 있으며 R8 코드 축소기를 활성화한다. R8은 게임 코드의 크기를 더욱 줄이기 위해 고급 코드 최적화를 수행하는 Google에서 제공하는 도구이다. 이 옵션은 게임의 APK 크기를 줄이고 Android 기기에서 성능을 향상시키는 데 도움이 될 수 있다. Release ? 이 옵션은 게임의 최종 릴리스 빌드에 대한 코드 최적화 및 최소화를 활성화한다. 릴리스 옵션으로 게임을 빌드하면 코드가 최적화되고 축소되어 크기가 줄어들고 성능이 향상된다. 이 옵션은 게임..
계기 Block Puzzle Game 게임 제작 도중 스코어 세자리마다 콤마를 추가해달라는 요청이 생겨 알아보게 되었다. 보기에는 숫자로 보이지만 실상 Text Component로 이루어서 있어 string으로 되어있는데, 사용하면서 tostring이나 int.parse를 사용했었는데 콤마를 어떻게 넣을지 어려웠었다. 방법 의외로 방법은 간단했는데, int 혹은 string 형식에 콤마를 넣을때는 int score = 36500; Debug.Log(String.Format("{0:#,0}", score)); // "36,500" 위와 같이 사용하고 현재 score와 save된 score를 비교해야 할때 int로 변환하면서 콤마를 삭제하는 로직이 필요하다. string score = "36,500"; //..
Sort List Given the head of a linked list, return the list after sorting it in ascending order. Example 1: Input: head = [4,2,1,3] Output: [1,2,3,4] Example 2: Input: head = [-1,5,3,4,0] Output: [-1,0,3,4,5] Example 3: Input: head = [] Output: [] Constraints: The number of nodes in the list is in the range [0, 5 * 104]. -105 head.next!.val) { [head.val, head.next!.val] = [head.next!.val, head.va..
Linear Probing 방식의 Hash Table hash table은 JavaScript에서 { "key" : { "innerKey" : "value" } } 와 같이 사용하는것을 지칭하는것으로 알고 있었는데, linear probing방식으로 구현해보는 과제가 주어져 일단 linear probing이 무엇인지부터 알아보아야겠다. Linear Probing ? 위키디피아에 따르면 linear probing이란, 해시 테이블 의 충돌을 해결하기 위한 컴퓨터 프로그래밍 방식 , 키-값 쌍 의 컬렉션을 유지 관리 하고 주어진 키와 관련된 값을 찾기 위한 데이터 구조 라고한다. 세션을 듣던 중 해싱된 키값이 중복될경우 다음 해싱된 키값으로 저장하는 로직으로 설명을 들었던것을 참고하여 구현하면 될것으로 보인..
Contains Duplicate II Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j)
Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums[1] == 9, we return [0..
Evaluate Reverse Polish Notation You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation. Evaluate the expression. Return an integer that represents the value of the expression. Note that: The valid operators are '+', '-', '*', and '/'. Each operand may be an integer or another expression. The division between two integers always truncates t..
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes the stack object. void push(int val) pushes the element val onto the stack. void pop() removes the element on the top of the stack. int top() gets the top element of the stack. int getMin() retrieves the minimum element in the stack. You must impl..