일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Vue+Typescript
- Spock Stub
- webpack
- TypeScript
- 자바스크립트
- 타입스크립트
- 트랜잭션 격리
- Spock Mock
- Docker Desktop 쓰고싶다
- Spock Mock Stub Spy
- nuxtjs/composition-api buildModules
- docker desktop 유료화 정책
- Javascript
- 공짜로 Docker Desktop같은거 쓰기
- ECMAScript
- Rancher Desktop설치
- HTTP란
- @Transaction propagation
- frontend
- enum
- DI
- Mock vs Stub
- TCP/IP
- @Transaction isolation
- Spock Spy
- vue store
- 의존성주입
- mock stub
- docker desktop 대체
- mock stub 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,..