본문 바로가기

분류 전체보기150

[leetcode] PopulatingNextRightPointersinEachNode https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ Populating Next Right Pointers in Each Node - 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 import java.util.ArrayDeque; import java.util.Queue; public class PopulatingNextRightPointersinEachNode { public .. 2020. 11. 29.
[leetcode] Permutations https://leetcode.com/problems/permutations/ Permutations - 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 import java.util.ArrayList; import java.util.List; public class Permutations { public static void main(String[] args) { System.out.println(permute(new int[] {1})); } static Li.. 2020. 11. 29.
[leetcode] PacificAtlanticWaterFlow https://leetcode.com/problems/pacific-atlantic-water-flow/ Pacific Atlantic Water Flow - 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 import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; import java.util.Queue; public class PacificAtlanticWaterFlow { p.. 2020. 11. 29.
[leetcode] NumberofIslands https://leetcode.com/problems/number-of-islands/ Number of Islands - 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 import java.util.ArrayDeque; import java.util.Queue; //Complete public class NumberofIslands { public static void main(String[] args) { char[][] param = new char[][].. 2020. 11. 29.
[leetcode] String to Integer (atoi) leetcode.com/problems/string-to-integer-atoi/ String to Integer (atoi) - 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 public class MyAtoi { public static void main(String[] args) { System.out.println(myAtoi("2147483646")); } public static int myAtoi(String s) { // Discard whites.. 2020. 11. 29.
[leetcode] MinStack https://leetcode.com/problems/min-stack/ Min Stack - 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 import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Stack; public class MinStack { private Stack stack; private List list; public stati.. 2020. 11. 29.
[leetcode] MinimumPathSum https://leetcode.com/problems/minimum-path-sum/ Minimum Path Sum - 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 public class MinimumPathSum { public static void main(String[] args) { System.out.println(minPathSum(new int[][] { {1,3,1}, {1,5,1}, {4,2,1} })); } // DP public static.. 2020. 11. 29.
[leetcode] MergeKLists leetcode.com/problems/merge-k-sorted-lists/ Merge k 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 import java.util.ArrayList; import java.util.Comparator; import java.util.List; public class MergeKLists { public static void main(String[] args) { ListNode node5 = ne.. 2020. 11. 29.
[leetcode] MergeIntervals https://leetcode.com/problems/merge-intervals/ Merge Intervals - 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 import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; //Complete public class MergeIntervals { public static void main(String[] args) { // Sy.. 2020. 11. 29.