Algorithm
https://leetcode.com/problems/shuffle-string/ Shuffle String - 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 1. Problem Given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] ..
1. Problem 2. Code public static void main(String[] args) { int inner = 2; int outer = 4; int[] points_x = {4, 0, 1, -2}; int[] points_y = {-4, 4, 3, 0}; solution(inner, outer, points_x, points_y) } static int solution(int inner, int outer, int[] points_x, int[] points_y) { int cnt = 0; for(int i = 0; i < points_x.length; i++) { int x = points_x[i]; int y = points_y[i]; double len = Math.sqrt(x*..
leetcode.com/problems/search-insert-position/ 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 1. Problem Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it ..
1. Problem 각 세션의 시작시간은 StartTime 함수에 들어있고 각 시작시간의 발표시간은 RunningTime에 들어있다. 시간당 한 세션밖에 발표할 수 없다. 주어진 start_time과 running_time에서 발표가능한 최대 세션 횟수를 구하여라. case1) Input : n = 5; start_time : [1,3,3,5,7], running_time: [2,2,1,2,1] Output : 3 case2) Input : n = 3; start_time : [1, 3, 5], running_time: [2 ,2, 2] Output : 3 case3) Input: n = 1; start_time : [1], running_time: [1] Output: 1 주어진 발표리스트에서 가능한 ..
leetcode.com/problems/same-tree/ Same Tree - 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 1. Problem Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, a..
leetcode.com/problems/add-binary/submissions/ Add Binary - 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 1. Problem Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Ou..
leetcode.com/problems/3sum/ 1. Problem Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Notice that the solution set must not contain duplicate triplets. Example 1: Input: nums = [-1,0,1,2,-1,-4] Output: [[-1,-1,2],[-1,0,1]] Example 2: Input: nums = [] Output: [] Example 3: Input: num..
leetcode.com/problems/insert-interval/ Insert Interval - 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 1. Problem Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted accor..
leetcode.com/problems/maximum-subarray/ Maximum Subarray - 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 1. Problem Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example 1: Input: nums = [-..



