LeetCode_Study_Plan
-
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..
-
876. Middle of the Linked List javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 5. 23:29
https://leetcode.com/problems/middle-of-the-linked-list/?envType=study-plan&id=level-1 class Solution { public ListNode middleNode(ListNode head) { Map map = new HashMap(); int i = 0; for (; head != null; i++) { map.put(i, head); head = head.next; } int middle = Math.round(i/2); return map.get(middle); } }
-
21. Merge Two Sorted Lists javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 5. 23:12
https://leetcode.com/problems/merge-two-sorted-lists/?envType=study-plan&id=level-1 Merge Two Sorted Lists - 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 ListNode mergeTwoLists(ListNode list1, ListNode list2) { ListNode sortedNode = new ListNode(); ListNo..
-
206. Reverse Linked List javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 5. 22:08
https://leetcode.com/problems/reverse-linked-list/?envType=study-plan&id=level-1 Reverse Linked List - 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 ListNode reverseList(ListNode head) { ListNode reversedNode = null; while(head != null){ ListNode tmp = hea..
-
392. Is Subsequence javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 4. 23:16
https://leetcode.com/problems/is-subsequence/ class Solution { public boolean isSubsequence(String s, String t) { String[] s_lt = s.split(""); String[] t_lt = t.split(""); if (s.length() == 0) return true; int index = 0; for(String each_t: t_lt){ if (index == s_lt.length) return true; if(s_lt[index].equals(each_t)){ index++; } } if (index == s_lt.length) return true; return false; } }