Home
MINJUN
Cancel

LeetCode. 31. Next Permutation

[Link] https://leetcode.com/problems/next-permutation/ import java.util.Arrays; class Solution { public void nextPermutation(int[] nums) { int len = nums.length, max = nums[len - 1...

LeetCode. 30. Substring with Concatenation of All Words

[Link] https://leetcode.com/problems/substring-with-concatenation-of-all-words/ class Solution { public List<Integer> findSubstring(String s, String[] words) { int wlen = wor...

LeetCode. 29. Divide Two Integers

[Link] https://leetcode.com/problems/divide-two-integers/ class Solution { public int divide(int dividend, int divisor) { long quotient = 0, temp = 0, dividendL, divisorL; ...

Programmers. Stock Price

[Link] https://programmers.co.kr/learn/courses/30/lessons/42584?language=java import java.util.*; class Solution { public int[] solution(int[] prices) { int[] answer = new int[prices...

Programmers. Disk Controller

[Link] https://programmers.co.kr/learn/courses/30/lessons/42627?language=java# import java.util.Arrays; import java.util.PriorityQueue; class Solution { public int solution(int[][] jobs) { ...

BOJ. Closest two Point (2261)

[Link] https://www.acmicpc.net/problem/2261 import java.util.*; import java.util.stream.Stream; import java.io.*; public class Main { public static void main(String[] args) throws IOException...

LeetCode. 28. Implement strStr()

[Link] https://leetcode.com/problems/implement-strstr/ class Solution { public int strStr(String haystack, String needle) { int hayIdx = 0, needleIdx = 0, nlen = needle.length(), l...

LeetCode. 27. Remove Element

[Link] https://leetcode.com/problems/remove-element/ class Solution { public int removeElement(int[] nums, int val) { int updateIdx = 0; for(int e: nums) { if(e...

LeetCode. 26. Remove Duplicates from Sorted Array

[Link] https://leetcode.com/problems/remove-duplicates-from-sorted-array/ class Solution { public int removeDuplicates(int[] nums) { int newIdx = 0, curIdx = 1; while(curIdx &l...

BOJ. Bigest square in histogram (6549)

[Link] https://www.acmicpc.net/problem/6549 import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br = new Buf...