분류 전체보기
-
283. Move Zeroes javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 23:22
https://leetcode.com/problems/move-zeroes/ Move Zeroes - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com # 첫 번째 시도 (실패) class Solution { public void moveZeroes(int[] nums) { List a = new ArrayList(); for (int num:nums) { if (num != 0) { a.add(num); } } for (int i = 0; i < nums.leng..
-
🎵 189. Rotate Array javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 22:42
https://leetcode.com/problems/rotate-array/ Rotate Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com # 첫 시도 (배열->배열 복사 실패) class Solution { public void rotate(int[] nums, int k) { for (int i = 0; i < k; i++) { int lastNum = nums[nums.length-1]; int[] ans = new int[nums.length..
-
977. Squares of a Sorted Array javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 22:16
https://leetcode.com/problems/squares-of-a-sorted-array/ Squares of a Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public int[] sortedSquares(int[] nums) { int[] ans = new int[nums.length]; for (int i = 0; i < nums.length; i++) { ans[i] = (int) Ma..
-
35. Search Insert Position javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 18:16
https://leetcode.com/problems/search-insert-position/?envType=study-plan&id=algorithm-i Search Insert Position - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public int searchInsert(int[] nums, int target) { int start = 0; int end = nums.length - 1; int ans = 0;..
-
278. First Bad Version javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 16:53
https://leetcode.com/problems/first-bad-version/?envType=study-plan&id=algorithm-i First Bad Version - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com /* The isBadVersion API is defined in the parent class VersionControl. boolean isBadVersion(int version); */ public class Solution ..
-
704. Binary Search javaLeetCode_Study_Plan/Algorithm 2022. 12. 20. 16:01
https://leetcode.com/problems/binary-search/description/?envType=study-plan&id=algorithm-i Binary Search - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public int search(int[] nums, int target) { int start = 0; int end = nums.length-1; int idx = -1; while (start..
-
RedisBackend/DB 2022. 12. 19. 20:38
지난번, 세션 vs 쿠키 vs 토큰 게시물에서 일반적으로 세션관리를 할 때엔 DB가 필요하고 유저가 늘어날수록 그에 따른 비용이 증가한다. 이럴 때 사용하는 것이 빠르고 저렴한 Redis DB라고 한다. 가볍게 찾아봤을 땐, Redis는 일반적인 DB와 형태가 다른다고만 알고 있었는데 조금 더 구체적으로 알아보고자 한다. Redis를 4개의 키워드로 설명해보고자 한다. 1. Remote Dictionary Server Redis는 우리에게 친숙한 RDB 형태가 아닌 RDS 방식이다. RDS는 Remote Dictionary Server로 외부에 있는 Key-Value쌍으로 데이터를 저장하는 서버라는 것을 알 수 있다. 이러한 Key-Value로 저장되는 형태 덕분에 별도 쿼리 없이도 데이터를 간단히 가져..