일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 의존성주입
- @Transaction propagation
- frontend
- Mock vs Stub
- TypeScript
- ECMAScript
- mock stub spy
- webpack
- Spock Stub
- docker desktop 대체
- Spock Mock Stub Spy
- Vue+Typescript
- 자바스크립트
- DI
- mock stub
- 타입스크립트
- Rancher Desktop설치
- nuxtjs/composition-api buildModules
- Javascript
- Docker Desktop 쓰고싶다
- 트랜잭션 격리
- TCP/IP
- Spock Mock
- 공짜로 Docker Desktop같은거 쓰기
- @Transaction isolation
- docker desktop 유료화 정책
- vue store
- enum
- HTTP란
- Spock Spy
- Today
- Total
목록 Computer Science/Algorithm (4)
끄적끄적
회문 알고리즘 - 숫자 class Solution { public boolean isPalindrome(int x) { if ( x < 0 ) return false; String str = Integer.toString(x); int middle = str.length()/2; for (int i = 0; i < middle; i++) { if ( str.charAt(i) != str.charAt(str.length()-i-1) ) { return false; } } return true; } } runtime - 7ms memory - 38.9 mb
class Solution { public int reverse(int x) { long res = 0; while (x != 0) { res = res * 10 + x % 10; x = x / 10; } if (res Integer.MAX_VALUE) { return 0; } else { return (int)res; } } } runtime - 1ms memory - 36.6mb
class Solution { public String longestPalindrome(String s) { if (s == null || "".equals(s)) { return s; } int len = s.length(); int max = 0; String answer = ""; boolean[][] dp = new boolean[len][len]; for (int j = 0; j max) { max = j - i + 1; answer = s.substring(i, j + 1); } } } return answer; } }..
java class Solution { public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[j] == target - nums[i]) { return new int[] { i, j }; } } } throw new IllegalArgumentException("No two sum solution"); } }javascript /** * @param {number[]} nums * @param {number} target * @return {number[]} */ var twoSum = function(nums,..